diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/application-1881ae8645.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/application-1881ae8645.json new file mode 100644 index 000000000..a5f5fb1ab --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/application-1881ae8645.json @@ -0,0 +1,138 @@ +{ + "data": { + "id": "ember-4.0.1-@ember/application", + "type": "class", + "attributes": { + "name": "@ember/application", + "shortname": "@ember/application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 41, + "description": "

Framework objects in an Ember application (components, services, routes, etc.)\nare created via a factory and dependency injection system. Each of these\nobjects is the responsibility of an "owner", which handled its\ninstantiation and manages its lifetime.

\n

getOwner fetches the owner object responsible for an instance. This can\nbe used to lookup or resolve other class instances, or register new factories\ninto the owner.

\n

For example, this component dynamically looks up a service based on the\naudioType passed as an argument:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
audio.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getOwner } from '@ember/application';\n\n// Usage:\n//\n//   <PlayAudio @audioType={{@model.audioType}} @audioFile={{@model.file}}/>\n//\nexport default class extends Component {\n  get audioService() {\n    let owner = getOwner(this);\n    return owner.lookup(`service:${this.args.audioType}`);\n  }\n\n  @action\n  onPlay() {\n    let player = this.audioService;\n    player.play(this.args.audioFile);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "getOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object with an owner.", + "type": "Object" + } + ], + "return": { + "description": "An owner object.", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 89, + "description": "

setOwner forces a new owner on a given object instance. This is primarily\nuseful in some testing cases.

\n", + "itemtype": "method", + "name": "setOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object instance.", + "type": "Object" + }, + { + "name": "object", + "description": "The new owner object of the object instance.", + "type": "Object" + } + ], + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.js", + "line": 14, + "description": "

Detects when a specific package of Ember (e.g. 'Application')\nhas fully loaded and is available for extension.

\n

The provided callback will be called with the name passed\nresolved from a string into the object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { onLoad } from '@ember/application';\n\nonLoad('Ember.Application' function(hbars) {\n  hbars.registerHelper(...);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "onLoad", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "callback", + "description": "callback to be called", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.js", + "line": 47, + "description": "

Called when an Ember.js package (e.g Application) has finished\nloading. Triggers any callbacks registered for this event.

\n", + "itemtype": "method", + "name": "runLoadHooks", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "object", + "description": "object to pass to callbacks", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/component/helper-362e20c502.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/component/helper-362e20c502.json new file mode 100644 index 000000000..f4c93c276 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/component/helper-362e20c502.json @@ -0,0 +1,61 @@ +{ + "data": { + "id": "ember-4.0.1-@ember/component/helper", + "type": "class", + "attributes": { + "name": "@ember/component/helper", + "shortname": "@ember/component/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 231, + "description": "

In many cases it is not necessary to use the full Helper class.\nThe helper method create pure-function helpers without instances.\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n
import { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n  return `${currency}${cents * 0.01}`;\n});
\n
\n
\n \n", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/controller-cb2b88c0cc.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/controller-cb2b88c0cc.json new file mode 100644 index 000000000..6cf7ac037 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/controller-cb2b88c0cc.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.0.1-@ember/controller", + "type": "class", + "attributes": { + "name": "@ember/controller", + "shortname": "@ember/controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/controller/index.js", + "line": 17, + "description": "

Creates a property that lazily looks up another controller in the container.\nCan only be used when defining another controller.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default class PostController extends Controller {\n  @controller posts;\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default Controller.extend({\n  posts: controller()\n});
\n
\n
\n \n

This example will create a posts property on the post controller that\nlooks up the posts controller in the container, making it easy to reference\nother controllers.

\n", + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the controller to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/controller", + "module": "@ember/controller" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/debug-9e2214d3cf.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/debug-9e2214d3cf.json new file mode 100644 index 000000000..a84c5f5d2 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/debug-9e2214d3cf.json @@ -0,0 +1,310 @@ +{ + "data": { + "id": "ember-4.0.1-@ember/debug", + "type": "class", + "attributes": { + "name": "@ember/debug", + "shortname": "@ember/debug", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 877, + "description": "

Allows checking if a given property on an object is a computed property. For the most part,\nthis doesn't matter (you would normally just access the property directly and use its value),\nbut for some tooling specific scenarios (e.g. the ember-inspector) it is important to\ndifferentiate if a property is a computed property or a "normal" property.

\n

This will work on either a class's prototype or an instance itself.

\n", + "static": 1, + "itemtype": "method", + "name": "isComputed", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/object" + }, + { + "file": "packages/@ember/debug/lib/capture-render-tree.ts", + "line": 9, + "description": "

Ember Inspector calls this function to capture the current render tree.

\n

In production mode, this requires turning on ENV._DEBUG_RENDER_TREE\nbefore loading Ember.

\n", + "access": "private", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "captureRenderTree", + "params": [ + { + "name": "app", + "description": "An `ApplicationInstance`.", + "type": "ApplicationInstance" + } + ], + "since": "3.14.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 30, + "description": "

Allows for runtime registration of handler functions that override the default deprecation behavior.\nDeprecations are invoked by calls to @ember/debug/deprecate.\nThe following example demonstrates its usage by registering a handler that throws an error if the\nmessage contains the word "should", otherwise defers to the default handler.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { registerDeprecationHandler } from '@ember/debug';\n\nregisterDeprecationHandler((message, options, next) => {\n  if (message.indexOf('should') !== -1) {\n    throw new Error(`Deprecation message with should: ${message}`);\n  } else {\n    // defer to whatever handler was registered before this one\n    next(message, options);\n  }\n});
\n
\n
\n \n

The handler function takes the following arguments:

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerDeprecationHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle deprecation calls.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 169, + "description": "

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only).

\n\n", + "itemtype": "method", + "name": "deprecate", + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "test", + "description": "A boolean. If falsy, the deprecation will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "", + "type": "Object", + "props": [ + { + "name": "id", + "description": "A unique id for this deprecation. The id can be\n used by Ember debugging tools to change the behavior (raise, log or silence)\n for that specific deprecation. The id should be namespaced by dots, e.g.\n \"view.helper.select\".", + "type": "String" + }, + { + "name": "until", + "description": "The version of Ember when this deprecation\n warning will be removed.", + "type": "String" + }, + { + "name": "for", + "description": "A namespace for the deprecation, usually the package name", + "type": "String" + }, + { + "name": "since", + "description": "Describes when the deprecation became available and enabled.", + "type": "Object" + }, + { + "name": "url", + "description": "An optional url to the transition guide on the\n emberjs.com website.", + "type": "String", + "optional": true + } + ] + } + ], + "static": 1, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 23, + "description": "

Allows for runtime registration of handler functions that override the default warning behavior.\nWarnings are invoked by calls made to @ember/debug/warn.\nThe following example demonstrates its usage by registering a handler that does nothing overriding Ember's\ndefault warning behavior.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { registerWarnHandler } from '@ember/debug';\n\n// next is not called, so no warnings get the default behavior\nregisterWarnHandler(() => {});
\n
\n
\n \n

The handler function takes the following arguments:

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWarnHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle warnings.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 70, + "description": "

Display a warning with the provided message.

\n\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { warn } from '@ember/debug';\nimport tomsterCount from './tomster-counter'; // a module in my project\n\n// Log a warning if we have more than 3 tomsters\nwarn('Too many tomsters!', tomsterCount <= 3, {\n  id: 'ember-debug.too-many-tomsters'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "warn", + "static": 1, + "params": [ + { + "name": "message", + "description": "A warning to display.", + "type": "String" + }, + { + "name": "test", + "description": "An optional boolean. If falsy, the warning\n will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "An object that can be used to pass a unique\n `id` for this warning. The `id` can be used by Ember debugging tools\n to change the behavior (raise, log, or silence) for that specific warning.\n The `id` should be namespaced by dots, e.g. \"ember-debug.feature-flag-with-features-stripped\"", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 133, + "description": "

Verify that a certain expectation is met, or throw a exception otherwise.

\n

This is useful for communicating assumptions in the code to other human\nreaders as well as catching bugs that accidentally violates these\nexpectations.

\n

Assertions are removed from production builds, so they can be freely added\nfor documentation and debugging purposes without worries of incuring any\nperformance penalty. However, because of that, they should not be used for\nchecks that could reasonably fail during normal usage. Furthermore, care\nshould be taken to avoid accidentally relying on side-effects produced from\nevaluating the condition itself, since the code will not run in production.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assert } from '@ember/debug';\n\n// Test for truthiness\nassert('Must pass a string', typeof str === 'string');\n\n// Fail unconditionally\nassert('This code path should never be run');
\n
\n
\n \n", + "itemtype": "method", + "name": "assert", + "static": 1, + "params": [ + { + "name": "description", + "description": "Describes the expectation. This will become the\n text of the Error thrown if the assertion fails.", + "type": "String" + }, + { + "name": "condition", + "description": "Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.", + "type": "Any" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 173, + "description": "

Display a debug notice.

\n

Calls to this function are not invoked in production builds.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { debug } from '@ember/debug';\n\ndebug('I\\'m a debug notice!');
\n
\n
\n \n", + "itemtype": "method", + "name": "debug", + "static": 1, + "params": [ + { + "name": "message", + "description": "A debug message to display.", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 200, + "description": "

Display an info notice.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n", + "itemtype": "method", + "name": "info", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 219, + "description": "

Alias an old, deprecated method with its new counterpart.

\n

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only) when the assigned method is called.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { deprecateFunc } from '@ember/debug';\n\nEmber.oldMethod = deprecateFunc('Please use the new, updated method', options, Ember.newMethod);
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecateFunc", + "static": 1, + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "options", + "description": "The options object for `deprecate`.", + "type": "Object", + "optional": true + }, + { + "name": "func", + "description": "The new function called to replace its deprecated counterpart.", + "type": "Function" + } + ], + "return": { + "description": "A new function that wraps the original function with a deprecation warning", + "type": "Function" + }, + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 264, + "description": "

Run a function meant for debugging.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport { runInDebug } from '@ember/debug';\n\nrunInDebug(() => {\n  Component.reopen({\n    didInsertElement() {\n      console.log("I'm happy");\n    }\n  });\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "runInDebug", + "static": 1, + "params": [ + { + "name": "func", + "description": "The function to be executed.", + "type": "Function" + } + ], + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/destroyable-dc954b73a8.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/destroyable-dc954b73a8.json new file mode 100644 index 000000000..b370e9ba3 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/destroyable-dc954b73a8.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.0.1-@ember/destroyable", + "type": "class", + "attributes": { + "name": "@ember/destroyable", + "shortname": "@ember/destroyable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/destroyable", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/destroyable/index.ts", + "line": 31, + "description": "

This function is used to associate a destroyable object with a parent. When the parent\nis destroyed, all registered children will also be destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
class CustomSelect extends Component {\n  constructor() {\n    // obj is now a child of the component. When the component is destroyed,\n    // obj will also be destroyed, and have all of its destructors triggered.\n    this.obj = associateDestroyableChild(this, {});\n  }\n}
\n
\n
\n \n

Returns the associated child for convenience.

\n", + "itemtype": "method", + "name": "associateDestroyableChild", + "params": [ + { + "name": "parent", + "description": "the destroyable to entangle the child destroyables lifetime with", + "type": "Object|Function" + }, + { + "name": "child", + "description": "the destroyable to be entangled with the parents lifetime", + "type": "Object|Function" + } + ], + "return": { + "description": "the child argument", + "type": "Object|Function" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 56, + "description": "

Receives a destroyable, and returns true if the destroyable has begun destroying. Otherwise returns\nfalse.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let obj = {};\nisDestroying(obj); // false\ndestroy(obj);\nisDestroying(obj); // true\n// ...sometime later, after scheduled destruction\nisDestroyed(obj); // true\nisDestroying(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroying", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 78, + "description": "

Receives a destroyable, and returns true if the destroyable has finished destroying. Otherwise\nreturns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let obj = {};\n\nisDestroyed(obj); // false\ndestroy(obj);\n\n// ...sometime later, after scheduled destruction\n\nisDestroyed(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroyed", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 101, + "description": "

Initiates the destruction of a destroyable object. It runs all associated destructors, and then\ndestroys all children recursively.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let obj = {};\n\nregisterDestructor(obj, () => console.log('destroyed!'));\n\ndestroy(obj); // this will schedule the destructor to be called\n\n// ...some time later, during scheduled destruction\n\n// destroyed!
\n
\n
\n \n

Destruction via destroy() follows these steps:

\n

1, Mark the destroyable such that isDestroying(destroyable) returns true\n2, Call destroy() on each of the destroyable's associated children\n3, Schedule calling the destroyable's destructors\n4, Schedule setting destroyable such that isDestroyed(destroyable) returns true

\n

This results in the entire tree of destroyables being first marked as destroying,\nthen having all of their destructors called, and finally all being marked as isDestroyed.\nThere won't be any in between states where some items are marked as isDestroying while\ndestroying, while others are not.

\n", + "itemtype": "method", + "name": "destroy", + "params": [ + { + "name": "destroyable", + "description": "the object to destroy", + "type": "Object|Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 136, + "description": "

This function asserts that all objects which have associated destructors or associated children\nhave been destroyed at the time it is called. It is meant to be a low level hook that testing\nframeworks can use to hook into and validate that all destroyables have in fact been destroyed.

\n

This function requires that enableDestroyableTracking was called previously, and is only\navailable in non-production builds.

\n", + "itemtype": "method", + "name": "assertDestroyablesDestroyed", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 150, + "description": "

This function instructs the destroyable system to keep track of all destroyables (their\nchildren, destructors, etc). This enables a future usage of assertDestroyablesDestroyed\nto be used to ensure that all destroyable tasks (registered destructors and associated children)\nhave completed when assertDestroyablesDestroyed is called.

\n", + "itemtype": "method", + "name": "enableDestroyableTracking", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 162, + "description": "

Receives a destroyable object and a destructor function, and associates the\nfunction with it. When the destroyable is destroyed with destroy, or when its\nparent is destroyed, the destructor function will be called.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { registerDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor() {\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, () => this.resize.unregister(this));\n  }\n}
\n
\n
\n \n

Multiple destructors can be associated with a given destroyable, and they can be\nassociated over time, allowing libraries to dynamically add destructors as needed.\nregisterDestructor also returns the associated destructor function, for convenience.

\n

The destructor function is passed a single argument, which is the destroyable itself.\nThis allows the function to be reused multiple times for many destroyables, rather\nthan creating a closure function per destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { registerDestructor } from '@ember/destroyable';\n\nfunction unregisterResize(instance) {\n  instance.resize.unregister(instance);\n}\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor() {\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, unregisterResize);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "registerDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to register the destructor function with", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to run when the destroyable object is destroyed", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 221, + "description": "

Receives a destroyable and a destructor function, and de-associates the destructor\nfrom the destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { registerDestructor, unregisterDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service modals;\n\n  constructor() {\n    this.modals.add(this);\n\n    this.modalDestructor = registerDestructor(this, () => this.modals.remove(this));\n  }\n\n  @action pinModal() {\n    unregisterDestructor(this, this.modalDestructor);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "unregisterDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to unregister the destructor function from", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to remove from the destroyable", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/destroyable", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/helper-c05ebf4468.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/helper-c05ebf4468.json new file mode 100644 index 000000000..43ffa56b1 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/helper-c05ebf4468.json @@ -0,0 +1,128 @@ +{ + "data": { + "id": "ember-4.0.1-@ember/helper", + "type": "class", + "attributes": { + "name": "@ember/helper", + "shortname": "@ember/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/helper", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/helper/index.ts", + "line": 5, + "description": "

capabilities returns a capabilities configuration which can be used to modify\nthe behavior of the manager. Manager capabilities must be provided using the\ncapabilities function, as the underlying implementation can change over time.

\n

The first argument to capabilities is a version string, which is the version of\nEmber that the capabilities were defined in. Ember can add new versions at any\ntime, and these may have entirely different behaviors, but it will not remove\nold versions until the next major version.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
capabilities('3.23');
\n
\n
\n \n

The second argument is an object of capabilities and boolean values indicating\nwhether they are enabled or disabled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
capabilities('3.23', {\n  hasValue: true,\n  hasDestructor: true,\n});
\n
\n
\n \n

If no value is specified, then the default value will be used.

\n

3.23 capabilities

\n

hasDestroyable

\n\n

Determines if the helper has a destroyable to include in the destructor\nhierarchy. If enabled, the getDestroyable hook will be called, and its result\nwill be associated with the destroyable parent block.

\n

hasValue

\n\n

Determines if the helper has a value which can be used externally. The helper's\ngetValue hook will be run whenever the value of the helper is accessed if this\ncapability is enabled.

\n", + "itemtype": "method", + "name": "capabilities", + "static": 1, + "params": [ + { + "name": "managerApiVersion", + "description": "The version of capabilities that are being used", + "type": "String" + }, + { + "name": "options", + "description": "The capabilities values" + } + ], + "return": { + "description": "The capabilities object instance", + "type": "Capabilities" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 58, + "description": "

Sets the helper manager for an object or function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
setHelperManager((owner) => new ClassHelperManager(owner), Helper)
\n
\n
\n \n

When a value is used as a helper in a template, the helper manager is looked up\non the object by walking up its prototype chain and finding the first helper\nmanager. This manager then receives the value and can create and manage an\ninstance of a helper from it. This provides a layer of indirection that allows\nusers to design high-level helper APIs, without Ember needing to worry about the\ndetails. High-level APIs can be experimented with and iterated on while the\ncore of Ember helpers remains stable, and new APIs can be introduced gradually\nover time to existing code bases.

\n

setHelperManager receives two arguments:

\n
    \n
  1. A factory function, which receives the owner and returns an instance of a\n helper manager.
  2. \n
  3. A helper definition, which is the object or function to associate the factory function with.
  4. \n
\n

The first time the object is looked up, the factory function will be called to\ncreate the helper manager. It will be cached, and in subsequent lookups the\ncached helper manager will be used instead.

\n

Only one helper manager is guaranteed to exist per owner and per usage of\nsetHelperManager, so many helpers will end up using the same instance of the\nhelper manager. As such, you should only store state that is related to the\nmanager itself. If you want to store state specific to a particular helper\ndefinition, you should assign a unique helper manager to that helper. In\ngeneral, most managers should either be stateless, or only have the owner they\nwere created with as state.

\n

Helper managers must fulfill the following interface (This example uses\nTypeScript interfaces\nfor precision, you do not need to write helper managers using TypeScript):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
interface HelperManager<HelperStateBucket> {\n  capabilities: HelperCapabilities;\n\n  createHelper(definition: HelperDefinition, args: TemplateArgs): HelperStateBucket;\n\n  getValue?(bucket: HelperStateBucket): unknown;\n\n  runEffect?(bucket: HelperStateBucket): void;\n\n  getDestroyable?(bucket: HelperStateBucket): object;\n}
\n
\n
\n \n

The capabilities property must be provided using the capabilities() function\nimported from the same module as setHelperManager:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capabilities } from '@ember/helper';\n\nclass MyHelperManager {\n  capabilities = capabilities('3.21.0', { hasValue: true });\n\n  // ...snip...\n}
\n
\n
\n \n

Below is a description of each of the methods on the interface and their\nfunctions.

\n

createHelper

\n

createHelper is a required hook on the HelperManager interface. The hook is\npassed the definition of the helper that is currently being created, and is\nexpected to return a state bucket. This state bucket is what represents the\ncurrent state of the helper, and will be passed to the other lifecycle hooks at\nappropriate times. It is not necessarily related to the definition of the\nhelper itself - for instance, you could return an object containing an\ninstance of the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
class MyManager {\n  createHelper(Definition, args) {\n    return {\n      instance: new Definition(args);\n    };\n  }\n}
\n
\n
\n \n

This allows the manager to store metadata that it doesn't want to expose to the\nuser.

\n

This hook is not autotracked - changes to tracked values used within this hook\nwill not result in a call to any of the other lifecycle hooks. This is because\nit is unclear what should happen if it invalidates, and rather than make a\ndecision at this point, the initial API is aiming to allow as much expressivity\nas possible. This could change in the future with changes to capabilities and\ntheir behaviors.

\n

If users do want to autotrack some values used during construction, they can\neither create the instance of the helper in runEffect or getValue, or they\ncan use the cache API to autotrack the createHelper hook themselves. This\nprovides maximum flexibility and expressiveness to manager authors.

\n

This hook has the following timing semantics:

\n

Always

\n\n

getValue

\n

getValue is an optional hook that should return the value of the helper. This\nis the value that is returned from the helper and passed into the template.

\n

This hook is called when the value is requested from the helper (e.g. when the\ntemplate is rendering and the helper value is needed). The hook is autotracked,\nand will rerun whenever any tracked values used inside of it are updated.\nOtherwise it does not rerun.

\n
\n

Note: This means that arguments which are not consumed within the hook will\nnot trigger updates.

\n
\n

This hook is only called for helpers with the hasValue capability enabled.\nThis hook has the following timing semantics:

\n

Always

\n\n

Never

\n\n

runEffect

\n

runEffect is an optional hook that should run the effect that the helper is\napplying, setting it up or updating it.

\n

This hook is scheduled to be called some time after render and prior to paint.\nThere is not a guaranteed, 1-to-1 relationship between a render pass and this\nhook firing. For instance, multiple render passes could occur, and the hook may\nonly trigger once. It may also never trigger if it was dirtied in one render\npass and then destroyed in the next.

\n

The hook is autotracked, and will rerun whenever any tracked values used inside\nof it are updated. Otherwise it does not rerun.

\n

The hook is also run during a time period where state mutations are disabled\nin Ember. Any tracked state mutation will throw an error during this time,\nincluding changes to tracked properties, changes made using Ember.set, updates\nto computed properties, etc. This is meant to prevent infinite rerenders and\nother antipatterns.

\n

This hook is only called for helpers with the hasScheduledEffect capability\nenabled. This hook is also not called in SSR currently, though this could be\nadded as a capability in the future. It has the following timing semantics:

\n

Always

\n\n

Never

\n\n

getDestroyable

\n

getDestroyable is an optional hook that users can use to register a\ndestroyable object for the helper. This destroyable will be registered to the\ncontaining block or template parent, and will be destroyed when it is destroyed.\nSee the Destroyables RFC\nfor more details.

\n

getDestroyable is only called if the hasDestroyable capability is enabled.

\n

This hook has the following timing semantics:

\n

Always

\n\n

Never

\n\n", + "itemtype": "method", + "name": "setHelperManager", + "static": 1, + "params": [ + { + "name": "factory", + "description": "A factory function which receives an optional owner, and returns a helper manager", + "type": "Function" + }, + { + "name": "definition", + "description": "The definition to associate the manager factory with", + "type": "Object" + } + ], + "return": { + "description": "The definition passed into setHelperManager", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 251, + "description": "

The invokeHelper function can be used to create a helper instance in\nJavaScript.

\n

To access a helper's value you have to use getValue from\n@glimmer/tracking/primitives/cache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
// app/components/data-loader.js\nimport Component from '@glimmer/component';\nimport { getValue } from '@glimmer/tracking/primitives/cache';\nimport Helper from '@ember/component/helper';\nimport { invokeHelper } from '@ember/helper';\n\nclass PlusOne extends Helper {\n  compute([number]) {\n    return number + 1;\n  }\n}\n\nexport default class PlusOneComponent extends Component {\n  plusOne = invokeHelper(this, PlusOne, () => {\n    return {\n      positional: [this.args.number],\n    };\n  });\n\n  get value() {\n    return getValue(this.plusOne);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{this.value}}
\n
\n
\n \n

It receives three arguments:

\n\n

And it returns a Cache instance that contains the most recent value of the\nhelper. You can access the helper using getValue() like any other cache. The\ncache is also destroyable, and using the destroy() function on it will cause\nthe helper to be torn down.

\n

Note that using getValue() on helpers that have scheduled effects will not\ntrigger the effect early. Effects will continue to run at their scheduled time.

\n", + "itemtype": "method", + "name": "invokeHelper", + "static": 1, + "params": [ + { + "name": "context", + "description": "The parent context of the helper", + "type": "Object" + }, + { + "name": "definition", + "description": "The helper definition", + "type": "Object" + }, + { + "name": "computeArgs", + "description": "An optional function that produces args", + "type": "Function" + } + ], + "return": { + "description": "" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/helper", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/object-d1b9a5f61b.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/object-d1b9a5f61b.json new file mode 100644 index 000000000..a21728b5f --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/object-d1b9a5f61b.json @@ -0,0 +1,521 @@ +{ + "data": { + "id": "ember-4.0.1-@ember/object", + "type": "class", + "attributes": { + "name": "@ember/object", + "shortname": "@ember/object", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 702, + "description": "

This helper returns a new property descriptor that wraps the passed\ncomputed property function. You can use this helper to define properties with\nnative decorator syntax, mixins, or via defineProperty().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', function() {\n    return `${this.get('firstName')} ${this.get('lastName')}`;\n  })\n});\n\nlet client = Person.create();\n\nclient.get('fullName'); // 'Betty Jones'\n\nclient.set('lastName', 'Fuller');\nclient.get('fullName'); // 'Betty Fuller'
\n
\n
\n \n

You can also provide a setter, either directly on the class using native class\nsyntax, or by passing a hash with get and set functions.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(/\\s+/);\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n\n    return value;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', {\n    get(key) {\n      return `${this.get('firstName')} ${this.get('lastName')}`;\n    },\n    set(key, value) {\n      let [firstName, lastName] = value.split(/\\s+/);\n      this.setProperties({ firstName, lastName });\n      return value;\n    }\n  })\n});\n\nlet client = Person.create();\nclient.get('firstName'); // 'Betty'\n\nclient.set('fullName', 'Carroll Fuller');\nclient.get('firstName'); // 'Carroll'
\n
\n
\n \n

When passed as an argument, the set function should accept two parameters,\nkey and value. The value returned from set will be the new value of the\nproperty.

\n

Note: This is the preferred way to define computed properties when writing third-party\nlibraries that depend on or use Ember, since there is no guarantee that the user\nwill have prototype Extensions enabled.

\n", + "itemtype": "method", + "name": "computed", + "static": 1, + "params": [ + { + "name": "dependentKeys*", + "description": "Optional dependent keys that trigger this computed property.", + "type": "String", + "optional": true + }, + { + "name": "func", + "description": "The computed property function.", + "type": "Function" + } + ], + "return": { + "description": "property decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/get_properties.ts", + "line": 6, + "description": "

To get multiple properties at once, call getProperties\nwith an object followed by a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, 'firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, ['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + }, + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 749, + "description": "

Specify a method that observes property changes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nimport { observer } from '@ember/object';\n\nexport default EmberObject.extend({\n  valueObserver: observer('value', function() {\n    // Executes whenever the "value" property changes\n  })\n});
\n
\n
\n \n

Also available as Function.prototype.observes if prototype extensions are\nenabled.

\n", + "itemtype": "method", + "name": "observer", + "params": [ + { + "name": "propertyNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "func" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/properties.ts", + "line": 11, + "description": "

NOTE: This is a low-level method used by other parts of the API. You almost\nnever want to call this method directly. Instead you should use\nmixin() to define new properties.

\n

Defines a property on an object. This method works much like the ES5\nObject.defineProperty() method except that it can also accept computed\nproperties and other special descriptors.

\n

Normally this method takes only three parameters. However if you pass an\ninstance of Descriptor as the third param then you can pass an\noptional value as the fourth parameter. This is often more efficient than\ncreating new descriptor hashes for each property.

\n

Examples

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { defineProperty, computed } from '@ember/object';\n\n// ES5 compatible mode\ndefineProperty(contact, 'firstName', {\n  writable: true,\n  configurable: false,\n  enumerable: true,\n  value: 'Charles'\n});\n\n// define a simple property\ndefineProperty(contact, 'lastName', undefined, 'Jolley');\n\n// define a computed property\ndefineProperty(contact, 'fullName', computed('firstName', 'lastName', function() {\n  return this.firstName+' '+this.lastName;\n}));
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "defineProperty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "the object to define this property on. This may be a prototype.", + "type": "Object" + }, + { + "name": "keyName", + "description": "the name of the property", + "type": "String" + }, + { + "name": "desc", + "description": "an instance of `Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.", + "type": "Descriptor", + "optional": true + }, + { + "name": "data", + "description": "something other than a descriptor, that will\n become the explicit value of this property.", + "type": "*", + "optional": true + } + ], + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 19, + "description": "

This function is called just after an object property has changed.\nIt will notify any observers and clear caches among other things.

\n

Normally you will not need to call this method directly but if for some\nreason you can't directly watch a property you can invoke this method\nmanually.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "obj", + "description": "The object with the property that will change", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key (or path) that will change.", + "type": "String" + }, + { + "name": "_meta", + "description": "The objects meta.", + "type": "Meta", + "optional": true + }, + { + "name": "value", + "description": "The new value to set for the property", + "type": "Unknown", + "optional": true + } + ], + "return": { + "description": "", + "type": "Void" + }, + "since": "3.1.0", + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 67, + "itemtype": "method", + "name": "beginPropertyChanges", + "chainable": 1, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 77, + "itemtype": "method", + "name": "endPropertyChanges", + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 89, + "description": "

Make a series of property changes together in an\nexception-safe way.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
Ember.changeProperties(function() {\n  obj1.set('foo', mayBlowUpWhenSet);\n  obj2.set('bar', baz);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "changeProperties", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_get.ts", + "line": 41, + "description": "

Gets the value of a property on an object. If the property is computed,\nthe function will be invoked. If the property is not defined but the\nobject implements the unknownProperty method then that will be invoked.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { get } from '@ember/object';\nget(obj, "name");
\n
\n
\n \n

If you plan to run on IE8 and older browsers then you should use this\nmethod anytime you want to retrieve a property on an object that you don't\nknow for sure is private. (Properties beginning with an underscore '_'\nare considered private.)

\n

On all newer browsers, you only need to use this method to retrieve\nproperties if the property might not be defined on the object and you want\nto respect the unknownProperty handler. Otherwise you can ignore this\nmethod.

\n

Note that if the object itself is undefined, this method will throw\nan error.

\n", + "itemtype": "method", + "name": "get", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to retrieve from.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to retrieve", + "type": "String" + } + ], + "return": { + "description": "the property value or `null`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 18, + "description": "

Sets the value of a property on an object, respecting computed properties\nand notifying observers and other listeners of the change.\nIf the specified property is not defined on the object and the object\nimplements the setUnknownProperty method, then instead of setting the\nvalue of the property on the object, its setUnknownProperty handler\nwill be invoked with the two parameters keyName and value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { set } from '@ember/object';\nset(obj, "name", value);
\n
\n
\n \n", + "itemtype": "method", + "name": "set", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "return": { + "description": "the passed value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 124, + "description": "

Error-tolerant form of set. Will not blow up if any part of the\nchain is undefined, null, or destroyed.

\n

This is primarily used when syncing bindings, which may try to update after\nan object has been destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { trySet } from '@ember/object';\n\nlet obj = { name: "Zoey" };\ntrySet(obj, "contacts.twitter", "@emberjs");
\n
\n
\n \n", + "itemtype": "method", + "name": "trySet", + "static": 1, + "params": [ + { + "name": "root", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "path", + "description": "The property path to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/set_properties.ts", + "line": 6, + "description": "

Set a list of properties on an object. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nlet anObject = EmberObject.create();\n\nanObject.setProperties({\n  firstName: 'Stanley',\n  lastName: 'Stuart',\n  age: 21\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "properties", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "properties" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 575, + "description": "

Creates a new subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(thing);\n   }\n});
\n
\n
\n \n

This defines a new subclass of EmberObject: Person. It contains one method: say().

\n

You can also create a subclass from any existing class by calling its extend() method.\nFor example, you might want to create a subclass of Ember's built-in Component class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nconst PersonComponent = Component.extend({\n  tagName: 'li',\n  classNameBindings: ['isAdministrator']\n});
\n
\n
\n \n

When defining a subclass, you can override methods but still access the\nimplementation of your parent class by calling the special _super() method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    let name = this.get('name');\n    alert(`${name} says: ${thing}`);\n  }\n});\n\nconst Soldier = Person.extend({\n  say(thing) {\n    this._super(`${thing}, sir!`);\n  },\n  march(numberOfHours) {\n    alert(`${this.get('name')} marches for ${numberOfHours} hours.`);\n  }\n});\n\nlet yehuda = Soldier.create({\n  name: 'Yehuda Katz'\n});\n\nyehuda.say('Yes');  // alerts "Yehuda Katz says: Yes, sir!"
\n
\n
\n \n

The create() on line #17 creates an instance of the Soldier class.\nThe extend() on line #8 creates a subclass of Person. Any instance\nof the Person class will not have the march() method.

\n

You can also pass Mixin classes to add additional properties to the subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import EmberObject from '@ember/object';\nimport Mixin from '@ember/object/mixin';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(`${this.get('name')} says: ${thing}`);\n  }\n});\n\nconst SingingMixin = Mixin.create({\n  sing(thing) {\n    alert(`${this.get('name')} sings: la la la ${thing}`);\n  }\n});\n\nconst BroadwayStar = Person.extend(SingingMixin, {\n  dance() {\n    alert(`${this.get('name')} dances: tap tap tap tap `);\n  }\n});
\n
\n
\n \n

The BroadwayStar class contains three methods: say(), sing(), and dance().

\n", + "itemtype": "method", + "name": "extend", + "static": 1, + "params": [ + { + "name": "mixins", + "description": "One or more Mixin classes", + "type": "Mixin", + "optional": true, + "multiple": true + }, + { + "name": "arguments", + "description": "Object containing values to use within the new class", + "type": "Object", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 675, + "description": "

Creates an instance of a class. Accepts either no arguments, or an object\ncontaining values to initialize the newly instantiated object with.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  helloWorld() {\n    alert(`Hi, my name is ${this.get('name')}`);\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\n\ntom.helloWorld(); // alerts "Hi, my name is Tom Dale".
\n
\n
\n \n

create will call the init function if defined during\nAnyObject.extend

\n

If no arguments are passed to create, it will not set values to the new\ninstance during initialization:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let noName = Person.create();\nnoName.helloWorld(); // alerts undefined
\n
\n
\n \n

NOTE: For performance reasons, you cannot declare methods or computed\nproperties during create. You should instead declare methods and computed\nproperties when using extend.

\n", + "itemtype": "method", + "name": "create", + "static": 1, + "params": [ + { + "name": "arguments", + "description": "", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 735, + "description": "

Augments a constructor's prototype with additional\nproperties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\no = MyObject.create();\no.get('name'); // 'an object'\n\nMyObject.reopen({\n  say(msg) {\n    console.log(msg);\n  }\n});\n\no2 = MyObject.create();\no2.say('hello'); // logs "hello"\n\no.say('goodbye'); // logs "goodbye"
\n
\n
\n \n

To add functions and properties to the constructor itself,\nsee reopenClass

\n", + "itemtype": "method", + "name": "reopen", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 789, + "description": "

Augments a constructor's own properties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\nMyObject.reopenClass({\n  canBuild: false\n});\n\nMyObject.canBuild; // false\no = MyObject.create();
\n
\n
\n \n

In other words, this creates static properties and functions for the class.\nThese are only available on the class and not on any instance of that class.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  name: '',\n  sayHello() {\n    alert(`Hello. My name is ${this.get('name')}`);\n  }\n});\n\nPerson.reopenClass({\n  species: 'Homo sapiens',\n\n  createPerson(name) {\n    return Person.create({ name });\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\nlet yehuda = Person.createPerson('Yehuda Katz');\n\ntom.sayHello(); // "Hello. My name is Tom Dale"\nyehuda.sayHello(); // "Hello. My name is Yehuda Katz"\nalert(Person.species); // "Homo sapiens"
\n
\n
\n \n

Note that species and createPerson are not valid on the tom and yehuda\nvariables. They are only valid on Person.

\n

To add functions and properties to instances of\na constructor by extending the constructor's prototype\nsee reopen

\n", + "itemtype": "method", + "name": "reopenClass", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 872, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For\nexample, computed property functions may close over variables that are then\nno longer available for introspection.

\n

You can pass a hash of these values to a computed property like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { computed } from '@ember/object';\n\nperson: computed(function() {\n  let personId = this.get('personId');\n  return Person.create({ id: personId });\n}).meta({ type: Person })
\n
\n
\n \n

Once you've done this, you can retrieve the values saved to the computed\nproperty from your class like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyClass.metaForProperty('person');
\n
\n
\n \n

This will return the original hash that was passed to meta().

\n", + "static": 1, + "itemtype": "method", + "name": "metaForProperty", + "params": [ + { + "name": "key", + "description": "property name", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 915, + "description": "

Iterate over each computed property for the class, passing its name\nand any associated metadata (see metaForProperty) to the callback.

\n", + "static": 1, + "itemtype": "method", + "name": "eachComputedProperty", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "binding", + "description": "", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 1025, + "description": "

Provides lookup-time type validation for injected properties.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_onLookup", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 1046, + "description": "

Returns a hash of property names and container names that injected\nproperties will lookup on the container lazily.

\n", + "itemtype": "method", + "name": "_lazyInjections", + "return": { + "description": "Hash of all lazy injected property keys to container names", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/index.js", + "line": 18, + "description": "

Decorator that turns the target function into an Action which can be accessed\ndirectly by reference.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action this.toggleShowing}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

Decorated actions also interop with the string style template actions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action "toggleShowing"}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

It also binds the function directly to the instance, so it can be used in any\ncontext and will correctly refer to the class it came from:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert this.toggleShowing}}\n  {{on "click" this.toggleShowing}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

This can also be used in JavaScript code directly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  constructor() {\n    super(...arguments);\n\n    // this.toggleShowing is still bound correctly when added to\n    // the event listener\n    document.addEventListener('click', this.toggleShowing);\n  }\n\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n

This is considered best practice, since it means that methods will be bound\ncorrectly no matter where they are used. By contrast, the {{action}} helper\nand modifier can also be used to bind context, but it will be required for\nevery usage of the method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert (action this.toggleShowing)}}\n  {{on "click" (action this.toggleShowing)}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

They also do not have equivalents in JavaScript directly, so they cannot be\nused for other situations where binding would be useful.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "action", + "static": 1, + "params": [ + { + "name": "callback", + "description": "The function to turn into an action,\n when used in classic classes", + "type": "Function|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/object/compat-54fe6c741d.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/object/compat-54fe6c741d.json new file mode 100644 index 000000000..6820e03ee --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/object/compat-54fe6c741d.json @@ -0,0 +1,64 @@ +{ + "data": { + "id": "ember-4.0.1-@ember/object/compat", + "type": "class", + "attributes": { + "name": "@ember/object/compat", + "shortname": "@ember/object/compat", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/object/compat.ts", + "line": 39, + "description": "

@dependentKeyCompat is decorator that can be used on native getters that\nuse tracked properties. It exposes the getter to Ember's classic computed\nproperty and observer systems, so they can watch it for changes. It can be\nused in both native and classic classes.

\n

Native Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { computed, set } from '@ember/object';\n\nclass Person {\n  @tracked firstName;\n  @tracked lastName;\n\n  @dependentKeyCompat\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nclass Profile {\n  constructor(person) {\n    set(this, 'person', person);\n  }\n\n  @computed('person.fullName')\n  get helloMessage() {\n    return `Hello, ${this.person.fullName}!`;\n  }\n}
\n
\n
\n \n

Classic Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport EmberObject, { computed, observer, set } from '@ember/object';\n\nconst Person = EmberObject.extend({\n  firstName: tracked(),\n  lastName: tracked(),\n\n  fullName: dependentKeyCompat(function() {\n    return `${this.firstName} ${this.lastName}`;\n  }),\n});\n\nconst Profile = EmberObject.extend({\n  person: null,\n\n  helloMessage: computed('person.fullName', function() {\n    return `Hello, ${this.person.fullName}!`;\n  }),\n\n  onNameUpdated: observer('person.fullName', function() {\n    console.log('person name updated!');\n  }),\n});
\n
\n
\n \n

dependentKeyCompat() can receive a getter function or an object containing\nget/set methods when used in classic classes, like computed properties.

\n

In general, only properties which you expect to be watched by older,\nuntracked clases should be marked as dependency compatible. The decorator is\nmeant as an interop layer for parts of Ember's older classic APIs, and should\nnot be applied to every possible getter/setter in classes. The number of\ndependency compatible getters should be minimized wherever possible. New\napplication code should not need to use @dependentKeyCompat, since it is\nonly for interoperation with older code.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "dependentKeyCompat", + "static": 1, + "params": [ + { + "name": "desc", + "description": "A property descriptor containing\n the getter and setter (when used in\n classic classes)", + "type": "PropertyDescriptor|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object/compat", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/object/computed-0852631994.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/object/computed-0852631994.json new file mode 100644 index 000000000..133f5301a --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/object/computed-0852631994.json @@ -0,0 +1,903 @@ +{ + "data": { + "id": "ember-4.0.1-@ember/object/computed", + "type": "class", + "attributes": { + "name": "@ember/object/computed", + "shortname": "@ember/object/computed", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/expand_properties.ts", + "line": 9, + "description": "

Expands pattern, invoking callback for each expansion.

\n

The only pattern supported is brace-expansion, anything else will be passed\nonce to callback directly.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { expandProperties } from '@ember/object/computed';\n\nfunction echo(arg){ console.log(arg); }\n\nexpandProperties('foo.bar', echo);              //=> 'foo.bar'\nexpandProperties('{foo,bar}', echo);            //=> 'foo', 'bar'\nexpandProperties('foo.{bar,baz}', echo);        //=> 'foo.bar', 'foo.baz'\nexpandProperties('{foo,bar}.baz', echo);        //=> 'foo.baz', 'bar.baz'\nexpandProperties('foo.{bar,baz}.[]', echo)      //=> 'foo.bar.[]', 'foo.baz.[]'\nexpandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs'\nexpandProperties('{foo}.bar.{baz}')             //=> 'foo.bar.baz'
\n
\n
\n \n", + "itemtype": "method", + "name": "expandProperties", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "pattern", + "description": "The property pattern to expand.", + "type": "String" + }, + { + "name": "callback", + "description": "The callback to invoke. It is invoked once per\nexpansion, and is passed the expansion.", + "type": "Function" + } + ], + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 63, + "description": "

A computed property macro that returns true if the value of the dependent\nproperty is null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { empty } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  @empty('todos') isDone;\n}\n\nlet todoList = new ToDoList(\n  ['Unit Test', 'Documentation', 'Release']\n);\n\ntodoList.isDone; // false\nset(todoList, 'todos', []);\ntodoList.isDone; // true
\n
\n
\n \n", + "since": "1.6.0", + "itemtype": "method", + "name": "empty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if the value\nof the dependent property is null, an empty string, empty array, or empty\nfunction and false if the underlying value is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 112, + "description": "

A computed property that returns true if the value of the dependent property\nis NOT null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { notEmpty } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(backpack) {\n    set(this, 'backpack', backpack);\n  }\n\n  @notEmpty('backpack') hasStuff\n}\n\nlet hamster = new Hamster(\n  ['Food', 'Sleeping Bag', 'Tent']\n);\n\nhamster.hasStuff; // true\nset(hamster, 'backpack', []);\nhamster.hasStuff; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "notEmpty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 158, + "description": "

A computed property that returns true if the value of the dependent property\nis null or undefined. This avoids errors from JSLint complaining about use of\n==, which can be technically confusing.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { none } from '@ember/object/computed';\n\nclass Hamster {\n  @none('food') isHungry;\n}\n\nlet hamster = new Hamster();\n\nhamster.isHungry; // true\n\nset(hamster, 'food', 'Banana');\nhamster.isHungry; // false\n\nset(hamster, 'food', null);\nhamster.isHungry; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "none", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is null or undefined.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 201, + "description": "

A computed property that returns the inverse boolean value of the original\nvalue for the dependent property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { not } from '@ember/object/computed';\n\nclass User {\n  loggedIn = false;\n\n  @not('loggedIn') isAnonymous;\n}\n\nlet user = new User();\n\nuser.isAnonymous; // true\nset(user, 'loggedIn', true);\nuser.isAnonymous; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "not", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns inverse of the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 243, + "description": "

A computed property that converts the provided dependent property into a\nboolean value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { bool } from '@ember/object/computed';\n\n\nclass Hamster {\n  @bool('numBananas') hasBananas\n}\n\nlet hamster = new Hamster();\n\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 0);\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 1);\nhamster.hasBananas; // true\n\nset(hamster, 'numBananas', null);\nhamster.hasBananas; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "bool", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which converts to boolean the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 291, + "description": "

A computed property which matches the original value for the dependent\nproperty against a given RegExp, returning true if the value matches the\nRegExp and false if it does not.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { match } from '@ember/object/computed';\n\nclass User {\n  @match('email', /^.+@.+\\..+$/) hasValidEmail;\n}\n\nlet user = new User();\n\nuser.hasValidEmail; // false\n\nset(user, 'email', '');\nuser.hasValidEmail; // false\n\nset(user, 'email', 'ember_hamster@example.com');\nuser.hasValidEmail; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "match", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "regexp", + "description": "", + "type": "RegExp" + } + ], + "return": { + "description": "computed property which match the original value\nfor property against a given RegExp", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 338, + "description": "

A computed property that returns true if the provided dependent property is\nequal to the given value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { equal } from '@ember/object/computed';\n\nclass Hamster {\n  @equal('percentCarrotsEaten', 100) satisfied;\n}\n\nlet hamster = new Hamster();\n\nhamster.satisfied; // false\n\nset(hamster, 'percentCarrotsEaten', 100);\nhamster.satisfied; // true\n\nset(hamster, 'percentCarrotsEaten', 50);\nhamster.satisfied; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "equal", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "String|Number|Object" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is equal to the given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 383, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gt } from '@ember/object/computed';\n\nclass Hamster {\n  @gt('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 11);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 428, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gte } from '@ember/object/computed';\n\nclass Hamster {\n  @gte('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 10);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater or equal then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 473, + "description": "

A computed property that returns true if the provided dependent property is\nless than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lt } from '@ember/object/computed';\n\nclass Hamster {\n  @lt('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 2);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 518, + "description": "

A computed property that returns true if the provided dependent property is\nless than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lte } from '@ember/object/computed';\n\nclass Hamster {\n  @lte('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 5);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less or equal than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 563, + "description": "

A computed property that performs a logical and on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first falsy value or last\ntruthy value just like JavaScript's && operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { and } from '@ember/object/computed';\n\nclass Hamster {\n  @and('hasTent', 'hasBackpack') readyForCamp;\n  @and('hasWalkingStick', 'hasBackpack') readyForHike;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForCamp; // false\n\nset(tomster, 'hasTent', true);\ntomster.readyForCamp; // false\n\nset(tomster, 'hasBackpack', true);\ntomster.readyForCamp; // true\n\nset(tomster, 'hasBackpack', 'Yes');\ntomster.readyForCamp; // 'Yes'\n\nset(tomster, 'hasWalkingStick', null);\ntomster.readyForHike; // null
\n
\n
\n \n", + "itemtype": "method", + "name": "and", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `and` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 609, + "description": "

A computed property which performs a logical or on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first truthy value or last\nfalsy value just like JavaScript's || operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { or } from '@ember/object/computed';\n\nclass Hamster {\n  @or('hasJacket', 'hasUmbrella') readyForRain;\n  @or('hasSunscreen', 'hasUmbrella') readyForBeach;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForRain; // undefined\n\nset(tomster, 'hasUmbrella', true);\ntomster.readyForRain; // true\n\nset(tomster, 'hasJacket', 'Yes');\ntomster.readyForRain; // 'Yes'\n\nset(tomster, 'hasSunscreen', 'Check');\ntomster.readyForBeach; // 'Check'
\n
\n
\n \n", + "itemtype": "method", + "name": "or", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `or` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 652, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { alias } from '@ember/object/computed';\n\nclass Person {\n  name = 'Alex Matchneer';\n\n  @alias('name') nomen;\n}\n\nlet alex = new Person();\n\nalex.nomen; // 'Alex Matchneer'\nalex.name;  // 'Alex Matchneer'\n\nset(alex, 'nomen', '@machty');\nalex.name;  // '@machty'
\n
\n
\n \n", + "itemtype": "method", + "name": "alias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates an alias to the\noriginal value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 687, + "description": "

Where the alias computed macro aliases get and set, and allows for\nbidirectional data flow, the oneWay computed macro only provides an aliased\nget. The set will not mutate the upstream property, rather causes the\ncurrent property to become the value set. This causes the downstream property\nto permanently diverge from the upstream property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { oneWay }from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @oneWay('firstName') nickName;\n}\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear');\nteddy.firstName; // 'Teddy'\nteddy.nickName; // 'TeddyBear'
\n
\n
\n \n", + "itemtype": "method", + "name": "oneWay", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 735, + "description": "

This is a more semantically meaningful alias of the oneWay computed macro,\nwhose name is somewhat ambiguous as to which direction the data flows.

\n", + "itemtype": "method", + "name": "reads", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\n property to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 748, + "description": "

Where oneWay computed macro provides oneWay bindings, the readOnly\ncomputed macro provides a readOnly one way binding. Very often when using\nthe oneWay macro one does not also want changes to propagate back up, as\nthey will replace the value.

\n

This prevents the reverse flow, and also throws an exception when it occurs.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { readOnly } from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @readOnly('firstName') nickName;\n});\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear'); // throws Exception\n// throw new EmberError('Cannot Set: nickName on: <User:ember27288>' );`\n\nteddy.firstName; // 'Teddy'
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 799, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property, but also print a deprecation warning.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { set } from '@ember/object';\nimport { deprecatingAlias } from '@ember/object/computed';\n\nclass Hamster {\n  @deprecatingAlias('cavendishCount', {\n    id: 'hamster.deprecate-banana',\n    until: '3.0.0'\n  })\n  bananaCount;\n}\n\nlet hamster = new Hamster();\n\nset(hamster, 'bananaCount', 5); // Prints a deprecation warning.\nhamster.cavendishCount; // 5
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecatingAlias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "Options for `deprecate`.", + "type": "Object" + } + ], + "return": { + "description": "computed property which creates an alias with a\ndeprecation to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 56, + "description": "

A computed property that returns the sum of the values in the dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { sum } from '@ember/object/computed';\n\nclass Invoice {\n  lineItems = [1.00, 2.50, 9.99];\n\n  @sum('lineItems') total;\n}\n\nlet invoice = new Invoice();\n\ninvoice.total; // 13.49
\n
\n
\n \n", + "itemtype": "method", + "name": "sum", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the sum of all values in the\ndependentKey's array", + "type": "ComputedProperty" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 93, + "description": "

A computed property that calculates the maximum value in the dependent array.\nThis will return -Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, max } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @max('childAges') maxChildAge;\n}\n\nlet lordByron = new Person();\n\nlordByron.maxChildAge; // -Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.maxChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.maxChildAge; // 8
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe max of a list of Date objects will be the highest timestamp as a Number.\nThis behavior is consistent with Math.max.

\n", + "itemtype": "method", + "name": "max", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the largest value in the dependentKey's\narray", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 157, + "description": "

A computed property that calculates the minimum value in the dependent array.\nThis will return Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, min } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @min('childAges') minChildAge;\n}\n\nlet lordByron = Person.create({ children: [] });\n\nlordByron.minChildAge; // Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.minChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.minChildAge; // 5
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe min of a list of Date objects will be the lowest timestamp as a Number.\nThis behavior is consistent with Math.min.

\n", + "itemtype": "method", + "name": "min", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the smallest value in the dependentKey's array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 220, + "description": "

Returns an array mapped via the callback

\n

The callback method you provide should have the following signature:

\n\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function mapCallback(item, index);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', function(chore, index) {\n    return `${chore.toUpperCase()}!`;\n  })\n  excitingChores;\n});\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n

You can optionally pass an array of additional dependent keys as the second\nparameter to the macro, if your map function relies on any external values:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  shouldUpperCase = false;\n\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', ['shouldUpperCase'], function(chore, index) {\n    if (this.shouldUpperCase) {\n      return `${chore.toUpperCase()}!`;\n    } else {\n      return `${chore}!`;\n    }\n  })\n  excitingChores;\n}\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['clean!', 'write more unit tests!']\n\nset(hamster, 'shouldUpperCase', true);\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional\ndependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "an array mapped via the callback", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 321, + "description": "

Returns an array mapped to the specified key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import { set } from '@ember/object';\nimport { mapBy } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n}\n\nlet lordByron = new Person();\n\nlordByron.childAges; // []\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.childAges; // [7]\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.childAges; // [7, 5, 8]
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "an array mapped to the specified key", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 388, + "description": "

Filters the array by the callback.

\n

The callback method you provide should have the following signature:

\n\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function filterCallback(item, index, array);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = Hamster.create([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]
\n
\n
\n \n

You can also use @each.property in your dependent key, the callback will\nstill use the underlying array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores.@each.done', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n\nset(hamster.chores[2], 'done', true);\nhamster.remainingChores; // []
\n
\n
\n \n

Finally, you can optionally pass an array of additional dependent keys as the\nsecond parameter to the macro, if your filter function relies on any external\nvalues:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  doneKey = 'finished';\n\n  @filter('chores', ['doneKey'], function(chore, index, array) {\n    return !chore[this.doneKey];\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', finished: true },\n  { name: 'clean', finished: true },\n  { name: 'write more unit tests', finished: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', finished: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional dependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 519, + "description": "

Filters the array by the property and value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { filterBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filterBy('chores', 'done', false) remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{ name: 'write more unit tests', done: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "*" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 575, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniq } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniq('fruits') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  'banana',\n  'grape',\n  'kale',\n  'banana'\n]);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale']
\n
\n
\n \n", + "itemtype": "method", + "name": "uniq", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 641, + "description": "

A computed property which returns a new array with all the unique elements\nfrom an array, with uniqueness determined by specific key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniqBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniqBy('fruits', 'id') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  { id: 1, 'banana' },\n  { id: 2, 'grape' },\n  { id: 3, 'peach' },\n  { id: 1, 'banana' }\n]);\n\nhamster.uniqueFruits; // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 695, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { union } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits, vegetables) {\n    set(this, 'fruits', fruits);\n    set(this, 'vegetables', vegetables);\n  }\n\n  @union('fruits', 'vegetables') uniqueFruits;\n});\n\nlet hamster = new, Hamster(\n  [\n    'banana',\n    'grape',\n    'kale',\n    'banana',\n    'tomato'\n  ],\n  [\n    'tomato',\n    'carrot',\n    'lettuce'\n  ]\n);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale', 'tomato', 'carrot', 'lettuce']
\n
\n
\n \n", + "itemtype": "method", + "name": "union", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the unique elements\nfrom one or more dependent arrays.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 742, + "description": "

A computed property which returns a new array with all the elements\ntwo or more dependent arrays have in common.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { intersect } from '@ember/object/computed';\n\nclass FriendGroups {\n  constructor(adaFriends, charlesFriends) {\n    set(this, 'adaFriends', adaFriends);\n    set(this, 'charlesFriends', charlesFriends);\n  }\n\n  @intersect('adaFriends', 'charlesFriends') friendsInCommon;\n}\n\nlet groups = new FriendGroups(\n  ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n  ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock']\n);\n\ngroups.friendsInCommon; // ['William King', 'Mary Somerville']
\n
\n
\n \n", + "itemtype": "method", + "name": "intersect", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the duplicated\nelements from the dependent arrays", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 816, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array that are not in the second dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { setDiff } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(likes, fruits) {\n    set(this, 'likes', likes);\n    set(this, 'fruits', fruits);\n  }\n\n  @setDiff('likes', 'fruits') wants;\n}\n\nlet hamster = new Hamster(\n  [\n    'banana',\n    'grape',\n    'kale'\n  ],\n  [\n    'grape',\n    'kale',\n  ]\n);\n\nhamster.wants; // ['banana']
\n
\n
\n \n", + "itemtype": "method", + "name": "setDiff", + "static": 1, + "params": [ + { + "name": "setAProperty", + "description": "", + "type": "String" + }, + { + "name": "setBProperty", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the items from the\nfirst dependent array that are not in the second dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 886, + "description": "

A computed property that returns the array of values for the provided\ndependent properties.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { collect } from '@ember/object/computed';\n\nclass Hamster {\n  @collect('hat', 'shirt') clothes;\n}\n\nlet hamster = new Hamster();\n\nhamster.clothes; // [null, null]\n\nset(hamster, 'hat', 'Camp Hat');\nset(hamster, 'shirt', 'Camp Shirt');\nhamster.clothes; // ['Camp Hat', 'Camp Shirt']
\n
\n
\n \n", + "itemtype": "method", + "name": "collect", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which maps values of all passed\nin properties to an array.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 937, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array sorted based on a property or sort function. The sort\nmacro can be used in two different ways:

\n
    \n
  1. By providing a sort callback function
  2. \n
  3. By providing an array of keys to sort the array
  4. \n
\n

In the first form, the callback method you provide should have the following\nsignature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function sortCallback(itemA, itemB);
\n
\n
\n \n\n

This function should return negative number (e.g. -1) when itemA should\ncome before itemB. It should return positive number (e.g. 1) when itemA\nshould come after itemB. If the itemA and itemB are equal this function\nshould return 0.

\n

Therefore, if this function is comparing some numeric values, simple itemA - itemB or itemA.get( 'foo' ) - itemB.get( 'foo' ) can be used instead of\nseries of if.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', function(a, b){\n    if (a.priority > b.priority) {\n      return 1;\n    } else if (a.priority < b.priority) {\n      return -1;\n    }\n\n    return 0;\n  })\n  priorityTodos;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

You can also optionally pass an array of additional dependent keys as the\nsecond parameter, if your sort function is dependent on additional values that\ncould changes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n
import EmberObject, { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  sortKey = 'priority';\n\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', ['sortKey'], function(a, b){\n    if (a[this.sortKey] > b[this.sortKey]) {\n      return 1;\n    } else if (a[this.sortKey] < b[this.sortKey]) {\n      return -1;\n    }\n\n    return 0;\n  })\n  sortedTodos;\n});\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

In the second form, you should provide the key of the array of sort values as\nthe second parameter:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using standard ascending sort\n  todosSorting = ['name'];\n  @sort('todos', 'todosSorting') sortedTodos;\n\n  // using descending sort\n  todosSortingDesc = ['name:desc'];\n  @sort('todos', 'todosSortingDesc') sortedTodosDesc;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.sortedTodos; // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\ntodoList.sortedTodosDesc; // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n", + "itemtype": "method", + "name": "sort", + "static": 1, + "params": [ + { + "name": "itemsKey", + "description": "", + "type": "String" + }, + { + "name": "sortDefinitionOrDependentKeys", + "description": "The key of the sort definition (an array of sort properties),\nthe sort function, or an array of additional dependent keys", + "type": "String|Function|Array" + }, + { + "name": "sortDefinition", + "description": "the sort function (when used with additional dependent keys)", + "type": "Function?" + } + ], + "return": { + "description": "computes a new sorted array based on the sort\nproperty array or callback function", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/object/evented-bc3aebcc7f.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/object/evented-bc3aebcc7f.json new file mode 100644 index 000000000..0452c868f --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/object/evented-bc3aebcc7f.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.0.1-@ember/object/evented", + "type": "class", + "attributes": { + "name": "@ember/object/evented", + "shortname": "@ember/object/evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 178, + "description": "

Define a property as a function that should be executed when\na specified event or events are triggered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\nimport { on } from '@ember/object/evented';\nimport { sendEvent } from '@ember/object/events';\n\nlet Job = EmberObject.extend({\n  logCompleted: on('completed', function() {\n    console.log('Job completed!');\n  })\n});\n\nlet job = Job.create();\n\nsendEvent(job, 'completed'); // Logs 'Job completed!'
\n
\n
\n \n", + "itemtype": "method", + "name": "on", + "static": 1, + "params": [ + { + "name": "eventNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the listener function, passed as last argument to on(...)", + "type": "Function" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/polyfills-3d9508e94f.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/polyfills-2d8a185de1.json similarity index 95% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/polyfills-3d9508e94f.json rename to json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/polyfills-2d8a185de1.json index c76655818..855cb5dc6 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/polyfills-3d9508e94f.json +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/polyfills-2d8a185de1.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/polyfills", + "id": "ember-4.0.1-@ember/polyfills", "type": "class", "attributes": { "name": "@ember/polyfills", @@ -55,13 +55,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/polyfills", + "id": "ember-4.0.1-@ember/polyfills", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.0.1", "type": "project-version" } } diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/runloop-11e1af9814.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/runloop-11e1af9814.json new file mode 100644 index 000000000..68bf5c724 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/runloop-11e1af9814.json @@ -0,0 +1,497 @@ +{ + "data": { + "id": "ember-4.0.1-@ember/runloop", + "type": "class", + "attributes": { + "name": "@ember/runloop", + "shortname": "@ember/runloop", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/runloop", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/runloop/index.js", + "line": 74, + "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

Normally 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { run } from '@ember/runloop';\n\nrun(function() {\n  // code to be executed within a RunLoop\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "run", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "return value from invoking the passed function.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 106, + "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

Please note: This is not for normal usage, and should be used sparingly.

\n

If invoked when not within a run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { join } from '@ember/runloop';\n\njoin(function() {\n  // creates a new run-loop\n});
\n
\n
\n \n

Alternatively, if called within an existing run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "join", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Return value from invoking the passed function. Please note,\nwhen called within an existing loop, no return value is possible.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 154, + "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

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

Let'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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import 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
\n \n

In 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.

\n", + "itemtype": "method", + "name": "bind", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "returns a new function that will always have a particular context", + "type": "Function" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 241, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "begin", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 264, + "description": "

Ends a RunLoop. This must be called sometime after you call\nbegin() to flush any deferred actions. This is a lower-level way\nto use a RunLoop instead of using run().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "end", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 287, + "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

At 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "schedule", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'", + "type": "String" + }, + { + "name": "target", + "description": "target object to use as the context when invoking a method.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.", + "type": "String|Function" + }, + { + "name": "arguments*", + "description": "Optional arguments to be passed to the queued method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 342, + "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

You 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "later", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 376, + "description": "

Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling scheduleOnce with the "actions" queue.

\n", + "itemtype": "method", + "name": "once", + "static": 1, + "params": [ + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 396, + "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

Note that although you can pass optional arguments these will not be\nconsidered when looking for duplicates. New arguments will replace previous\ncalls.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Also note that for scheduleOnce to prevent additional calls, you need to\npass the same function instance. The following case works as expected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
function log() {\n  console.log('Logging only once');\n}\n\nfunction scheduleIt() {\n  scheduleOnce('actions', myContext, log);\n}\n\nscheduleIt();\nscheduleIt();
\n
\n
\n \n

But this other case will schedule the function multiple times:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { 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
\n \n

Available queues, and their order, can be found at queues

\n", + "itemtype": "method", + "name": "scheduleOnce", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'.", + "type": "String", + "optional": true + }, + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 472, + "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\nlater with a wait time of 1ms.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { 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
\n \n

Multiple 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

Note 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

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

One 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

The 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.

\n", + "itemtype": "method", + "name": "next", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 547, + "description": "

Cancels a scheduled item. Must be a value returned by later(),\nonce(), scheduleOnce(), next(), debounce(), or\nthrottle().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n
import {\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
\n
\n \n", + "itemtype": "method", + "name": "cancel", + "static": 1, + "params": [ + { + "name": "timer", + "description": "Timer object to cancel", + "type": "Object" + } + ], + "return": { + "description": "true if canceled or false/undefined if it wasn't found", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 618, + "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

This 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n \n

Immediate allows you to run the function immediately, but debounce\nother calls for this function until the wait time has elapsed. If\ndebounce 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "debounce", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to false.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 696, + "description": "

Ensure that the target method is never called more frequently than\nthe specified spacing period. The target method is called immediately.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "throttle", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "spacing", + "description": "Number of milliseconds to space out requests.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to true.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/runloop/index.js", + "line": 31, + "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.

\n", + "itemtype": "property", + "name": "queues", + "type": "Array", + "default": "['actions', 'destroy']", + "access": "private", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/polyfills" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/runloop", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/service-21971029b1.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/service-21971029b1.json new file mode 100644 index 000000000..4488fa1cd --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/service-21971029b1.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.0.1-@ember/service", + "type": "class", + "attributes": { + "name": "@ember/service", + "shortname": "@ember/service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/service/index.js", + "line": 9, + "description": "

Creates a property that lazily looks up a service in the container. There are\nno restrictions as to what objects a service can be injected into.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service('auth') authManager;\n\n  model() {\n    return this.authManager.findCurrentUser();\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nexport default Route.extend({\n  authManager: service('auth'),\n\n  model() {\n    return this.get('authManager').findCurrentUser();\n  }\n});
\n
\n
\n \n

This example will create an authManager property on the application route\nthat looks up the auth service in the container, making it easily accessible\nin the model hook.

\n", + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/test-ac9ed7a884.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/test-ac9ed7a884.json new file mode 100644 index 000000000..e8c3a037d --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/test-ac9ed7a884.json @@ -0,0 +1,395 @@ +{ + "data": { + "id": "ember-4.0.1-@ember/test", + "type": "class", + "attributes": { + "name": "@ember/test", + "shortname": "@ember/test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/test", + "namespace": "", + "methods": [ + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 51, + "description": "

This hook defers the readiness of the application, so that you can start\nthe app when your tests are ready to run. It also sets the router's\nlocation to 'none', so that the window's location will not be modified\n(preventing both accidental leaking of state between tests and interference\nwith your testing framework). setupForTesting should only be called after\nsetting a custom router class (for example App.Router = Router.extend().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.setupForTesting();
\n
\n
\n \n", + "itemtype": "method", + "name": "setupForTesting", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 90, + "description": "

This injects the test helpers into the helperContainer object. If an object is provided\nit will be used as the helperContainer. If helperContainer is not set it will default\nto window. If a function of the same name has already been defined it will be cached\n(so that it can be reset if the helper is removed with unregisterHelper or\nremoveTestHelpers).

\n

Any callbacks registered with onInjectHelpers will be called once the\nhelpers have been injected.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.injectTestHelpers();
\n
\n
\n \n", + "itemtype": "method", + "name": "injectTestHelpers", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 132, + "description": "

This removes all helpers that have been registered, and resets and functions\nthat were overridden by the helpers.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.removeTestHelpers();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "removeTestHelpers", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/helpers/current_path.js", + "line": 6, + "description": "

Returns the current path.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentPath(), 'some.path.index', "correct path was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentPath", + "return": { + "description": "The currently active path.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_route_name.js", + "line": 5, + "description": "

Returns the currently active route name.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
function validateRouteName() {\nequal(currentRouteName(), 'some.path', "correct route was transitioned into.");\n}\nvisit('/some/path').then(validateRouteName)
\n
\n
\n \n", + "itemtype": "method", + "name": "currentRouteName", + "return": { + "description": "The name of the currently active route.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_url.js", + "line": 6, + "description": "

Returns the current URL.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentURL(), '/some/path', "correct URL was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentURL", + "return": { + "description": "The currently active URL.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.js", + "line": 9, + "description": "

Resumes a test paused by pauseTest.

\n", + "itemtype": "method", + "name": "resumeTest", + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.js", + "line": 22, + "description": "

Pauses the current test - this is useful for debugging while testing or for test-driving.\nIt allows you to inspect the state of your application at any point.\nExample (The test will pause before clicking the button):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('/')\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

You may want to turn off the timeout before pausing.

\n

qunit (timeout available to use as of 2.4.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nassert.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

mocha (timeout happens automatically as of ember-mocha v0.14.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nthis.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n", + "since": "1.9.0", + "itemtype": "method", + "name": "pauseTest", + "return": { + "description": "A promise that will never resolve", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/visit.js", + "line": 3, + "description": "

Loads a route, sets up any controllers, and renders any templates associated\nwith the route as though a real user had triggered the route change while\nusing your app.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('posts/index').then(function() {\n  // assert something\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/wait.js", + "line": 9, + "description": "

Causes the run loop to process any pending events. This is used to ensure that\nany async operations from other helpers (or your assertions) have been processed.

\n

This is most often used as the return value for the helper functions (see 'click',\n'fillIn','visit',etc). However, there is a method to register a test helper which\nutilizes this method without the need to actually call wait() in your helpers.

\n

The wait helper is built into registerAsyncHelper by default. You will not need\nto return app.testHelpers.wait(); - the wait behavior is provided for you.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('loginUser', function(app, username, password) {\n  visit('secured/path/here')\n    .fillIn('#username', username)\n    .fillIn('#password', password)\n    .click('.submit');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "wait", + "params": [ + { + "name": "value", + "description": "The value to be returned.", + "type": "Object" + } + ], + "return": { + "description": "Promise that resolves to the passed value.", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/test/helpers.js", + "line": 8, + "description": "

registerHelper is used to register a test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

This helper can later be called without arguments because it will be\ncalled with app as the first parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nApp = Application.create();\nApp.injectTestHelpers();\nboot();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.js", + "line": 52, + "description": "

registerAsyncHelper is used to register an async test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerAsyncHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterAsyncHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

The advantage of an async helper is that it will not run\nuntil the last async helper has completed. All async helpers\nafter it will wait for it complete before running.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('deletePost', function(app, postId) {\n  click('.delete-' + postId);\n});\n\n// ... in your test\nvisit('/post/2');\ndeletePost(2);\nvisit('/post/3');\ndeletePost(3);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerAsyncHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.js", + "line": 105, + "description": "

Remove a previously added helper method.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { unregisterHelper } from '@ember/test';\n\nunregisterHelper('wait');
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregisterHelper", + "static": 1, + "params": [ + { + "name": "name", + "description": "The helper to remove.", + "type": "String" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.js", + "line": 7, + "description": "

This allows ember-testing to play nicely with other asynchronous\nevents, such as an application that is waiting for a CSS3\ntransition or an IndexDB transaction. The waiter runs periodically\nafter each async helper (i.e. click, andThen, visit, etc) has executed,\nuntil the returning result is truthy. After the waiters finish, the next async helper\nis executed and the process repeats.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(function() {\n  return myPendingTransactions() === 0;\n});
\n
\n
\n \n

The context argument allows you to optionally specify the this\nwith which your callback will be invoked.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(MyDB, MyDB.hasPendingTransactions);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.js", + "line": 55, + "description": "

unregisterWaiter is used to unregister a callback that was\nregistered with registerWaiter.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "unregisterWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.js", + "line": 83, + "description": "

Iterates through each registered test waiter, and invokes\nits callback. If any waiter returns false, this method will return\ntrue indicating that the waiters have not settled yet.

\n

This is generally used internally from the acceptance/integration test\ninfrastructure.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "checkWaiters", + "class": "@ember/test", + "module": "@ember/test" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 10, + "description": "

This property contains the testing helpers for the current application. These\nare created once you call injectTestHelpers on your Application\ninstance. The included helpers are also available on the window object by\ndefault, but can be used from this object on the individual application also.

\n", + "itemtype": "property", + "name": "testHelpers", + "type": "{Object}", + "default": "{}", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 23, + "description": "

This property will contain the original methods that were registered\non the helperContainer before injectTestHelpers is called.

\n

When removeTestHelpers is called, these methods are restored to the\nhelperContainer.

\n", + "itemtype": "property", + "name": "originalMethods", + "type": "{Object}", + "default": "{}", + "access": "private", + "tagname": "", + "since": "1.3.0", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 38, + "description": "

This property indicates whether or not this application is currently in\ntesting mode. This is set when setupForTesting is called on the current\napplication.

\n", + "itemtype": "property", + "name": "testing", + "type": "{Boolean}", + "default": "false", + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 78, + "description": "

This will be used as the container to inject the test helpers into. By\ndefault the helpers are injected into window.

\n", + "itemtype": "property", + "name": "helperContainer", + "type": "{Object} The object to be used for test helpers.", + "default": "window", + "since": "1.2.0", + "access": "private", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/test", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/utils-c206d527c3.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/utils-c206d527c3.json new file mode 100644 index 000000000..32b3601a7 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@ember/utils-c206d527c3.json @@ -0,0 +1,214 @@ +{ + "data": { + "id": "ember-4.0.1-@ember/utils", + "type": "class", + "attributes": { + "name": "@ember/utils", + "shortname": "@ember/utils", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/utils", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/is_blank.ts", + "line": 5, + "description": "

A value is blank if it is empty or a whitespace string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import { isBlank } from '@ember/utils';\n\nisBlank();                // true\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
\n
\n \n", + "itemtype": "method", + "name": "isBlank", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_empty.ts", + "line": 5, + "description": "

Verifies that a value is null or undefined, an empty string, or an empty\narray.

\n

Constrains the rules on isNone by returning true for empty strings and\nempty arrays.

\n

If the value is an object with a size property of type number, it is used\nto check emptiness.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
isEmpty();                 // true\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
\n
\n \n", + "itemtype": "method", + "name": "isEmpty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_none.ts", + "line": 4, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
isNone();              // true\nisNone(null);          // true\nisNone(undefined);     // true\nisNone('');            // false\nisNone([]);            // false\nisNone(function() {}); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isNone", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_present.ts", + "line": 5, + "description": "

A value is present if it not isBlank.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
isPresent();                // false\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
\n
\n \n", + "itemtype": "method", + "name": "isPresent", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.8.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/compare.js", + "line": 44, + "description": "

Compares two javascript values and returns:

\n\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { compare } from '@ember/utils';\n\ncompare('hello', 'hello');  // 0\ncompare('abc', 'dfg');      // -1\ncompare(2, 1);              // 1
\n
\n
\n \n

If 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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { compare } from '@ember/utils';\n\ncompare('hello', 50);       // 1\ncompare(50, 'hello');       // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "compare", + "static": 1, + "params": [ + { + "name": "v", + "description": "First value to compare", + "type": "Object" + }, + { + "name": "w", + "description": "Second value to compare", + "type": "Object" + } + ], + "return": { + "description": "-1 if v < w, 0 if v = w and 1 if v > w.", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/is-equal.js", + "line": 4, + "description": "

Compares two objects, returning true if they are equal.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { isEqual } from '@ember/utils';\n\nisEqual('hello', 'hello');                   // true\nisEqual(1, 2);                               // false
\n
\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Due 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { isEqual } from '@ember/utils';\n\nisEqual([4, 2], [4, 2]);                     // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEqual", + "static": 1, + "params": [ + { + "name": "a", + "description": "first object to compare", + "type": "Object" + }, + { + "name": "b", + "description": "second object to compare", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/type-of.js", + "line": 24, + "description": "

Returns a consistent type for the passed object.

\n

Use 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\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
\n
\n \n

Examples:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "typeOf", + "params": [ + { + "name": "item", + "description": "the item to check", + "type": "Object" + } + ], + "return": { + "description": "the type", + "type": "String" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/utils", + "module": "@ember/utils" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/utils", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@glimmer/tracking-f54f0f2fd7.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@glimmer/tracking-f54f0f2fd7.json new file mode 100644 index 000000000..8f8090f4c --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@glimmer/tracking-f54f0f2fd7.json @@ -0,0 +1,53 @@ +{ + "data": { + "id": "ember-4.0.1-@glimmer/tracking", + "type": "class", + "attributes": { + "name": "@glimmer/tracking", + "shortname": "@glimmer/tracking", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 14, + "description": "

Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are static, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>Count: {{this.count}}</div>\n<div>Times Ten: {{this.timesTen}}</div>\n<div>\n  <button {{on "click" this.plusOne}}>\n    Plus One\n  </button>\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class CounterComponent extends Component {\n  @tracked count = 0;\n\n  get timesTen() {\n    return this.count * 10;\n  }\n\n  @action\n  plusOne() {\n    this.count += 1;\n  }\n}
\n
\n
\n \n

Both the {{this.count}} and the {{this.timesTen}} properties in the\ntemplate will update whenever the button is clicked. Any tracked properties\nthat are used in any way to calculate a value that is used in the template\nwill cause a rerender when updated - this includes through method calls and\nother means:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nclass Entry {\n  @tracked name;\n  @tracked phoneNumber;\n\n  constructor(name, phoneNumber) {\n    this.name = name;\n    this.phoneNumber = phoneNumber;\n  }\n}\n\nexport default class PhoneBookComponent extends Component {\n  entries = [\n    new Entry('Pizza Palace', 5551234),\n    new Entry('1st Street Cleaners', 5554321),\n    new Entry('Plants R Us', 5552468),\n  ];\n\n  // Any usage of this property will update whenever any of the names in the\n  // entries arrays are updated\n  get names() {\n    return this.entries.map(e => e.name);\n  }\n\n  // Any usage of this property will update whenever any of the numbers in the\n  // entries arrays are updated\n  get numbers() {\n    return this.getFormattedNumbers();\n  }\n\n  getFormattedNumbers() {\n    return this.entries\n      .map(e => e.phoneNumber)\n      .map(number => {\n        let numberString = '' + number;\n\n        return numberString.slice(0, 3) + '-' + numberString.slice(3);\n      });\n  }\n}
\n
\n
\n \n

It's important to note that setting tracked properties will always trigger an\nupdate, even if the property is set to the same value as it was before.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let entry = new Entry('Pizza Palace', 5551234);\n\n// if entry was used when rendering, this would cause a rerender, even though\n// the name is being set to the same value as it was before\nentry.name = entry.name;
\n
\n
\n \n

tracked can also be used with the classic Ember object model in a similar\nmanner to classic computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked(),\n  phoneNumber: tracked()\n});
\n
\n
\n \n

Often this is unnecessary, but to ensure robust auto-tracking behavior it is\nadvisable to mark tracked state appropriately wherever possible.

\n

This form of tracked also accepts an optional configuration object\ncontaining either an initial value or an initializer function (but not\nboth).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked({ value: 'Zoey' }),\n  favoriteSongs: tracked({\n    initializer: () => ['Raspberry Beret', 'Time After Time']\n  })\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "tracked", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@glimmer/tracking", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-@glimmer/tracking/primitives/cache-c7e98bd7b1.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-@glimmer/tracking/primitives/cache-c7e98bd7b1.json new file mode 100644 index 000000000..5ead93f70 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-@glimmer/tracking/primitives/cache-c7e98bd7b1.json @@ -0,0 +1,77 @@ +{ + "data": { + "id": "ember-4.0.1-@glimmer/tracking/primitives/cache", + "type": "class", + "attributes": { + "name": "@glimmer/tracking/primitives/cache", + "shortname": "@glimmer/tracking/primitives/cache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking/primitives/cache", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 14, + "description": "

Receives a function, and returns a wrapped version of it that memoizes based on\nautotracking. The function will only rerun whenever any tracked values used\nwithin it have changed. Otherwise, it will return the previous value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state. Now, `counter` will\n  // only rerun if `state.value` changes.\n  state.value;\n\n  return ++computeCount;\n});\n\ngetValue(counter); // 1\n\n// returns the same value because no tracked state has changed\ngetValue(counter); // 1\n\nstate.value = 'foo';\n\n// reruns because a tracked value used in the function has changed,\n// incermenting the counter\ngetValue(counter); // 2
\n
\n
\n \n", + "itemtype": "method", + "name": "createCache", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 56, + "description": "

Gets the value of a cache created with createCache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  return ++computeCount;\n});\n\ngetValue(counter); // 1
\n
\n
\n \n", + "itemtype": "method", + "name": "getValue", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 78, + "description": "

Can be used to check if a memoized function is constant. If no tracked state\nwas used while running a memoized function, it will never rerun, because nothing\ncan invalidate its result. isConst can be used to determine if a memoized\nfunction is constant or not, in order to optimize code surrounding that\nfunction.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue, isConst } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state\n  state.value;\n\n  return computeCount++;\n});\n\nlet constCounter = createCache(() => {\n  return computeCount++;\n});\n\ngetValue(counter);\ngetValue(constCounter);\n\nisConst(counter); // false\nisConst(constCounter); // true
\n
\n
\n \n

If called on a cache that hasn't been accessed yet, it will throw an\nerror. This is because there's no way to know if the function will be constant\nor not yet, and so this helps prevent missing an optimization opportunity on\naccident.

\n", + "itemtype": "method", + "name": "isConst", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@glimmer/tracking/primitives/cache", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Application-730ad5a79e.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Application-730ad5a79e.json new file mode 100644 index 000000000..c25a48f89 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Application-730ad5a79e.json @@ -0,0 +1,1287 @@ +{ + "data": { + "id": "ember-4.0.1-Application", + "type": "class", + "attributes": { + "name": "Application", + "shortname": "Application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/lib/application.js", + "line": 30, + "description": "

An instance of Application is the starting point for every Ember\napplication. It instantiates, initializes and coordinates the\nobjects that make up your app.

\n

Each Ember app has one and only one Application object. Although\nEmber CLI creates this object implicitly, the Application class\nis defined in the app/app.js. You can define a ready method on the\nApplication class, which will be run by Ember when the application is\ninitialized.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
const App = Application.extend({\n  ready() {\n    // your code here\n  }\n})
\n
\n
\n \n

Because Application ultimately inherits from Ember.Namespace, any classes\nyou create will have useful string representations when calling toString().\nSee the Ember.Namespace documentation for more information.

\n

While you can think of your Application as a container that holds the\nother classes in your application, there are several other responsibilities\ngoing on under-the-hood that you may want to understand. It is also important\nto understand that an Application is different from an ApplicationInstance.\nRefer to the Guides to understand the difference between these.

\n

Event Delegation

\n

Ember uses a technique called event delegation. This allows the framework\nto set up a global, shared event listener instead of requiring each view to\ndo it manually. For example, instead of each view registering its own\nmousedown listener on its associated element, Ember sets up a mousedown\nlistener on the body.

\n

If a mousedown event occurs, Ember will look at the target of the event and\nstart walking up the DOM node tree, finding corresponding views and invoking\ntheir mouseDown method as it goes.

\n

Application has a number of default events that it listens for, as\nwell as a mapping from lowercase events to camel-cased view method names. For\nexample, the keypress event causes the keyPress method on the view to be\ncalled, the dblclick event causes doubleClick to be called, and so on.

\n

If there is a bubbling browser event that Ember does not listen for by\ndefault, you can specify custom events and their corresponding view method\nnames by setting the application's customEvents property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // add support for the paste event\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent Ember from setting up a listener for a default event,\nspecify the event name with a null value in the customEvents\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // prevent listeners for mouseenter/mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n

By default, the application sets up these event listeners on the document\nbody. However, in cases where you are embedding an Ember application inside\nan existing page, you may want it to set up the listeners on an element\ninside the body.

\n

For example, if only events inside a DOM element with the ID of ember-app\nshould be delegated, set your application's rootElement property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  rootElement: '#ember-app'\n});
\n
\n
\n \n

The rootElement can be either a DOM element or a CSS selector\nstring. Note that views appended to the DOM outside the root element will\nnot receive events. If you specify a custom root element, make sure you only\nappend views inside it!

\n

To learn more about the events Ember components use, see

\n

components/handling-events.

\n

Initializers

\n

To add behavior to the Application's boot process, you can define initializers in\nthe app/initializers directory, or with ember generate initializer using Ember CLI.\nThese files should export a named initialize function which will receive the created application\nobject as its first argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
export function initialize(application) {\n  // application.inject('route', 'foo', 'service:foo');\n}
\n
\n
\n \n

Application initializers can be used for a variety of reasons including:

\n\n

Routing

\n

In addition to creating your application's router, Application is\nalso responsible for telling the router when to start routing. Transitions\nbetween routes can be logged with the LOG_TRANSITIONS flag, and more\ndetailed intra-transition logging can be logged with\nthe LOG_TRANSITIONS_INTERNAL flag:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  LOG_TRANSITIONS: true, // basic logging of successful transitions\n  LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n});
\n
\n
\n \n

By default, the router will begin trying to translate the current URL into\napplication state once the browser emits the DOMContentReady event. If you\nneed to defer routing, you can call the application's deferReadiness()\nmethod. Once routing can begin, call the advanceReadiness() method.

\n

If there is any setup required before routing begins, you can implement a\nready() method on your app that will be invoked immediately before routing\nbegins.

\n", + "extends": "Engine", + "uses": [ + "RegistryProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/application/lib/application.js", + "line": 377, + "description": "

Create an ApplicationInstance for this application.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the application instance", + "type": "ApplicationInstance" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 400, + "description": "

Start tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is created.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_watchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 411, + "description": "

Stop tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is about to be destroyed.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_unwatchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 422, + "description": "

Enable the legacy globals mode by allowing this application to act\nas a global namespace. See the docs on the _globalsMode property\nfor details.

\n

Most of these features are already deprecated in 1.x, so we can\nstop using them internally and try to remove them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareForGlobalsMode", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 466, + "description": "

Automatically kick-off the boot process for the application once the\nDOM has become ready.

\n

The initialization itself is scheduled on the actions queue which\nensures that code-loading finishes before booting.

\n

If you are asynchronously loading code, you should call deferReadiness()\nto defer booting, and then call advanceReadiness() once all of your code\nhas finished loading.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "waitForDOMReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 493, + "description": "

This is the autoboot flow:

\n
    \n
  1. Boot the app by calling this.boot()
  2. \n
  3. Create an instance (or use the __deprecatedInstance__ in globals mode)
  4. \n
  5. Boot the instance by calling instance.boot()
  6. \n
  7. Invoke the App.ready() callback
  8. \n
  9. Kick-off routing on the instance
  10. \n
\n

Ideally, this is all we would need to do:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
_autoBoot() {\n  this.boot().then(() => {\n    let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance();\n    return instance.boot();\n  }).then((instance) => {\n    App.ready();\n    instance.startRouting();\n  });\n}
\n
\n
\n \n

Unfortunately, we cannot actually write this because we need to participate\nin the "synchronous" boot process. While the code above would work fine on\nthe initial boot (i.e. DOM ready), when App.reset() is called, we need to\nboot a new instance synchronously (see the documentation on _bootSync()\nfor details).

\n

Because of this restriction, the actual logic of this method is located\ninside didBecomeReady().

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "domReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 538, + "description": "

Use this to defer readiness until some condition is true.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Application from '@ember/application';\n\nlet App = Application.create();\n\nApp.deferReadiness();\n\nfetch('/auth-token')\n.then(response => response.json())\n.then(data => {\n  App.token = data.token;\n  App.advanceReadiness();\n});
\n
\n
\n \n

This allows you to perform asynchronous setup logic and defer\nbooting your application until the setup has finished.

\n

However, if the setup requires a loading UI, it might be better\nto use the router for this purpose.

\n", + "itemtype": "method", + "name": "deferReadiness", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 588, + "description": "

Call advanceReadiness after any asynchronous setup logic has completed.\nEach call to deferReadiness must be matched by a call to advanceReadiness\nor the application will never become ready and routing will not begin.

\n", + "itemtype": "method", + "name": "advanceReadiness", + "see": [ + "{Application#deferReadiness}" + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 625, + "description": "

Initialize the application and return a promise that resolves with the Application\nobject when the boot process is complete.

\n

Run any application initializers and run the application load hook. These hooks may\nchoose to defer readiness. For example, an authentication hook might want to defer\nreadiness until the auth token has been retrieved.

\n

By default, this method is called automatically on "DOM ready"; however, if autoboot\nis disabled, this is automatically called when the first application instance is\ncreated via visit.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 702, + "description": "

Reset the application. This is typically used only in tests. It cleans up\nthe application in the following order:

\n
    \n
  1. Deactivate existing routes
  2. \n
  3. Destroy all objects in the container
  4. \n
  5. Create a new application container
  6. \n
  7. Re-route to the existing url
  8. \n
\n

Typical Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    App.reset();\n  }\n});\n\ntest('first test', function() {\n  // App is freshly reset\n});\n\ntest('second test', function() {\n  // App is again freshly reset\n});
\n
\n
\n \n

Advanced Example:

\n

Occasionally you may want to prevent the app from initializing during\nsetup. This could enable extra configuration, or enable asserting prior\nto the app becoming ready.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    run(function() {\n      App.reset();\n      App.deferReadiness();\n    });\n  }\n});\n\ntest('first test', function() {\n  ok(true, 'something before app is initialized');\n\n  run(function() {\n    App.advanceReadiness();\n  });\n\n  ok(true, 'something after app is initialized');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reset", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 805, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "didBecomeReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 880, + "description": "

Boot a new instance of ApplicationInstance for the current\napplication and navigate it to the given url. Returns a Promise that\nresolves with the instance when the initial routing and rendering is\ncomplete, or rejects with any error that occurred during the boot process.

\n

When autoboot is disabled, calling visit would first cause the\napplication to boot, which runs the application initializers.

\n

This method also takes a hash of boot-time configuration options for\ncustomizing the instance's behavior. See the documentation on\nApplicationInstance.BootOptions for details.

\n

ApplicationInstance.BootOptions is an interface class that exists\npurely to document the available options; you do not need to construct it\nmanually. Simply pass a regular JavaScript object containing of the\ndesired options:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Supported Scenarios

\n

While the BootOptions class exposes a large number of knobs, not all\ncombinations of them are valid; certain incompatible combinations might\nresult in unexpected behavior.

\n

For example, booting the instance in the full browser environment\nwhile specifying a foreign document object (e.g. { isBrowser: true, document: iframe.contentDocument }) does not work correctly today,\nlargely due to Ember's jQuery dependency.

\n

Currently, there are three officially supported scenarios/configurations.\nUsages outside of these scenarios are not guaranteed to work, but please\nfeel free to file bug reports documenting your experience and any issues\nyou encountered to help expand support.

\n

Browser Applications (Manual Boot)

\n

The setup is largely similar to how Ember works out-of-the-box. Normally,\nEmber will boot a default instance for your Application on "DOM ready".\nHowever, you can customize this behavior by disabling autoboot.

\n

For example, this allows you to render a miniture demo of your application\ninto a specific area on your marketing website:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let options = {\n    // Override the router's location adapter to prevent it from updating\n    // the URL in the address bar\n    location: 'none',\n\n    // Override the default `rootElement` on the app to render into a\n    // specific `div` on the page\n    rootElement: '#demo'\n  };\n\n  // Start the app at the special demo URL\n  App.visit('/demo', options);\n});
\n
\n
\n \n

Or perhaps you might want to boot two instances of your app on the same\npage for a split-screen multiplayer experience:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let sessionId = MyApp.generateSessionID();\n\n  let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' });\n  let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' });\n\n  Promise.all([player1, player2]).then(() => {\n    // Both apps have completed the initial render\n    $('#loading').fadeOut();\n  });\n});
\n
\n
\n \n

Do note that each app instance maintains their own registry/container, so\nthey will run in complete isolation by default.

\n

Server-Side Rendering (also known as FastBoot)

\n

This setup allows you to run your Ember app in a server environment using\nNode.js and render its content into static HTML for SEO purposes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap);\n\nfunction renderURL(url) {\n  let dom = new SimpleDOM.Document();\n  let rootElement = dom.body;\n  let options = { isBrowser: false, document: dom, rootElement: rootElement };\n\n  return MyApp.visit(options).then(instance => {\n    try {\n      return HTMLSerializer.serialize(rootElement.firstChild);\n    } finally {\n      instance.destroy();\n    }\n  });\n}
\n
\n
\n \n

In this scenario, because Ember does not have access to a global document\nobject in the Node.js environment, you must provide one explicitly. In practice,\nin the non-browser environment, the stand-in document object only needs to\nimplement a limited subset of the full DOM API. The SimpleDOM library is known\nto work.

\n

Since there is no DOM access in the non-browser environment, you must also\nspecify a DOM Element object in the same document for the rootElement option\n(as opposed to a selector string like "body").

\n

See the documentation on the isBrowser, document and rootElement properties\non ApplicationInstance.BootOptions for details.

\n

Server-Side Resource Discovery

\n

This setup allows you to run the routing layer of your Ember app in a server\nenvironment using Node.js and completely disable rendering. This allows you\nto simulate and discover the resources (i.e. AJAX requests) needed to fulfill\na given request and eagerly "push" these resources to the client.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
service.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import BrowserNetworkService from 'app/services/network/browser';\nimport NodeNetworkService from 'app/services/network/node';\n\n// Inject a (hypothetical) service for abstracting all AJAX calls and use\n// the appropriate implementation on the client/server. This also allows the\n// server to log all the AJAX calls made during a particular request and use\n// that for resource-discovery purpose.\n\nexport function initialize(application) {\n  if (window) { // browser\n    application.register('service:network', BrowserNetworkService);\n  } else { // node\n    application.register('service:network', NodeNetworkService);\n  }\n};\n\nexport default {\n  name: 'network-service',\n  initialize: initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\n// An example of how the (hypothetical) service is used in routes.\n\nexport default class IndexRoute extends Route {\n  @service network;\n\n  model(params) {\n    return this.network.fetch(`/api/posts/${params.post_id}.json`);\n  }\n\n  afterModel(post) {\n    if (post.isExternalContent) {\n      return this.network.fetch(`/api/external/?url=${post.externalURL}`);\n    } else {\n      return post;\n    }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
// Finally, put all the pieces together\n\nfunction discoverResourcesFor(url) {\n  return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => {\n    let networkService = instance.lookup('service:network');\n    return networkService.requests; // => { "/api/posts/123.json": "..." }\n  });\n}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "The initial URL to navigate to", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "ApplicationInstance.BootOptions" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 1101, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 61, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 74, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 87, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 100, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 108, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 116, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 127, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 158, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 305, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 378, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 427, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Namespace" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 18, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 31, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 101, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 124, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 134, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 145, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 155, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 165, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 198, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 208, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/application/lib/application.js", + "line": 855, + "description": "

Called when the Application has become ready, immediately before routing\nbegins. The call will be delayed until the DOM has become ready.

\n", + "itemtype": "event", + "name": "ready", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + } + ], + "properties": [ + { + "file": "packages/@ember/application/lib/application.js", + "line": 185, + "description": "

The root DOM element of the Application. This can be specified as an\nelement or a selector string.

\n

This is the element that will be passed to the Application's,\neventDispatcher, which sets up the listeners for event delegation. Every\nview in your application should be a child of the element you specify here.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 200, + "itemtype": "property", + "name": "_document", + "type": "Document | null", + "default": "'window.document'", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 209, + "description": "

The Ember.EventDispatcher responsible for delegating events to this\napplication's views.

\n

The event dispatcher is created by the application at initialization time\nand sets up event listeners on the DOM element described by the\napplication's rootElement property.

\n

See the documentation for Ember.EventDispatcher for more information.

\n", + "itemtype": "property", + "name": "eventDispatcher", + "type": "Ember.EventDispatcher", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 226, + "description": "

The DOM events for which the event dispatcher should listen.

\n

By default, the application's Ember.EventDispatcher listens\nfor a set of standard DOM events, such as mousedown and\nkeyup, and delegates them to your application's Ember.View\ninstances.

\n

If you would like additional bubbling events to be delegated to your\nviews, set your Application's customEvents property\nto a hash containing the DOM event name as the key and the\ncorresponding view method name as the value. Setting an event to\na value of null will prevent a default event listener from being\nadded for that event.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // add support for the paste event\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // remove support for mouseenter / mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "customEvents", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 274, + "description": "

Whether the application should automatically start routing and render\ntemplates to the rootElement on DOM ready. While default by true,\nother environments such as FastBoot or a testing harness can set this\nproperty to false and control the precise timing and behavior of the boot\nprocess.

\n", + "itemtype": "property", + "name": "autoboot", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 288, + "description": "

Whether the application should be configured for the legacy "globals mode".\nUnder this mode, the Application object serves as a global namespace for all\nclasses.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Application from '@ember/application';\nimport Component from '@ember/component';\n\nlet App = Application.create({\n  ...\n});\n\nApp.Router.reopen({\n  location: 'none'\n});\n\nApp.Router.map({\n  ...\n});\n\nApp.MyComponent = Component.extend({\n  ...\n});
\n
\n
\n \n

This flag also exposes other internal APIs that assumes the existence of\na special "default instance", like App.__container__.lookup(...).

\n

This option is currently not configurable, its value is derived from\nthe autoboot flag – disabling autoboot also implies opting-out of\nglobals mode support, although they are ultimately orthogonal concerns.

\n

Some of the global modes features are already deprecated in 1.x. The\nexistence of this flag is to untangle the globals mode code paths from\nthe autoboot code paths, so that these legacy features can be reviewed\nfor deprecation/removal separately.

\n

Forcing the (autoboot=true, _globalsMode=false) here and running the tests\nwould reveal all the places where we are still relying on these legacy\nbehavior internally (mostly just tests).

\n", + "itemtype": "property", + "name": "_globalsMode", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 337, + "description": "

An array of application instances created by buildInstance(). Used\ninternally to ensure that all instances get destroyed.

\n", + "itemtype": "property", + "name": "_applicationInstances", + "type": "Array", + "default": "null", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 53, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 418, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-Engine", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-ApplicationInstance-3c04e49848.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-ApplicationInstance-3c04e49848.json new file mode 100644 index 000000000..39505486a --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-ApplicationInstance-3c04e49848.json @@ -0,0 +1,1063 @@ +{ + "data": { + "id": "ember-4.0.1-ApplicationInstance", + "type": "class", + "attributes": { + "name": "ApplicationInstance", + "shortname": "ApplicationInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/instance.js", + "line": 10, + "description": "

The ApplicationInstance encapsulates all of the stateful aspects of a\nrunning Application.

\n

At a high-level, we break application boot into two distinct phases:

\n
    \n
  • Definition time, where all of the classes, templates, and other\ndependencies are loaded (typically in the browser).
  • \n
  • Run time, where we begin executing the application once everything\nhas loaded.
  • \n
\n

Definition time can be expensive and only needs to happen once since it is\nan idempotent operation. For example, between test runs and FastBoot\nrequests, the application stays the same. It is only the state that we want\nto reset.

\n

That state is what the ApplicationInstance manages: it is responsible for\ncreating the container that contains all application state, and disposing of\nit once the particular test run or FastBoot request has finished.

\n", + "access": "public", + "tagname": "", + "extends": "EngineInstance", + "methods": [ + { + "file": "packages/@ember/application/instance.js", + "line": 283, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 62, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 124, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 139, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 167, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 200, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 23, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 49, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 110, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 18, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 31, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 101, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 124, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 134, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 145, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 155, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 165, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 198, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 208, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.js", + "line": 36, + "description": "

The Application for which this is an instance.

\n", + "itemtype": "property", + "name": "application", + "type": "Application", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 44, + "description": "

The DOM events for which the event dispatcher should listen.

\n

By default, the application's Ember.EventDispatcher listens\nfor a set of standard DOM events, such as mousedown and\nkeyup, and delegates them to your application's Ember.View\ninstances.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "customEvents", + "type": "Object", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 57, + "description": "

The root DOM element of the Application as an element or a\nCSS selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "String|DOMElement", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 29, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 15, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-EngineInstance", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-ApplicationInstance.BootOptions-b48fa76c23.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-ApplicationInstance.BootOptions-b48fa76c23.json new file mode 100644 index 000000000..4b4b7772e --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-ApplicationInstance.BootOptions-b48fa76c23.json @@ -0,0 +1,143 @@ +{ + "data": { + "id": "ember-4.0.1-ApplicationInstance.BootOptions", + "type": "class", + "attributes": { + "name": "ApplicationInstance.BootOptions", + "shortname": "ApplicationInstance.BootOptions", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "ApplicationInstance", + "file": "packages/@ember/application/instance.js", + "line": 305, + "description": "

A list of boot-time configuration options for customizing the behavior of\nan ApplicationInstance.

\n

This is an interface class that exists purely to document the available\noptions; you do not need to construct it manually. Simply pass a regular\nJavaScript object containing the desired options into methods that require\none of these options object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Not all combinations of the supported options are valid. See the documentation\non Application#visit for the supported configurations.

\n

Internal, experimental or otherwise unstable flags are marked as private.

\n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.js", + "line": 329, + "description": "

Interactive mode: whether we need to set up event delegation and invoke\nlifecycle callbacks on Components.

\n", + "itemtype": "property", + "name": "isInteractive", + "type": "boolean", + "default": "auto-detected", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 340, + "itemtype": "property", + "name": "_renderMode", + "type": "string", + "default": "false", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 348, + "description": "

Run in a full browser environment.

\n

When this flag is set to false, it will disable most browser-specific\nand interactive features. Specifically:

\n
    \n
  • It does not use jQuery to append the root view; the rootElement\n(either specified as a subsequent option or on the application itself)\nmust already be an Element in the given document (as opposed to a\nstring selector).

    \n
  • \n
  • It does not set up an EventDispatcher.

    \n
  • \n
  • It does not run any Component lifecycle hooks (such as didInsertElement).

    \n
  • \n
  • It sets the location option to "none". (If you would like to use\nthe location adapter specified in the app's router instead, you can also\nspecify { location: null } to specifically opt-out.)

    \n
  • \n
\n", + "itemtype": "property", + "name": "isBrowser", + "type": "boolean", + "default": "auto-detected", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 383, + "description": "

Disable rendering completely.

\n

When this flag is set to false, it will disable the entire rendering\npipeline. Essentially, this puts the app into "routing-only" mode. No\ntemplates will be rendered, and no Components will be created.

\n", + "itemtype": "property", + "name": "shouldRender", + "type": "boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 405, + "description": "

If present, render into the given Document object instead of the\nglobal window.document object.

\n

In practice, this is only useful in non-browser environment or in\nnon-interactive mode, because Ember's jQuery dependency is\nimplicitly bound to the current document, causing event delegation\nto not work properly when the app is rendered into a foreign\ndocument object (such as an iframe's contentDocument).

\n

In non-browser mode, this could be a "Document-like" object as\nEmber only interact with a small subset of the DOM API in non-\ninteractive mode. While the exact requirements have not yet been\nformalized, the SimpleDOM library's implementation is known to\nwork.

\n", + "itemtype": "property", + "name": "document", + "type": "Document", + "default": "the global `document` object", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 432, + "description": "

If present, overrides the application's rootElement property on\nthe instance. This is useful for testing environment, where you\nmight want to append the root view to a fixture area.

\n

In non-browser mode, because Ember does not have access to jQuery,\nthis options must be specified as a DOM Element object instead of\na selector string.

\n

See the documentation on Application's rootElement for\ndetails.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "String|Element", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 457, + "description": "

If present, overrides the router's location property with this\nvalue. This is useful for environments where trying to modify the\nURL would be inappropriate.

\n", + "itemtype": "property", + "name": "location", + "type": "string", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-ArrayProxy-776e95183f.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-ArrayProxy-776e95183f.json new file mode 100644 index 000000000..096751c2b --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-ArrayProxy-776e95183f.json @@ -0,0 +1,1833 @@ +{ + "data": { + "id": "ember-4.0.1-ArrayProxy", + "type": "class", + "attributes": { + "name": "ArrayProxy", + "shortname": "ArrayProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.js", + "line": 43, + "description": "

An ArrayProxy wraps any other object that implements Array and/or\nMutableArray, forwarding all requests. This makes it very useful for\na number of binding use cases or other cases where being able to swap\nout the underlying array is useful.

\n

A simple example of usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({ content: A(pets) });\n\nap.get('firstObject');                        // 'dog'\nap.set('content', ['amoeba', 'paramecium']);\nap.get('firstObject');                        // 'amoeba'
\n
\n
\n \n

This class can also be useful as a layer to transform the contents of\nan array, as they are accessed. This can be done by overriding\nobjectAtContent:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({\n    content: A(pets),\n    objectAtContent: function(idx) {\n        return this.get('content').objectAt(idx).toUpperCase();\n    }\n});\n\nap.get('firstObject'); // . 'DOG'
\n
\n
\n \n

When overriding this class, it is important to place the call to\n_super after setting content so the internal observers have\na chance to fire properly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nexport default ArrayProxy.extend({\n  init() {\n    this.set('content', A(['dog', 'cat', 'fish']));\n    this._super(...arguments);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.js", + "line": 150, + "description": "

Should actually retrieve the object at the specified index from the\ncontent. You can override this method in subclasses to transform the\ncontent item to something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "objectAtContent", + "params": [ + { + "name": "idx", + "description": "The index to retrieve.", + "type": "Number" + } + ], + "return": { + "description": "the value or undefined if none found", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.js", + "line": 176, + "description": "

Should actually replace the specified objects on the content array.\nYou can override this method in subclasses to transform the content item\ninto something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "replaceContent", + "params": [ + { + "name": "idx", + "description": "The starting index", + "type": "Number" + }, + { + "name": "amt", + "description": "The number of items to remove from the content.", + "type": "Number" + }, + { + "name": "objects", + "description": "Optional array of objects to insert or null if no\n objects.", + "type": "EmberArray" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1348, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray" + } + ], + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1367, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1393, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1415, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1440, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1460, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1480, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1506, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1531, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1551, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumberable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1572, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1591, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1618, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1646, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1663, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1689, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1116, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1154, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1166, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1182, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1215, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1259, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1278, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1300, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.js", + "line": 141, + "description": "

The content array. Must be an object that implements Array and/or\nMutableArray.

\n", + "itemtype": "property", + "name": "content", + "type": "EmberArray", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.js", + "line": 346, + "description": "

The array that the proxy pretends to be. In the default ArrayProxy\nimplementation, this and content are the same. Subclasses of ArrayProxy\ncan override this property to provide things like sorting and filtering.

\n", + "itemtype": "property", + "name": "arrangedContent", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Component-71a890b540.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Component-71a890b540.json new file mode 100644 index 000000000..43926ab4a --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Component-71a890b540.json @@ -0,0 +1,1569 @@ +{ + "data": { + "id": "ember-4.0.1-Component", + "type": "class", + "attributes": { + "name": "Component", + "shortname": "Component", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 37, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault component's for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Classic components. If you are looking for the\nAPI documentation for Template-only or Glimmer components, it is\navailable here.

\n

Defining a Classic Component

\n

If you want to customize the component in order to handle events, transform\narguments or maintain internal state, you implement a subclass of Component.

\n

One example is to add computed properties to your component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  displayName: computed('person.title', 'person.firstName', 'person.lastName', function() {\n    let { title, firstName, lastName } = this.person;\n\n    if (title) {\n      return `${title} ${lastName}`;\n    } else {\n      return `${firstName} ${lastName}`;\n    }\n  })\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

Customizing a Classic Component's HTML Element in JavaScript

\n

HTML Tag

\n

The default HTML tag name used for a component's HTML representation is div.\nThis can be customized by setting the tagName property.

\n

Consider the following component class:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
paragraph.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'em'\n});
\n
\n
\n \n

When invoked, this component would produce output that looks something like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<em id="ember1" class="ember-view"></em>
\n
\n
\n \n

HTML class Attribute

\n

The HTML class attribute of a component's tag can be set by providing a\nclassNames property that is set to an array of strings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class']\n});
\n
\n
\n \n

Invoking this component will produce output that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class"></div>
\n
\n
\n \n

class attribute values can also be set by providing a classNameBindings\nproperty set to an array of properties names for the component. The return\nvalue of these properties will be added as part of the value for the\ncomponents's class attribute. These properties can be computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class'],\n  classNameBindings: ['propertyA', 'propertyB'],\n\n  propertyA: 'from-a',\n  propertyB: computed(function() {\n    if (someLogic) { return 'from-b'; }\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

Note that classNames and classNameBindings is in addition to the class\nattribute passed with the angle bracket invocation syntax. Therefore, if this\ncomponent was invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyWidget class="from-invocation" />
\n
\n
\n \n

The resulting HTML will look similar to this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="from-invocation ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

If the value of a class name binding returns a boolean the property name\nitself will be used as the class name if the property is true. The class name\nwill not be added if the value is false or undefined.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['hovered'],\n\n  hovered: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view hovered"></div>
\n
\n
\n \n

Custom Class Names for Boolean Values

\n

When using boolean class name bindings you can supply a string value other\nthan the property name for use as the class HTML attribute by appending the\npreferred value after a ":" character when defining the binding:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['awesome:so-very-cool'],\n\n  awesome: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view so-very-cool"></div>
\n
\n
\n \n

Boolean value class name bindings whose property names are in a\ncamelCase-style format will be converted to a dasherized format:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isUrgent'],\n\n  isUrgent: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view is-urgent"></div>
\n
\n
\n \n

Class name bindings can also refer to object values that are found by\ntraversing a path relative to the component itself:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport EmberObject from '@ember/object';\n\nexport default Component.extend({\n  classNameBindings: ['messages.empty'],\n\n  messages: EmberObject.create({\n    empty: true\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view empty"></div>
\n
\n
\n \n

If you want to add a class name for a property which evaluates to true and\nand a different class name if it evaluates to false, you can pass a binding\nlike this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isEnabled:enabled:disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view enabled"></div>
\n
\n
\n \n

When isEnabled is false, the resulting HTML representation looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

This syntax offers the convenience to add a class if a property is false:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\n// Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\nexport default Component.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component when the isEnabled property is true will produce\nHTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view"></div>
\n
\n
\n \n

Invoking it when the isEnabled property on the component is false will\nproduce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

Updates to the value of a class name binding will result in automatic update\nof the HTML class attribute in the component's rendered HTML\nrepresentation. If the value becomes false or undefined the class name\nwill be removed.

\n

Both classNames and classNameBindings are concatenated properties. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Other HTML Attributes

\n

The HTML attribute section of a component's tag can be set by providing an\nattributeBindings property set to an array of property names on the component.\nThe return value of these properties will be used as the value of the component's\nHTML associated attribute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['href'],\n\n  href: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

One property can be mapped on to another by placing a ":" between\nthe source property and the destination property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['url:href'],\n\n  url: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

HTML attributes passed with angle bracket invocations will take precedence\nover those specified in attributeBindings. Therefore, if this component was\ninvoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyAnchor href="http://bing.com" @url="http://google.com" />
\n
\n
\n \n

The resulting HTML will looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://bing.com"></a>
\n
\n
\n \n

Note that the href attribute is ultimately set to http://bing.com,\ndespite it having attribute binidng to the url property, which was\nset to http://google.com.

\n

Namespaced attributes (e.g. xlink:href) are supported, but have to be\nmapped, since : is not a valid character for properties in Javascript:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
use.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'use',\n  attributeBindings: ['xlinkHref:xlink:href'],\n\n  xlinkHref: '#triangle'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<use xlink:href="#triangle"></use>
\n
\n
\n \n

If the value of a property monitored by attributeBindings is a boolean, the\nattribute will be present or absent depending on the value:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: false\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id="ember1" class="ember-view" />
\n
\n
\n \n

attributeBindings can refer to computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: computed(function() {\n    if (someLogic) {\n      return true;\n    } else {\n      return false;\n    }\n  })\n});
\n
\n
\n \n

To prevent setting an attribute altogether, use null or undefined as the\nvalue of the property used in attributeBindings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'form',\n  attributeBindings: ['novalidate'],\n  novalidate: null\n});
\n
\n
\n \n

Updates to the property of an attribute binding will result in automatic\nupdate of the HTML attribute in the component's HTML output.

\n

attributeBindings is a concatenated property. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Layouts

\n

The layout property can be used to dynamically specify a template associated\nwith a component class, instead of relying on Ember to link together a\ncomponent class and a template based on file names.

\n

In general, applications should not use this feature, but it's commonly used\nin addons for historical reasons.

\n

The layout property should be set to the default export of a template\nmodule, which is the name of a template file without the .hbs extension.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>Person's Title</h1>\n<div class='details'>{{yield}}</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n
  import Component from '@ember/component';\n  import layout from '../templates/components/person-profile';\n\n  export default Component.extend({\n    layout\n  });
\n
\n
\n \n

If you invoke the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile>\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</PersonProfile>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#person-profile}}\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n{{/person-profile}}
\n
\n
\n \n

It will result in the following HTML output:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<h1>Person's Title</h1>\n  <div class="details">\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</div>
\n
\n
\n \n

Handling Browser Events

\n

Components can respond to user-initiated events in one of three ways: passing\nactions with angle bracket invocation, adding event handler methods to the\ncomponent's class, or adding actions to the component's template.

\n

Passing Actions With Angle Bracket Invocation

\n

For one-off events specific to particular instance of a component, it is possible\nto pass actions to the component's element using angle bracket invocation syntax.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyWidget {{action 'firstWidgetClicked'}} />\n\n<MyWidget {{action 'secondWidgetClicked'}} />
\n
\n
\n \n

In this case, when the first component is clicked on, Ember will invoke the\nfirstWidgetClicked action. When the second component is clicked on, Ember\nwill invoke the secondWidgetClicked action instead.

\n

Besides {{action}}, it is also possible to pass any arbitrary element modifiers\nusing the angle bracket invocation syntax.

\n

Event Handler Methods

\n

Components can also respond to user-initiated events by implementing a method\nthat matches the event name. This approach is appropriate when the same event\nshould be handled by all instances of the same component.

\n

An event object will be passed as the argument to the event handler method.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click(event) {\n    // `event.target` is either the component's element or one of its children\n    let tag = event.target.tagName.toLowerCase();\n    console.log('clicked on a `<${tag}>` HTML element!');\n  }\n});
\n
\n
\n \n

In this example, whenever the user clicked anywhere inside the component, it\nwill log a message to the console.

\n

It is possible to handle event types other than click by implementing the\nfollowing event handler methods. In addition, custom events can be registered\nby using Application.customEvents.

\n

Touch events:

\n
    \n
  • touchStart
  • \n
  • touchMove
  • \n
  • touchEnd
  • \n
  • touchCancel
  • \n
\n

Keyboard events:

\n
    \n
  • keyDown
  • \n
  • keyUp
  • \n
  • keyPress
  • \n
\n

Mouse events:

\n
    \n
  • mouseDown
  • \n
  • mouseUp
  • \n
  • contextMenu
  • \n
  • click
  • \n
  • doubleClick
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
\n

Form events:

\n
    \n
  • submit
  • \n
  • change
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
  • input
  • \n
\n

Drag and drop events:

\n
    \n
  • dragStart
  • \n
  • drag
  • \n
  • dragEnter
  • \n
  • dragLeave
  • \n
  • dragOver
  • \n
  • dragEnd
  • \n
  • drop
  • \n
\n

{{action}} Helper

\n

Instead of handling all events of a particular type anywhere inside the\ncomponent's element, you may instead want to limit it to a particular\nelement in the component's template. In this case, it would be more\nconvenient to implement an action instead.

\n

For example, you could implement the action hello for the person-profile\ncomponent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  actions: {\n    hello(name) {\n      console.log("Hello", name);\n    }\n  }\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
<h1>{{@person.name}}</h1>\n\n<button {{action 'hello' @person.name}}>\n  Say Hello to {{@person.name}}\n</button>
\n
\n
\n \n

When the user clicks the button, Ember will invoke the hello action,\npassing in the current value of @person.name as an argument.

\n

See Ember.Templates.helpers.action.

\n", + "extends": "Ember.CoreView", + "uses": [ + "Ember.ViewStateSupport", + "Ember.ViewMixin", + "Ember.ActionSupport", + "Ember.ClassNamesSupport", + "Ember.TargetActionSupport" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 752, + "description": "

Normally, Ember's component model is "write-only". The component takes a\nbunch of attributes that it got passed in, and uses them to render its\ntemplate.

\n

One nice thing about this model is that if you try to set a value to the\nsame thing as last time, Ember (through HTMLBars) will avoid doing any\nwork on the DOM.

\n

This is not just a performance optimization. If an attribute has not\nchanged, it is important not to clobber the element's "hidden state".\nFor example, if you set an input's value to the same value as before,\nit will clobber selection state and cursor position. In other words,\nsetting an attribute is not always idempotent.

\n

This method provides a way to read an element's attribute and also\nupdate the last value Ember knows about at the same time. This makes\nsetting an attribute idempotent.

\n

In particular, what this means is that if you get an <input> element's\nvalue attribute and then re-render the template with the same value,\nit will avoid clobbering the cursor and selection position.\nSince most attribute sets are idempotent in the browser, you typically\ncan get away with reading attributes using jQuery, but the most reliable\nway to do so is through this method.

\n", + "itemtype": "method", + "name": "readDOMAttr", + "params": [ + { + "name": "name", + "description": "the name of the attribute", + "type": "String" + } + ], + "return": { + "description": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 879, + "description": "

Called when the attributes passed into the component have been updated.\nCalled both during the initial render of a container and during a rerender.\nCan be used in place of an observer; code placed here will be executed\nevery time any attribute updates.

\n", + "itemtype": "method", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 900, + "description": "

Called after a component has been rendered, both on initial render and\nin subsequent rerenders.

\n", + "itemtype": "method", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 917, + "description": "

Called before a component has been rendered, both on initial render and\nin subsequent rerenders.

\n", + "itemtype": "method", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 934, + "description": "

Called when the attributes passed into the component have been changed.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 951, + "description": "

Called when the component is about to update and rerender itself.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 968, + "description": "

Called when the component has updated and rerendered itself.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 41, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 62, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 82, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 114, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 156, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 165, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 180, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 196, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 212, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.js", + "line": 52, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 70, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 96, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 116, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 156, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 214, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 299, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 373, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 409, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.js", + "line": 41, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.TargetActionSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 167, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 54, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 80, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 101, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 124, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 139, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 430, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Mixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 890, + "description": "

Called when the attributes passed into the component have been updated.\nCalled both during the initial render of a container and during a rerender.\nCan be used in place of an observer; code placed here will be executed\nevery time any attribute updates.

\n", + "itemtype": "event", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 909, + "description": "

Called after a component has been rendered, both on initial render and\nin subsequent rerenders.

\n", + "itemtype": "event", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 926, + "description": "

Called before a component has been rendered, both on initial render and\nin subsequent rerenders.

\n", + "itemtype": "event", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 943, + "description": "

Called when the attributes passed into the component have been changed.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 960, + "description": "

Called when the component is about to update and rerender itself.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 977, + "description": "

Called when the component has updated and rerendered itself.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 268, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 276, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 289, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 313, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 326, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 334, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 803, + "description": "

The WAI-ARIA role of the control represented by this view. For example, a\nbutton may have a role of type 'button', or a pane may have a role of\ntype 'alertdialog'. This property is used by assistive software to help\nvisually challenged users navigate rich web applications.

\n

The full list of valid WAI-ARIA roles is available at:\nhttps://www.w3.org/TR/wai-aria/#roles_categorization

\n", + "itemtype": "property", + "name": "ariaRole", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 818, + "description": "

Enables components to take a list of parameters as arguments.\nFor example, a component that takes two parameters with the names\nname and age:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: ['name', 'age']\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" 38}}
\n
\n
\n \n

The parameters can be referred to just like named parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Name: {{name}}, Age: {{age}}.
\n
\n
\n \n

Using a string instead of an array allows for an arbitrary number of\nparameters:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: 'names'\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" "Michael" "Scott"}}
\n
\n
\n \n

The parameters can then be referred to by enumerating over the list:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{#each names as |name|}}{{name}}{{/each}}
\n
\n
\n \n", + "static": 1, + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "positionalParams", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 985, + "description": "

Layout can be used to wrap content in a component.

\n", + "itemtype": "property", + "name": "layout", + "type": "Function", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 992, + "description": "

The name of the layout to lookup if no layout is provided.\nBy default Component will lookup a template with this name in\nEmber.TEMPLATES (a shared global object).

\n", + "itemtype": "property", + "name": "layoutName", + "type": "String", + "default": "null", + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1002, + "description": "

The HTML id of the component's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent @elementId="a-really-cool-id" />
\n
\n
\n \n

If not manually set a default value will be provided by the framework.\nOnce rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
export default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    var index = this.get('index');\n    this.set('elementId', `component-id${index}`);\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.js", + "line": 34, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 12, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 141, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 235, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 346, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/child_views_support.js", + "line": 8, + "description": "

Array of child views. You should never edit this array directly.

\n", + "itemtype": "property", + "name": "childViews", + "type": "Array", + "default": "[]", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.js", + "line": 31, + "description": "

Standard CSS class names to apply to the view's outer element. This\nproperty automatically inherits any class names defined by the view's\nsuperclasses as well.

\n", + "itemtype": "property", + "name": "classNames", + "type": "Array", + "default": "['ember-view']", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.js", + "line": 43, + "description": "

A list of properties of the view to apply as class names. If the property\nis a string value, the value of that string will be applied as a class\nname.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'high' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['priority'],\n  priority: 'high'\n});
\n
\n
\n \n

If the value of the property is a Boolean, the name of that property is\nadded as a dasherized class name.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'is-urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would prefer to use a custom value instead of the dasherized\nproperty name, you can pass a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent:urgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would like to specify a class that should only be added when the\nproperty is false, you can declare a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'disabled' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: false\n});
\n
\n
\n \n

This list of properties is inherited from the component's superclasses as well.

\n", + "itemtype": "property", + "name": "classNameBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 22, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-Ember.CoreView", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-ComputedProperty-4213817743.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-ComputedProperty-4213817743.json new file mode 100644 index 000000000..3c94fc707 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-ComputedProperty-4213817743.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-4.0.1-ComputedProperty", + "type": "class", + "attributes": { + "name": "ComputedProperty", + "shortname": "ComputedProperty", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 55, + "description": "

@computed is a decorator that turns a JavaScript getter and setter into a\ncomputed property, which is a cached, trackable value. By default the getter\nwill only be called once and the result will be cached. You can specify\nvarious properties that your computed property depends on. This will force the\ncached result to be cleared if the dependencies are modified, and lazily recomputed the next time something asks for it.

\n

In the following example we decorate a getter - fullName - by calling\ncomputed with the property dependencies (firstName and lastName) as\narguments. The fullName getter will be called once (regardless of how many\ntimes it is accessed) as long as its dependencies do not change. Once\nfirstName or lastName are updated any future calls to fullName will\nincorporate the new values, and any watchers of the value such as templates\nwill be updated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet tom = new Person('Tom', 'Dale');\n\ntom.fullName; // 'Tom Dale'
\n
\n
\n \n

You can also provide a setter, which will be used when updating the computed\nproperty. Ember's set function must be used to update the property\nsince it will also notify observers of the property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(' ');\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

You can also pass a getter function or object with get and set functions\nas the last argument to the computed decorator. This allows you to define\ncomputed property macros:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { computed } from '@ember/object';\n\nfunction join(...keys) {\n  return computed(...keys, function() {\n    return keys.map(key => this[key]).join(' ');\n  });\n}\n\nclass Person {\n  @join('firstName', 'lastName')\n  fullName;\n}
\n
\n
\n \n

Note that when defined this way, getters and setters receive the key of the\nproperty they are decorating as the first argument. Setters receive the value\nthey are setting to as the second argument instead. Additionally, setters must\nreturn the value that should be cached:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { computed, set } from '@ember/object';\n\nfunction fullNameMacro(firstNameKey, lastNameKey) {\n  return computed(firstNameKey, lastNameKey, {\n    get() {\n      return `${this[firstNameKey]} ${this[lastNameKey]}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, firstNameKey, firstName);\n      set(this, lastNameKey, lastName);\n\n      return value;\n    }\n  });\n}\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @fullNameMacro('firstName', 'lastName') fullName;\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

Computed properties can also be used in classic classes. To do this, we\nprovide the getter and setter as the last argument like we would for a macro,\nand we assign it to a property on the class definition. This is an anonymous\ncomputed macro:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import EmberObject, { computed, set } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  // these will be supplied by `create`\n  firstName: null,\n  lastName: null,\n\n  fullName: computed('firstName', 'lastName', {\n    get() {\n      return `${this.firstName} ${this.lastName}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, 'firstName', firstName);\n      set(this, 'lastName', lastName);\n\n      return value;\n    }\n  })\n});\n\nlet tom = Person.create({\n  firstName: 'Tom',\n  lastName: 'Dale'\n});\n\ntom.get('fullName') // 'Tom Dale'
\n
\n
\n \n

You can overwrite computed property without setters with a normal property (no\nlonger computed) that won't change if dependencies change. You can also mark\ncomputed property as .readOnly() and block all attempts to set it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName').readOnly()\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet person = new Person();\nperson.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX>
\n
\n
\n \n

Additional resources:

\n\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 583, + "description": "

Call on a computed property to set it into read-only mode. When in this\nmode the computed property will throw an error when set.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  @computed().readOnly()\n  get guid() {\n    return 'guid-guid-guid';\n  }\n}\n\nlet person = new Person();\nset(person, 'guid', 'new-guid'); // will throw an exception
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  guid: computed(function() {\n    return 'guid-guid-guid';\n  }).readOnly()\n});\n\nlet person = Person.create();\nperson.set('guid', 'new-guid'); // will throw an exception
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "return": { + "description": "this", + "type": "ComputedProperty" + }, + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 633, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For example,\ncomputed property functions may close over variables that are then no longer\navailable for introspection. You can pass a hash of these values to a\ncomputed property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nclass Store {\n  @computed().meta({ type: Person })\n  get person() {\n    let personId = this.personId;\n    return Person.create({ id: personId });\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nconst Store = EmberObject.extend({\n  person: computed(function() {\n    let personId = this.get('personId');\n    return Person.create({ id: personId });\n  }).meta({ type: Person })\n});
\n
\n
\n \n

The hash that you pass to the meta() function will be saved on the\ncomputed property descriptor under the _meta key. Ember runtime\nexposes a public API for retrieving these values from classes,\nvia the metaForProperty() function.

\n", + "itemtype": "method", + "name": "meta", + "params": [ + { + "name": "meta", + "description": "", + "type": "Object" + } + ], + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Container-c84f343883.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Container-c84f343883.json new file mode 100644 index 000000000..38e66b8b3 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Container-c84f343883.json @@ -0,0 +1,197 @@ +{ + "data": { + "id": "ember-4.0.1-Container", + "type": "class", + "attributes": { + "name": "Container", + "shortname": "Container", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 58, + "description": "

A container used to instantiate and cache objects.

\n

Every Container must be associated with a Registry, which is referenced\nto determine the factory and options that should be used to instantiate\nobjects.

\n

The public API for Container is still in flux and should not be considered\nstable.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 117, + "description": "

Given a fullName return a corresponding instance.\n The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter');\ntwitter instanceof Twitter; // => true\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted, an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "The fullname of the request source (used for local lookup)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 157, + "description": "

A depth first traversal, destroying the container, its descendant containers and all\ntheir managed objects.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "destroy", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 174, + "description": "

Clear either the entire cache or just the cache for a particular key.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "params": [ + { + "name": "fullName", + "description": "optional key to reset; if missing, resets everything", + "type": "String" + } + ], + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 191, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "return": { + "description": "", + "type": "Object" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 204, + "description": "

Given a fullName, return the corresponding factory. The consumer of the factory\nis responsible for the destruction of any factory instances, as there is no\nway for the container to ensure instances are destroyed when it itself is\ndestroyed.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "The fullname of the request source (used for local lookup)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 98, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registry", + "type": "Registry", + "since": "1.11.0", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 105, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "cache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 111, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "validationCache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-ContainerDebugAdapter-61ddc54895.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-ContainerDebugAdapter-61ddc54895.json new file mode 100644 index 000000000..7d3b8f818 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-ContainerDebugAdapter-61ddc54895.json @@ -0,0 +1,593 @@ +{ + "data": { + "id": "ember-4.0.1-ContainerDebugAdapter", + "type": "class", + "attributes": { + "name": "ContainerDebugAdapter", + "shortname": "ContainerDebugAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.js", + "line": 9, + "description": "

The ContainerDebugAdapter helps the container and resolver interface\nwith tools that debug Ember such as the\nEmber Inspector\nfor Chrome and Firefox.

\n

This class can be extended by a custom resolver implementer\nto override some of the methods with library-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • canCatalogEntriesByType
  • \n
  • catalogEntriesByType
  • \n
\n

The adapter will need to be registered\nin the application's container as container-debug-adapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "containerDebugAdapter",\n\n  initialize(application) {\n    application.register('container-debug-adapter:main', require('app/container-debug-adapter'));\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "since": "1.5.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.js", + "line": 61, + "description": "

Returns true if it is possible to catalog a list of available\nclasses in the resolver for a given type.

\n", + "itemtype": "method", + "name": "canCatalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "whether a list is available for this type.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.js", + "line": 78, + "description": "

Returns the available classes a given type.

\n", + "itemtype": "method", + "name": "catalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "An array of strings.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.js", + "line": 50, + "description": "

The resolver instance of the application\nbeing debugged. This property will be injected\non creation.

\n", + "itemtype": "property", + "name": "resolver", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-ContainerProxyMixin-0ea9c8315c.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-ContainerProxyMixin-0ea9c8315c.json new file mode 100644 index 000000000..494cbd360 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-ContainerProxyMixin-0ea9c8315c.json @@ -0,0 +1,131 @@ +{ + "data": { + "id": "ember-4.0.1-ContainerProxyMixin", + "type": "class", + "attributes": { + "name": "ContainerProxyMixin", + "shortname": "ContainerProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 7, + "description": "

ContainerProxyMixin is used to provide public access to specific\ncontainer functionality.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 23, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "ContainerProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 49, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ContainerProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 110, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ContainerProxyMixin", + "module": "ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 15, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ContainerProxyMixin", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Controller-d54fe44a2e.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Controller-d54fe44a2e.json new file mode 100644 index 000000000..e3938f63e --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Controller-d54fe44a2e.json @@ -0,0 +1,714 @@ +{ + "data": { + "id": "ember-4.0.1-Controller", + "type": "class", + "attributes": { + "name": "Controller", + "shortname": "Controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "", + "file": "packages/@ember/controller/index.js", + "line": 9, + "extends": "EmberObject", + "uses": [ + "Ember.ControllerMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 50, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 71, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 92, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "itemtype": "method", + "name": "transitionToRoute", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 177, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + } + ], + "itemtype": "method", + "name": "replaceRoute", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 167, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 22, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 21, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 41, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 22, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-CoreObject-cb6bb6c2a7.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-CoreObject-cb6bb6c2a7.json new file mode 100644 index 000000000..1fbc91020 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-CoreObject-cb6bb6c2a7.json @@ -0,0 +1,158 @@ +{ + "data": { + "id": "ember-4.0.1-CoreObject", + "type": "class", + "attributes": { + "name": "CoreObject", + "shortname": "CoreObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 137, + "description": "

CoreObject is the base class for all Ember constructs. It establishes a\nclass system based on Ember's Mixin system, and provides the basis for the\nEmber Object Model. CoreObject should generally not be used directly,\ninstead you should use EmberObject.

\n

Usage

\n

You can define a class by extending from CoreObject using the extend\nmethod:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Person = CoreObject.extend({\n  name: 'Tomster',\n});
\n
\n
\n \n

For detailed usage, see the Object Model\nsection of the guides.

\n

Usage with Native Classes

\n

Native JavaScript class syntax can be used to extend from any CoreObject\nbased class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
class Person extends CoreObject {\n  init() {\n    super.init(...arguments);\n    this.name = 'Tomster';\n  }\n}
\n
\n
\n \n

Some notes about class usage:

\n
    \n
  • new syntax is not currently supported with classes that extend from\nEmberObject or CoreObject. You must continue to use the create method\nwhen making new instances of classes, even if they are defined using native\nclass syntax. If you want to use new syntax, consider creating classes\nwhich do not extend from EmberObject or CoreObject. Ember features,\nsuch as computed properties and decorators, will still work with base-less\nclasses.
  • \n
  • Instead of using this._super(), you must use standard super syntax in\nnative classes. See the MDN docs on classes\nfor more details.
  • \n
  • Native classes support using constructors\nto set up newly-created instances. Ember uses these to, among other things,\nsupport features that need to retrieve other entities by name, like Service\ninjection and getOwner. To ensure your custom instance setup logic takes\nplace after this important work is done, avoid using the constructor in\nfavor of init.
  • \n
  • Properties passed to create will be available on the instance by the time\ninit runs, so any code that requires these values should work at that\ntime.
  • \n
  • Using native classes, and switching back to the old Ember Object model is\nfully supported.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.0.1-Helper" + }, + { + "type": "class", + "id": "ember-4.0.1-EmberObject" + } + ] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-DataAdapter-af8dd8ddc3.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-DataAdapter-af8dd8ddc3.json new file mode 100644 index 000000000..bfc6598e5 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-DataAdapter-af8dd8ddc3.json @@ -0,0 +1,935 @@ +{ + "data": { + "id": "ember-4.0.1-DataAdapter", + "type": "class", + "attributes": { + "name": "DataAdapter", + "shortname": "DataAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 125, + "description": "

The DataAdapter helps a data persistence library\ninterface with tools that debug Ember such\nas the Ember Inspector\nfor Chrome and Firefox.

\n

This class will be extended by a persistence library\nwhich will override some of the methods with\nlibrary-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • getFilters
  • \n
  • detect
  • \n
  • columnsForType
  • \n
  • getRecords
  • \n
  • getRecordColumnValues
  • \n
  • getRecordKeywords
  • \n
  • getRecordFilterValues
  • \n
  • getRecordColor
  • \n
\n

The adapter will need to be registered\nin the application's container as dataAdapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "data-adapter",\n\n  initialize: function(application) {\n    application.register('data-adapter:main', DS.DataAdapter);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 248, + "description": "

Specifies how records can be filtered.\nRecords returned will need to have a filterValues\nproperty with a key for every name in the returned array.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getFilters", + "return": { + "description": "List of objects defining filters.\n The object should have a `name` and `desc` property.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 262, + "description": "

Fetch the model types and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchModelTypes", + "params": [ + { + "name": "typesAdded", + "description": "Callback to call to add types.\nTakes an array of objects containing wrapped types (returned from `wrapModelType`).", + "type": "Function" + }, + { + "name": "typesUpdated", + "description": "Callback to call when a type has changed.\nTakes an array of objects containing wrapped types.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 307, + "description": "

Fetch the records of a given type and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchRecords", + "params": [ + { + "name": "modelName", + "description": "The model name.", + "type": "String" + }, + { + "name": "recordsAdded", + "description": "Callback to call to add records.\nTakes an array of objects containing wrapped records.\nThe object should have the following properties:\n columnValues: {Object} The key and value of a table cell.\n object: {Object} The actual record object.", + "type": "Function" + }, + { + "name": "recordsUpdated", + "description": "Callback to call when a record has changed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + }, + { + "name": "recordsRemoved", + "description": "Callback to call when a record has removed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 374, + "description": "

Clear all observers before destruction

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 392, + "description": "

Detect whether a class is a model.

\n

Test that against the model class\nof your persistence library.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "detect", + "return": { + "description": "boolean Whether the class is a model class or not." + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 406, + "description": "

Get the columns for a given model type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "columnsForType", + "return": { + "description": "An array of columns of the following format:\n name: {String} The name of the column.\n desc: {String} Humanized description (what would show in a table column name).", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 419, + "description": "

Adds observers to a model type class.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "observeModelType", + "params": [ + { + "name": "modelName", + "description": "The model type name.", + "type": "String" + }, + { + "name": "typesUpdated", + "description": "Called when a type is modified.", + "type": "Function" + } + ], + "return": { + "description": "The function to call to remove observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 456, + "description": "

Wraps a given model type and observes changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapModelType", + "params": [ + { + "name": "klass", + "description": "A model class.", + "type": "Class" + }, + { + "name": "modelName", + "description": "Name of the class.", + "type": "String" + } + ], + "return": { + "description": "Contains the wrapped type and the function to remove observers\nFormat:\n type: {Object} The wrapped type.\n The wrapped type has the following format:\n name: {String} The name of the type.\n count: {Integer} The number of records available.\n columns: {Columns} An array of columns to describe the record.\n object: {Class} The actual Model type class.\n release: {Function} The function to remove observers.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 487, + "description": "

Fetches all models defined in the application.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getModelTypes", + "return": { + "description": "Array of model types.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 516, + "description": "

Loops over all namespaces and all objects\nattached to them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getObjectsOnNamespaces", + "return": { + "description": "Array of model type strings.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 545, + "description": "

Fetches all loaded records for a given type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecords", + "return": { + "description": "An array of records.\n This array will be observed for changes,\n so it should update when new records are added/removed.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 558, + "description": "

Wraps a record and observers changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapRecord", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The wrapped record. Format:\ncolumnValues: {Array}\nsearchKeywords: {Array}", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 579, + "description": "

Gets the values for each column.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColumnValues", + "return": { + "description": "Keys should match column names defined\nby the model type.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 591, + "description": "

Returns keywords to match when searching records.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordKeywords", + "return": { + "description": "Relevant keywords for search.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 602, + "description": "

Returns the values of filters defined by getFilters.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordFilterValues", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The filter values.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 614, + "description": "

Each record can have a color that represents its state.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColor", + "params": [ + { + "name": "record", + "description": "The record instance", + "type": "Object" + } + ], + "return": { + "description": "The records color.\n Possible options: black, red, blue, green.", + "type": "String" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 177, + "description": "

The container-debug-adapter which is used\nto list all models.

\n", + "itemtype": "property", + "name": "containerDebugAdapter", + "default": "undefined", + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 187, + "description": "

The number of attributes to send\nas columns. (Enough to make the record\nidentifiable).

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "attributeLimit", + "default": "3", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 199, + "description": "

Ember Data > v1.0.0-beta.18\nrequires string model names to be passed\naround instead of the actual factories.

\n

This is a stamp for the Ember Inspector\nto differentiate between the versions\nto be able to support older versions too.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "acceptsModelName", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 213, + "description": "

Map from records arrays to RecordsWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "recordsWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 221, + "description": "

Map from records arrays to TypeWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "typeWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 229, + "description": "

Callback that is currently scheduled on backburner end to flush and check\nall active watchers.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "flushWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 239, + "description": "

Stores all methods that clear observers.\nThese methods will be called on destruction.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "releaseMethods", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.ActionHandler-6769ecc29a.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.ActionHandler-6769ecc29a.json new file mode 100644 index 000000000..af3b995fa --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.ActionHandler-6769ecc29a.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.0.1-Ember.ActionHandler", + "type": "class", + "attributes": { + "name": "Ember.ActionHandler", + "shortname": "Ember.ActionHandler", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.ControllerMixin", + "Ember.CoreView" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 8, + "description": "

Ember.ActionHandler is available on some familiar classes including\nRoute, Component, and Controller.\n(Internally the mixin is used by Ember.CoreView, Ember.ControllerMixin,\nand Route and available to the above classes through\ninheritance.)

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 167, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 22, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.ControllerMixin-153f7df9ea.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.ControllerMixin-153f7df9ea.json new file mode 100644 index 000000000..c596aa5ec --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.ControllerMixin-153f7df9ea.json @@ -0,0 +1,213 @@ +{ + "data": { + "id": "ember-4.0.1-Ember.ControllerMixin", + "type": "class", + "attributes": { + "name": "Ember.ControllerMixin", + "shortname": "Ember.ControllerMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Controller" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 11, + "uses": [ + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 50, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 71, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 92, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "itemtype": "method", + "name": "transitionToRoute", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 177, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + } + ], + "itemtype": "method", + "name": "replaceRoute", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 167, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 22, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 21, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 41, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 22, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.CoreView-37be1a0f6b.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.CoreView-37be1a0f6b.json new file mode 100644 index 000000000..ba754662a --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.CoreView-37be1a0f6b.json @@ -0,0 +1,933 @@ +{ + "data": { + "id": "ember-4.0.1-Ember.CoreView", + "type": "class", + "attributes": { + "name": "Ember.CoreView", + "shortname": "Ember.CoreView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/views/core_view.js", + "line": 5, + "description": "

Ember.CoreView is an abstract class that exists to give view-like behavior\nto both Ember's main view class Component and other classes that don't need\nthe full functionality of Component.

\n

Unless you have specific needs for CoreView, you will use Component\nin your applications.

\n", + "extends": "EmberObject", + "deprecated": true, + "deprecationMessage": "Use `Component` instead.", + "uses": [ + "Evented", + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 41, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 62, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 82, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 114, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 156, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 165, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 180, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 196, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 212, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.js", + "line": 52, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 54, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 80, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 101, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 124, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 139, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 167, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/views/core_view.js", + "line": 34, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 22, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.0.1-Component" + } + ] + }, + "module": { + "data": { + "id": "ember-4.0.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.EventDispatcher-211751a76b.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.EventDispatcher-211751a76b.json new file mode 100644 index 000000000..f03c4e076 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.EventDispatcher-211751a76b.json @@ -0,0 +1,174 @@ +{ + "data": { + "id": "ember-4.0.1-Ember.EventDispatcher", + "type": "class", + "attributes": { + "name": "Ember.EventDispatcher", + "shortname": "Ember.EventDispatcher", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 15, + "description": "

Ember.EventDispatcher handles delegating browser events to their\ncorresponding Ember.Views. For example, when you click on a view,\nEmber.EventDispatcher ensures that that view's mouseDown method gets\ncalled.

\n", + "access": "private", + "tagname": "", + "extends": "Ember.Object", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 112, + "description": "

Sets up event listeners for standard browser events.

\n

This will be called after the browser sends a DOMContentReady event. By\ndefault, it will set up all of the listeners on the document body. If you\nwould like to register the listeners on a different element, set the event\ndispatcher's root property.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "params": [ + { + "name": "addedEvents", + "description": "", + "type": "Object" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 202, + "description": "

Setup event listeners for the given browser event name

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForBrowserEvent", + "params": [ + { + "name": "event", + "description": "the name of the event in the browser" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 213, + "description": "

Setup event listeners for the given Ember event name (camel case)

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForEmberEvent", + "params": [ + { + "name": "eventName", + "description": "" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 228, + "description": "

Registers an event listener on the rootElement. If the given event is\ntriggered, the provided event handler will be triggered on the target view.

\n

If the target view does not implement the event handler, or if the handler\nreturns false, the parent view will be called. The event will continue to\nbubble to each successive parent view until it reaches the top.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandler", + "params": [ + { + "name": "rootElement", + "description": "", + "type": "Element" + }, + { + "name": "event", + "description": "the name of the event in the browser", + "type": "String" + }, + { + "name": "eventName", + "description": "the name of the method to call on the view", + "type": "String" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/system/action_manager.js", + "line": 7, + "description": "

Global action id hash.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registeredActions", + "type": "Object", + "class": "Ember.EventDispatcher", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 27, + "description": "

The set of events names (and associated handler function names) to be setup\nand dispatched by the EventDispatcher. Modifications to this list can be done\nat setup time, generally via the Application.customEvents hash.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "events", + "type": "Object", + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 87, + "description": "

The root DOM element to which event listeners should be attached. Event\nlisteners will be attached to the document unless this is overridden.

\n

Can be specified as a DOMElement or a selector string.

\n

The default body is a string since this may be evaluated before document.body\nexists in the DOM.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.Object", + "type": "missing" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.Namespace-911d111899.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.Namespace-911d111899.json new file mode 100644 index 000000000..194f77b69 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.Namespace-911d111899.json @@ -0,0 +1,541 @@ +{ + "data": { + "id": "ember-4.0.1-Ember.Namespace", + "type": "class", + "attributes": { + "name": "Ember.Namespace", + "shortname": "Ember.Namespace", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/system/namespace.js", + "line": 18, + "description": "

A Namespace is an object usually used to contain other objects or methods\nsuch as an application or framework. Create a namespace anytime you want\nto define one of these new containers.

\n

Example Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
MyFramework = Ember.Namespace.create({\n  VERSION: '1.0.0'\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.0.1-Engine" + } + ] + }, + "module": { + "data": { + "id": "ember-4.0.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.NativeArray-6c782342cf.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.NativeArray-6c782342cf.json new file mode 100644 index 000000000..cc8b795c5 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.NativeArray-6c782342cf.json @@ -0,0 +1,1635 @@ +{ + "data": { + "id": "ember-4.0.1-Ember.NativeArray", + "type": "class", + "attributes": { + "name": "Ember.NativeArray", + "shortname": "Ember.NativeArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1747, + "description": "

The NativeArray mixin contains the properties needed to make the native\nArray support MutableArray and all of its dependent APIs. Unless you\nhave EmberENV.EXTEND_PROTOTYPES or EmberENV.EXTEND_PROTOTYPES.Array set to\nfalse, this will be applied automatically. Otherwise you can apply the mixin\nat anytime by calling Ember.NativeArray.apply(Array.prototype).

\n", + "uses": [ + "Observable", + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1348, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1367, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1393, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1415, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1440, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1460, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1480, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1506, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1531, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1551, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumberable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1572, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1591, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1618, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1646, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1663, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1689, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1116, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1154, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1166, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1182, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1215, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1259, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1278, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1300, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.TargetActionSupport-5f40b61e96.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.TargetActionSupport-5f40b61e96.json new file mode 100644 index 000000000..147de6846 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.TargetActionSupport-5f40b61e96.json @@ -0,0 +1,101 @@ +{ + "data": { + "id": "ember-4.0.1-Ember.TargetActionSupport", + "type": "class", + "attributes": { + "name": "Ember.TargetActionSupport", + "shortname": "Ember.TargetActionSupport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.js", + "line": 10, + "description": "

Ember.TargetActionSupport is a mixin that can be included in a class\nto add a triggerAction method with semantics similar to the Handlebars\n{{action}} helper. In normal Ember usage, the {{action}} helper is\nusually the best choice. This mixin is most often useful when you are\ndoing more complex event handling in Components.

\n", + "extends": "Mixin", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.js", + "line": 41, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 430, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Mixin" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-Mixin", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.Templates.components-9c3afb6702.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.Templates.components-9c3afb6702.json new file mode 100644 index 000000000..e40d1c670 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.Templates.components-9c3afb6702.json @@ -0,0 +1,85 @@ +{ + "data": { + "id": "ember-4.0.1-Ember.Templates.components", + "type": "class", + "attributes": { + "name": "Ember.Templates.components", + "shortname": "Ember.Templates.components", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 66, + "description": "

The Input component lets you create an HTML <input> element.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value="987" />
\n
\n
\n \n

creates an <input> element with type="text" and value set to 987.

\n

Text field

\n

If no type argument is specified, a default of type 'text' is used.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Search:\n<Input @value={{this.searchWord}} />
\n
\n
\n \n

In this example, the initial value in the <input> will be set to the value of\nthis.searchWord. If the user changes the text, the value of this.searchWord will also be\nupdated.

\n

Actions

\n

The Input component takes a number of arguments with callbacks that are invoked in response to\nuser events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-down
  • \n
  • key-press
  • \n
  • key-up
  • \n
\n

These callbacks are passed to Input like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Starting with Ember Octane, we recommend using the {{on}} modifier to call actions\non specific events, such as the input event.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
<label for="input-name">Name:</label>\n<Input\n  @id="input-name"\n  @value={{this.name}}\n  {{on "input" this.validateName}}\n/>
\n
\n
\n \n

The event name (e.g. focusout, input, keydown) always follows the casing\nthat the HTML standard uses.

\n

<input> HTML Attributes to Avoid

\n

In most cases, if you want to pass an attribute to the underlying HTML <input> element, you\ncan pass the attribute directly, just like any other Ember component.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @type="text" size="10" />
\n
\n
\n \n

In this example, the size attribute will be applied to the underlying <input> element in the\noutputted HTML.

\n

However, there are a few attributes where you must use the @ version.

\n
    \n
  • @type: This argument is used to control which Ember component is used under the hood
  • \n
  • @value: The @value argument installs a two-way binding onto the element. If you wanted a\none-way binding, use <input> with the value property and the input event instead.
  • \n
  • @checked (for checkboxes): like @value, the @checked argument installs a two-way binding\nonto the element. If you wanted a one-way binding, use <input type="checkbox"> with\nchecked and the input event instead.
  • \n
\n

Extending TextField

\n

Internally, <Input @type="text" /> creates an instance of TextField, passing arguments from\nthe helper to TextField's create method. Subclassing TextField is supported but not\nrecommended.

\n

See TextField

\n

Checkbox

\n

To create an <input type="checkbox">:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Emberize Everything:\n<Input @type="checkbox" @checked={{this.isEmberized}} name="isEmberized" />
\n
\n
\n \n

This will bind the checked state of this checkbox to the value of isEmberized -- if either one\nchanges, it will be reflected in the other.

\n

Extending Checkbox

\n

Internally, <Input @type="checkbox" /> creates an instance of Checkbox. Subclassing\nTextField is supported but not recommended.

\n

See Checkbox

\n", + "itemtype": "method", + "name": "Input", + "see": [ + "{TextField}", + "{Checkbox}" + ], + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 40, + "description": "

The LinkTo component renders a link to the supplied routeName passing an optionally\nsupplied model to the route as its model context of the route. The block for LinkTo\nbecomes the contents of the rendered element:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

Disabling the LinkTo component

\n

The LinkTo component can be disabled by using the disabled argument. A disabled link\ndoesn't result in a transition when activated, and adds the disabled class to the <a>\nelement.

\n

(The class name to apply to the element can be overridden by using the disabledClass\nargument)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @disabled={{true}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

Handling href

\n

<LinkTo> will use your application's Router to fill the element's href property with a URL\nthat matches the path to the supplied routeName.

\n

Handling current route

\n

The LinkTo component will apply a CSS class name of 'active' when the application's current\nroute matches the supplied routeName. For example, if the application's current route is\n'photoGallery.recent', then the following invocation of LinkTo:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

will result in

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="active">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

The CSS class used for active classes can be customized by passing an activeClass argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent' @activeClass="current-url">\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="current-url">\n  Great Hamster Photos\n</a>
\n
\n
\n \n\n

If you need a link to be 'active' even when it doesn't match the current route, you can use the\ncurrent-when argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @current-when='photos'>\n  Photo Gallery\n</LinkTo>
\n
\n
\n \n

This may be helpful for keeping links active for:

\n
    \n
  • non-nested routes that are logically related
  • \n
  • some secondary menu approaches
  • \n
  • 'top navigation' with 'sub navigation' scenarios
  • \n
\n

A link will be active if current-when is true or the current\nroute is the route this link would transition to.

\n

To match multiple routes 'space-separate' the routes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='gallery' @current-when='photos drawings paintings'>\n  Art Gallery\n</LinkTo>
\n
\n
\n \n

Supplying a model

\n

An optional model argument can be used for routes whose\npaths contain dynamic segments. This argument will become\nthe model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", {path: "hamster-photos/:photo_id"});\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{this.aPhoto}}>\n  {{aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

Supplying multiple models

\n

For deep-linking to route paths that contain multiple\ndynamic segments, the models argument can be used.

\n

As the router transitions through the route path, each\nsupplied model argument will become the context for the\nroute with the dynamic segments:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() {\n    this.route("comment", {path: "comments/:comment_id"});\n  });\n});
\n
\n
\n \n

This argument will become the model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.comment' @models={{array this.aPhoto this.comment}}>\n  {{comment.body}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42/comments/718">\n  A+++ would snuggle again.\n</a>
\n
\n
\n \n

Supplying an explicit dynamic segment value

\n

If you don't have a model object available to pass to LinkTo,\nan optional string or integer argument can be passed for routes whose\npaths contain dynamic segments. This argument will become the value\nof the dynamic segment:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{aPhotoId}}>\n  {{this.aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

When transitioning into the linked route, the model hook will\nbe triggered with parameters including this passed identifier.

\n

Supplying query parameters

\n

If you need to add optional key-value pairs that appear to the right of the ? in a URL,\nyou can use the query argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @query={{hash page=1 per_page=20}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos?page=1&per_page=20">\n  Great Hamster Photos\n</a>
\n
\n
\n \n", + "itemtype": "method", + "name": "LinkTo", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 9, + "description": "

The Textarea component inserts a new instance of <textarea> tag into the template.

\n

The @value argument provides the content of the <textarea>.

\n

This template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value="A bunch of text" />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  A bunch of text\n</textarea>
\n
\n
\n \n

The @value argument is two-way bound. If the user types text into the textarea, the @value\nargument is updated. If the @value argument is updated, the text in the textarea is updated.

\n

In the following example, the writtenWords property on the component will be updated as the user\ntypes 'Lots of text' into the text area of their browser's window.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class WordEditorComponent extends Component {\n  @tracked writtenWords = "Lots of text that IS bound";\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{writtenWords}} />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  Lots of text that IS bound\n</textarea>
\n
\n
\n \n

If you wanted a one way binding, you could use the <textarea> element directly, and use the\nvalue DOM property and the input event.

\n

Actions

\n

The Textarea component takes a number of arguments with callbacks that are invoked in\nresponse to user events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-press
  • \n
\n

These callbacks are passed to Textarea like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Classic Invocation Syntax

\n

The Textarea component can also be invoked using curly braces, just like any other Ember\ncomponent.

\n

For example, this is an invocation using angle-bracket notation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

You could accomplish the same thing using classic invocation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{textarea value=this.searchWord enter=this.query}}
\n
\n
\n \n

The main difference is that angle-bracket invocation supports any HTML attribute using HTML\nattribute syntax, because attributes and arguments have different syntax when using angle-bracket\ninvocation. Curly brace invocation, on the other hand, only has a single syntax for arguments,\nand components must manually map attributes onto component arguments.

\n

When using classic invocation with {{textarea}}, only the following attributes are mapped onto\narguments:

\n
    \n
  • rows
  • \n
  • cols
  • \n
  • name
  • \n
  • selectionEnd
  • \n
  • selectionStart
  • \n
  • autocomplete
  • \n
  • wrap
  • \n
  • lang
  • \n
  • dir
  • \n
  • value
  • \n
\n

Classic layout and layoutName properties

\n

Because HTML textarea elements do not contain inner HTML the layout and\nlayoutName properties will not be applied.

\n", + "itemtype": "method", + "name": "Textarea", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.Templates.helpers-d123df67ff.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.Templates.helpers-d123df67ff.json new file mode 100644 index 000000000..a147a9121 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.Templates.helpers-d123df67ff.json @@ -0,0 +1,480 @@ +{ + "data": { + "id": "ember-4.0.1-Ember.Templates.helpers", + "type": "class", + "attributes": { + "name": "Ember.Templates.helpers", + "shortname": "Ember.Templates.helpers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 86, + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 45, + "description": "

See Ember.Templates.components.Input.

\n", + "itemtype": "method", + "name": "input", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 252, + "description": "

See Ember.Templates.components.LinkTo.

\n", + "itemtype": "method", + "name": "link-to", + "see": [ + "{Ember.Templates.components.LinkTo}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 122, + "description": "

See Ember.Templates.components.Textarea.

\n", + "itemtype": "method", + "name": "textarea", + "see": [ + "{Ember.Templates.components.Textarea}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/action.ts", + "line": 22, + "description": "

The {{action}} helper provides a way to pass triggers for behavior (usually\njust a function) between components, and into components from controllers.

\n

Passing functions with the action helper

\n

There are three contexts an action helper can be used in. The first two\ncontexts to discuss are attribute context, and Handlebars value context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>\n{{! Examples of Handlebars value context }}\n{{input on-input=(action "save")}}\n{{yield (action "refreshData") andAnotherParam}}
\n
\n
\n \n

In these contexts,\nthe helper is called a "closure action" helper. Its behavior is simple:\nIf passed a function name, read that function off the actions property\nof the current context. Once that function is read, or immediately if a function was\npassed, create a closure over that function and any arguments.\nThe resulting value of an action helper used this way is simply a function.

\n

For example, in the attribute context:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>
\n
\n
\n \n

The resulting template render logic would be:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
var div = document.createElement('div');\nvar actionFunction = (function(context){\n  return function() {\n    return context.actions.save.apply(context, arguments);\n  };\n})(context);\ndiv.onclick = actionFunction;
\n
\n
\n \n

Thus when the div is clicked, the action on that context is called.\nBecause the actionFunction is just a function, closure actions can be\npassed between components and still execute in the correct context.

\n

Here is an example action handler on a component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  save() {\n    this.model.save();\n  }\n}
\n
\n
\n \n

Actions are always looked up on the actions property of the current context.\nThis avoids collisions in the naming of common actions, such as destroy.\nTwo options can be passed to the action helper when it is used in this way.

\n
    \n
  • target=someProperty will look to someProperty instead of the current\ncontext for the actions hash. This can be useful when targeting a\nservice for actions.
  • \n
  • value="target.value" will read the path target.value off the first\nargument to the action when it is called and rewrite the first argument\nto be that value. This is useful when attaching actions to event listeners.
  • \n
\n

Invoking an action

\n

Closure actions curry both their scope and any arguments. When invoked, any\nadditional arguments are added to the already curried list.\nActions are presented in JavaScript as callbacks, and are\ninvoked like any other JavaScript function.

\n

For example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.hbs
1\n
{{input on-input=(action (action 'setName' @model) value="target.value")}}
\n
\n
\n \n

The first argument (@model) was curried over, and the run-time argument (event)\nbecomes a second argument. Action calls can be nested this way because each simply\nreturns a function. Any function can be passed to the {{action}} helper, including\nother actions.

\n

Actions invoked with sendAction have the same currying behavior as demonstrated\nwith on-input above. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyInput @submit={{action 'setName' @model}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-input submit=(action 'setName' @model)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    // Note that model is not passed, it was curried in the template\n    this.submit('bob');\n  }\n});
\n
\n
\n \n

Attaching actions to DOM elements

\n

The third context of the {{action}} helper can be called "element space".\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of element space }}\n<div {{action "save"}}></div>
\n
\n
\n \n

Used this way, the {{action}} helper provides a useful shortcut for\nregistering an HTML element in a template for a single DOM event and\nforwarding that interaction to the template's context (controller or component).\nIf the context of a template is a controller, actions used this way will\nbubble to routes when the controller does not implement the specified action.\nOnce an action hits a route, it will bubble through the route hierarchy.

\n

Event Propagation

\n

{{action}} helpers called in element space can control event bubbling. Note\nthat the closure style actions cannot.

\n

Events triggered through the action helper will automatically have\n.preventDefault() called on them. You do not need to do so in your event\nhandlers. If you need to allow event propagation (to handle file inputs for\nexample) you can supply the preventDefault=false option to the {{action}} helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<div {{action "sayHello" preventDefault=false}}>\n  <input type="file" />\n  <input type="checkbox" />\n</div>
\n
\n
\n \n

To disable bubbling, pass bubbles=false to the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<button {{action 'edit' post bubbles=false}}>Edit</button>
\n
\n
\n \n

To disable bubbling with closure style actions you must create your own\nwrapper helper that makes use of event.stopPropagation():

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div onclick={{disable-bubbling (action "sayHello")}}>Hello</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
bubbling.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { helper } from '@ember/component/helper';\n\nexport function disableBubbling([action]) {\n  return function(event) {\n    event.stopPropagation();\n    return action(event);\n  };\n}\nexport default helper(disableBubbling);
\n
\n
\n \n

If you need the default handler to trigger you should either register your\nown event handler, or use event methods on your view class. See\n"Responding to Browser Events"\nin the documentation for Component for more information.

\n

Specifying DOM event type

\n

{{action}} helpers called in element space can specify an event type.\nBy default the {{action}} helper registers for DOM click events. You can\nsupply an on option to the helper to specify a different DOM event name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" on="doubleClick"}}>\n  click me\n</div>
\n
\n
\n \n

See "Event Names" for a list of\nacceptable DOM event names.

\n

Specifying whitelisted modifier keys

\n

{{action}} helpers called in element space can specify modifier keys.\nBy default the {{action}} helper will ignore click events with pressed modifier\nkeys. You can supply an allowedKeys option to specify which keys should not be ignored.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="alt"}}>\n  click me\n</div>
\n
\n
\n \n

This way the action will fire when clicking with the alt key pressed down.\nAlternatively, supply "any" to the allowedKeys option to accept any combination of modifier keys.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="any"}}>\n  click me with any key pressed\n</div>
\n
\n
\n \n

Specifying a Target

\n

A target option can be provided to the helper to change\nwhich object will receive the method call. This option must be a path\nto an object, accessible in the current context:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<div {{action "anActionName" target=someService}}>\n  click me\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n
import Controller from '@ember/controller';\nimport { inject as service } from '@ember/service';\n\nexport default class extends Controller {\n  @service someService;\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "action", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/array.ts", + "line": 5, + "description": "

Use the {{array}} helper to create an array to pass as an option to your\ncomponents.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<MyComponent @people={{array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson}}\n/>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{my-component people=(array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson)\n}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Tom Dale', 'Yehuda Katz', this.get('myOtherPerson')]
\n
\n
\n \n

Where the 3rd item in the array is bound to updates of the myOtherPerson property.

\n", + "itemtype": "method", + "name": "array", + "params": [ + { + "name": "options", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "Array", + "type": "Array" + }, + "since": "3.8.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/component.ts", + "line": 5, + "description": "

The {{component}} helper lets you add instances of Component to a\ntemplate. See Component for\nadditional information on how a Component functions.\n{{component}}'s primary use is for cases where you want to dynamically\nchange which type of component is rendered as the state of your application\nchanges. This helper has three modes: inline, block, and nested.

\n

Inline Form

\n

Given the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/application.hbs
1\n
{{component this.infographicComponentName}}
\n
\n
\n \n

And the following application code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Controller from '@ember/controller';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

The live-updating-chart component will be appended when isMarketOpen is\ntrue, and the market-close-summary component will be appended when\nisMarketOpen is false. If the value changes while the app is running,\nthe component will be automatically swapped out accordingly.\nNote: You should not use this helper when you are consistently rendering the same\ncomponent. In that case, use standard component syntax, for example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LiveUpdatingChart />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{live-updating-chart}}
\n
\n
\n \n

Block Form

\n

Using the block form of this helper is similar to using the block form\nof a component. Given the following application template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
{{#component this.infographicComponentName}}\n  Last update: {{this.lastUpdateTimestamp}}\n{{/component}}
\n
\n
\n \n

The following controller code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Controller from '@ember/controller';\nimport { computed } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get lastUpdateTimestamp() {\n    return new Date();\n  }\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

And the following component template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
chart.hbs
1\n2\n
{{! chart }}\n{{yield}}
\n
\n
\n \n

The Last Update: {{this.lastUpdateTimestamp}} will be rendered in place of the {{yield}}.

\n

Nested Usage

\n

The component helper can be used to package a component path with initial attrs.\nThe included attrs can then be merged during the final invocation.\nFor example, given a person-form component with the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.hbs
1\n2\n3\n
{{yield (hash\n  nameInput=(component "my-input-component" value=@model.name placeholder="First Name")\n)}}
\n
\n
\n \n

When yielding the component via the hash helper, the component is invoked directly.\nSee the following snippet:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonForm as |form|>\n  <form.nameInput @placeholder="Username" />\n</PersonForm>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-form as |form|}}\n  {{form.nameInput placeholder="Username"}}\n{{/person-form}}
\n
\n
\n \n

Which outputs an input whose value is already bound to model.name and placeholder\nis "Username".

\n

When yielding the component without the hash helper use the component helper.\nFor example, below is a full-name component template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{yield (component "my-input-component" value=@model.name placeholder="Name")}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<FullName as |field|>\n  {{component field placeholder="Full name"}}\n</FullName>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#full-name as |field|}}\n  {{component field placeholder="Full name"}}\n{{/full-name}}
\n
\n
\n \n", + "itemtype": "method", + "name": "component", + "since": "1.11.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/concat.ts", + "line": 5, + "description": "

Concatenates the given arguments into a string.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{some-component name=(concat firstName " " lastName)}}\n\n{{! would pass name="<first name value> <last name value>" to the component}}
\n
\n
\n \n

or for angle bracket invocation, you actually don't need concat at all.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @name="{{firstName}} {{lastName}}" />
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "concat", + "since": "1.13.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 12, + "description": "

The {{#each}} helper loops over elements in a collection. It is an extension\nof the base Handlebars {{#each}} helper.

\n

The default behavior of {{#each}} is to yield its inner block once for every\nitem in an array passing the item as the first block parameter.

\n

Assuming the @developers argument contains this array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
[{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }];
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

The same rules apply to arrays of primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Yehuda', 'Tom', 'Paul']
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developerNames as |name|}}\n    <li>Hello, {{name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

During iteration, the index of each item in the array is provided as a second block\nparameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person index|}}\n    <li>Hello, {{person.name}}! You're number {{index}} in line</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

Specifying Keys

\n

In order to improve rendering speed, Ember will try to reuse the DOM elements\nwhere possible. Specifically, if the same item is present in the array both\nbefore and after the change, its DOM output will be reused.

\n

The key option is used to tell Ember how to determine if the items in the\narray being iterated over with {{#each}} has changed between renders. By\ndefault the item's object identity is used.

\n

This is usually sufficient, so in most cases, the key option is simply not\nneeded. However, in some rare cases, the objects' identities may change even\nthough they represent the same underlying data.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
people.map(person => {\n  return { ...person, type: 'developer' };\n});
\n
\n
\n \n

In this case, each time the people array is map-ed over, it will produce\nan new array with completely different objects between renders. In these cases,\nyou can help Ember determine how these objects related to each other with the\nkey option:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers key="name" as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

By doing so, Ember will use the value of the property specified (person.name\nin the example) to find a "match" from the previous render. That is, if Ember\nhas previously seen an object from the @developers array with a matching\nname, its DOM elements will be re-used.

\n

There are two special values for key:

\n
    \n
  • @index - The index of the item in the array.
  • \n
  • @identity - The item in the array itself.
  • \n
\n

{{else}} condition

\n

{{#each}} can have a matching {{else}}. The contents of this block will render\nif the collection is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<ul>\n  {{#each @developers as |person|}}\n    <li>{{person.name}} is available!</li>\n  {{else}}\n    <li>Sorry, nobody is available for this task.</li>\n  {{/each}}\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 123, + "description": "

The {{each-in}} helper loops over properties on an object.

\n

For example, given this component definition:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    "name": "Shelly Sails",\n    "age": 42\n  };\n}
\n
\n
\n \n

This template would display all properties on the developer\nobject in a list:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.hbs
1\n2\n3\n4\n5\n
<ul>\n  {{#each-in this.developer as |key value|}}\n    <li>{{key}}: {{value}}</li>\n  {{/each-in}}\n</ul>
\n
\n
\n \n

Outputting their name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<ul>\n  <li>name: Shelly Sails</li>\n  <li>age: 42</li>\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each-in", + "access": "public", + "tagname": "", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/fn.ts", + "line": 5, + "description": "

The fn helper allows you to ensure a function that you are passing off\nto another component, helper, or modifier has access to arguments that are\navailable in the template.

\n

For example, if you have an each helper looping over a number of items, you\nmay need to pass a function that expects to receive the item as an argument\nto a component invoked within the loop. Here's how you could use the fn\nhelper to pass both the function and its arguments together:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
listing.hbs
1\n2\n3\n
{{#each @items as |item|}}\n<DisplayItem @item=item @select={{fn this.handleSelected item}} />\n{{/each}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class ItemsList extends Component {\n  @action\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this case the display-item component will receive a normal function\nthat it can invoke. When it invokes the function, the handleSelected\nfunction will receive the item and any arguments passed, thanks to the\nfn helper.

\n

Let's take look at what that means in a couple circumstances:

\n
    \n
  • When invoked as this.args.select() the handleSelected function will\nreceive the item from the loop as its first and only argument.
  • \n
  • When invoked as this.args.select('foo') the handleSelected function\nwill receive the item from the loop as its first argument and the\nstring 'foo' as its second argument.
  • \n
\n

In the example above, we used @action to ensure that handleSelected is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class ItemsList extends Component {\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when handleSelected is invoked inside the display-item\ncomponent, it will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into fn!

\n

See also partial application.

\n", + "itemtype": "method", + "name": "fn", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/get.ts", + "line": 5, + "description": "

Dynamically look up a property on an object. The second argument to {{get}}\nshould have a string value, although it can be bound.

\n

For example, these two usages are equivalent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{this.developer.name}}\n{{get this.developer "name"}}
\n
\n
\n \n

If there were several facts about a person, the {{get}} helper can dynamically\npick one:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<DeveloperDetail @factName="language" />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.developer @factName}}
\n
\n
\n \n

For a more complex example, this template would allow the user to switch\nbetween showing the user's height and weight with a click:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n\n  @tracked currentFact = 'name'\n\n  @action\n  showFact(fact) {\n    this.currentFact = fact;\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
{{get this.developer this.currentFact}}\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

The {{get}} helper can also respect mutable values itself. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
<Input @value={{mut (get this.person this.currentFact)}} />\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

Would allow the user to swap what fact is being displayed, and also edit\nthat fact via a two-way mutable binding.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "get", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/hash.ts", + "line": 5, + "description": "

Use the {{hash}} helper to create a hash to pass as an option to your\ncomponents. This is specially useful for contextual components where you can\njust yield a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{yield (hash\n   name='Sarah'\n   title=office\n)}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ name: 'Sarah', title: this.get('office') }
\n
\n
\n \n

Where the title is bound to updates of the office property.

\n

Note that the hash is an empty object with no prototype chain, therefore\ncommon methods like toString are not available in the resulting hash.\nIf you need to use such a method, you can use the call or apply\napproach:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
function toString(obj) {\n  return Object.prototype.toString.apply(obj);\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "Hash", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 5, + "description": "

The if helper allows you to conditionally render one of two branches,\ndepending on the "truthiness" of a property.\nFor example the following values are all falsey: false, undefined, null, "", 0, NaN or an empty array.

\n

This helper has two forms, block and inline.

\n

Block form

\n

You can use the block form of if to conditionally render a section of the template.

\n

To use it, pass the conditional value to the if helper,\nusing the block form to wrap the section of template you want to conditionally render.\nLike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n
{{! will not render because greeting is undefined}}\n{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{/if}}
\n
\n
\n \n

You can also define what to show if the property is falsey by using\nthe else helper.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n
{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{else}}\n  No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

You are also able to combine else and if helpers to create more complex\nconditional logic.

\n

For the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if @isRaining}}\n Yes, grab an umbrella!\n{{else if @isCold}}\n Grab a coat, it's chilly!\n{{else}}\n No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

If you call it by saying isCold is true:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather @isCold={{true}} />
\n
\n
\n \n

Then Grab a coat, it's chilly! will be rendered.

\n

Inline form

\n

The inline if helper conditionally renders a single property or string.

\n

In this form, the if helper receives three arguments, the conditional value,\nthe value to render when truthy, and the value to render when falsey.

\n

For example, if useLongGreeting is truthy, the following:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{true}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{if @useLongGreeting "Hello" "Hi"}} Alex
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hello Alex
\n
\n
\n \n

One detail to keep in mind is that both branches of the if helper will be evaluated,\nso if you have {{if condition "foo" (expensive-operation "bar"),\nexpensive-operation will always calculate.

\n", + "itemtype": "method", + "name": "if", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 97, + "description": "

The unless helper is the inverse of the if helper. It displays if a value\nis falsey ("not true" or "is false"). Example values that will display with\nunless: false, undefined, null, "", 0, NaN or an empty array.

\n

Inline form

\n

The inline unless helper conditionally renders a single property or string.\nThis helper acts like a ternary operator. If the first property is falsy,\nthe second argument will be displayed, otherwise, the third argument will be\ndisplayed

\n

For example, if you pass a falsey useLongGreeting to the Greeting component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{false}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{unless @useLongGreeting "Hi" "Hello"}} Ben
\n
\n
\n \n

Then it will display:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hi Ben
\n
\n
\n \n

Block form

\n

Like the if helper, the unless helper also has a block form.

\n

The following will not render anything:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n2\n3\n
{{#unless @greeting}}\n  No greeting was found. Why not set one?\n{{/unless}}
\n
\n
\n \n

You can also use an else helper with the unless block. The\nelse will display if the value is truthy.

\n

If you have the following component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
in.hbs
1\n2\n3\n4\n5\n
{{#unless @userData}}\n  Please login.\n{{else}}\n  Welcome back!\n{{/unless}}
\n
\n
\n \n

Calling it with a truthy userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{hash username="Zoey"}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Welcome back!
\n
\n
\n \n

and calling it with a falsey userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{false}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Please login.
\n
\n
\n \n", + "itemtype": "method", + "name": "unless", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/log.ts", + "line": 5, + "description": "

log allows you to output the value of variables in the current rendering\ncontext. log also accepts primitive types such as strings or numbers.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{log "myVariable:" myVariable }}
\n
\n
\n \n", + "itemtype": "method", + "name": "log", + "params": [ + { + "name": "params", + "description": "", + "type": "Array" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/mut.ts", + "line": 9, + "description": "

The mut helper lets you clearly specify that a child Component can update the\n(mutable) value passed to it, which will change the value of the parent component.

\n

To specify that a parameter is mutable, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{fn (mut totalClicks)}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(mut totalClicks)}}
\n
\n
\n \n

The child Component can then modify the parent's value just by modifying its own\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

Note that for curly components ({{my-component}}) the bindings are already mutable,\nmaking the mut unnecessary.

\n

Additionally, the mut helper can be combined with the fn helper to\nmutate a value. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=totalClicks click-count-change=(fn (mut totalClicks))}}
\n
\n
\n \n

The child Component would invoke the function with the new click value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.get('click-count-change')(this.get('childClickCount') + 1);\n  }\n});
\n
\n
\n \n

The mut helper changes the totalClicks value to what was provided as the fn argument.

\n

The mut helper, when used with fn, will return a function that\nsets the value passed to mut to its first argument. As an example, we can create a\nbutton that increments a value passing the value directly to the fn:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{! inc helper is not provided by Ember }}\n<button onclick={{fn (mut count) (inc count)}}>\n  Increment count\n</button>
\n
\n
\n \n", + "itemtype": "method", + "name": "mut", + "params": [ + { + "name": "attr", + "description": "the \"two-way\" attribute that can be modified.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/page-title.ts", + "line": 5, + "description": "

page-title allows you to set the title of any page in your application and\nappend additional titles for each route. For complete documentation, see\nhttps://github.com/ember-cli/ember-page-title.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{page-title "My Page Title" }}
\n
\n
\n \n", + "itemtype": "method", + "name": "page-title", + "params": [ + { + "name": "param", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/readonly.ts", + "line": 8, + "description": "

The readonly helper let's you specify that a binding is one-way only,\ninstead of two-way.\nWhen you pass a readonly binding from an outer context (e.g. parent component),\nto to an inner context (e.g. child component), you are saying that changing that\nproperty in the inner context does not change the value in the outer context.

\n

To specify that a binding is read-only, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n
export default Component.extend({\n  totalClicks: 3\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} // -> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Now, when you update childClickCount:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n
export default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

The value updates in the child component, but not the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClickCount}} //-> 4
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Objects and Arrays

\n

When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string),\nonly the reference to the object is protected using the readonly helper.\nThis means that you can change properties of the object both on the parent component, as well as the child component.\nThe readonly binding behaves similar to the const keyword in JavaScript.

\n

Let's look at an example:

\n

First let's set up the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  clicks: null,\n\n  init() {\n    this._super(...arguments);\n    this.set('clicks', { total: 3 });\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n

Now, if you update the total property of childClicks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    this.get('clicks').incrementProperty('total');\n  }\n});
\n
\n
\n \n

You will see the following happen:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClicks.total}} //-> 4
\n
\n
\n \n", + "itemtype": "method", + "name": "readonly", + "params": [ + { + "name": "attr", + "description": "the read-only attribute.", + "type": "Object", + "optional": true + } + ], + "access": "private", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unbound.ts", + "line": 10, + "description": "

The {{unbound}} helper disconnects the one-way binding of a property,\nessentially freezing its value at the moment of rendering. For example,\nin this example the display of the variable name will not change even\nif it is set with a new value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{unbound this.name}}
\n
\n
\n \n

Like any helper, the unbound helper can accept a nested helper expression.\nThis allows for custom helpers to be rendered unbound:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{unbound (some-custom-helper)}}\n{{unbound (capitalize this.name)}}\n{{! You can use any helper, including unbound, in a nested expression }}\n{{capitalize (unbound this.name)}}
\n
\n
\n \n

The unbound helper only accepts a single argument, and it return an\nunbound value.

\n", + "itemtype": "method", + "name": "unbound", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/modifiers/on.ts", + "line": 5, + "description": "

The {{on}} modifier lets you easily add event listeners (it uses\nEventTarget.addEventListener\ninternally).

\n

For example, if you'd like to run a function on your component when a <button>\nin the components template is clicked you might do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' this.saveLike}}>Like this post!</button>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class LikePostComponent extends Component {\n  @action\n  saveLike() {\n    // someone likes your post!\n    // better send a request off to your server...\n  }\n}
\n
\n
\n \n

Arguments

\n

{{on}} accepts two positional arguments, and a few named arguments.

\n

The positional arguments are:

\n
    \n
  • event -- the name to use when calling addEventListener
  • \n
  • callback -- the function to be passed to addEventListener
  • \n
\n

The named arguments are:

\n
    \n
  • capture -- a true value indicates that events of this type will be dispatched\nto the registered listener before being dispatched to any EventTarget beneath it\nin the DOM tree.
  • \n
  • once -- indicates that the listener should be invoked at most once after being\nadded. If true, the listener would be automatically removed when invoked.
  • \n
  • passive -- if true, indicates that the function specified by listener will never\ncall preventDefault(). If a passive listener does call preventDefault(), the user\nagent will do nothing other than generate a console warning. See\nImproving scrolling performance with passive listeners\nto learn more.
  • \n
\n

The callback function passed to {{on}} will receive any arguments that are passed\nto the event handler. Most commonly this would be the event itself.

\n

If you would like to pass additional arguments to the function you should use\nthe {{fn}} helper.

\n

For example, in our example case above if you'd like to pass in the post that\nwas being liked when the button is clicked you could do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' (fn this.saveLike @post)}}>Like this post!</button>
\n
\n
\n \n

In this case, the saveLike function will receive two arguments: the click event\nand the value of @post.

\n

Function Context

\n

In the example above, we used @action to ensure that likePost is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class LikePostComponent extends Component {\n  saveLike() {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when the button is clicked saveLike will be invoked,\nit will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into on!

\n", + "itemtype": "method", + "name": "on", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/in-element.ts", + "line": 5, + "description": "

The in-element helper renders its block content outside of the regular flow,\ninto a DOM element given by its destinationElement positional argument.

\n

Common use cases - often referred to as "portals" or "wormholes" - are rendering\ndropdowns, modals or tooltips close to the root of the page to bypass CSS overflow\nrules, or to render content to parts of the page that are outside of the control\nof the Ember app itself (e.g. embedded into a static or server rendered HTML page).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#in-element this.destinationElement}}\n  <div>Some content</div>\n{{/in-element}}
\n
\n
\n \n

Arguments

\n

{{in-element}} requires a single positional argument:

\n
    \n
  • destinationElement -- the DOM element to render into. It must exist at the time\nof rendering.
  • \n
\n

It also supports an optional named argument:

\n
    \n
  • insertBefore -- by default the DOM element's content is replaced when used as\ndestinationElement. Passing null changes the behaviour to appended at the end\nof any existing content. Any other value than null is currently not supported.
  • \n
\n", + "itemtype": "method", + "name": "in-element", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/let.ts", + "line": 5, + "description": "

The let helper receives one or more positional arguments and yields\nthem out as block params.

\n

This allows the developer to introduce shorter names for certain computations\nin the template.

\n

This is especially useful if you are passing properties to a component\nthat receives a lot of options and you want to clean up the invocation.

\n

For the following example, the template receives a post object with\ncontent and title properties.

\n

We are going to call the my-post component, passing a title which is\nthe title of the post suffixed with the name of the blog, the content\nof the post, and a series of options defined in-place.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n    (concat post.title ' | The Ember.js Blog')\n    post.content\n    (hash\n      theme="high-contrast"\n      enableComments=true\n    )\n    as |title content options|\n}}\n  <MyPost @title={{title}} @content={{content}} @options={{options}} />\n{{/let}}
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n  (concat post.title ' | The Ember.js Blog')\n  post.content\n  (hash\n    theme="high-contrast"\n    enableComments=true\n  )\n  as |title content options|\n}}\n{{my-post title=title content=content options=options}}\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "let", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/mount.ts", + "line": 13, + "description": "

The {{mount}} helper lets you embed a routeless engine in a template.\nMounting an engine will cause an instance to be booted and its application\ntemplate to be rendered.

\n

For example, the following template mounts the ember-chat engine:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! application.hbs }}\n{{mount "ember-chat"}}
\n
\n
\n \n

Additionally, you can also pass in a model argument that will be\nset as the engines model. This can be an existing object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div>\n  {{mount 'admin' model=userSettings}}\n</div>
\n
\n
\n \n

Or an inline hash, and you can even pass components:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>\n  <h1>Application template!</h1>\n  {{mount 'admin' model=(hash\n      title='Secret Admin'\n      signInButton=(component 'sign-in-button')\n  )}}\n</div>
\n
\n
\n \n", + "itemtype": "method", + "name": "mount", + "params": [ + { + "name": "name", + "description": "Name of the engine to mount.", + "type": "String" + }, + { + "name": "model", + "description": "Object that will be set as\n the model of the engine.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/outlet.ts", + "line": 20, + "description": "

The {{outlet}} helper lets you specify where a child route will render in\nyour template. An important use of the {{outlet}} helper is in your\napplication's application.hbs file:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n7\n8\n
<MyHeader />\n\n<div class="my-dynamic-content">\n  <!-- this content will change based on the current route, which depends on the current URL -->\n  {{outlet}}\n</div>\n\n<MyFooter />
\n
\n
\n \n

See the routing guide for more\ninformation on how your route interacts with the {{outlet}} helper.\nNote: Your content will not render if there isn't an {{outlet}} for it.

\n", + "itemtype": "method", + "name": "outlet", + "params": [ + { + "name": "name", + "description": "", + "type": "String", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 91, + "description": "

{{yield}} denotes an area of a template that will be rendered inside\nof another template.

\n

Use with Component

\n

When designing components {{yield}} is used to denote where, inside the component's\ntemplate, an optional block passed to the component should render:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<LabeledTextfield @value={{@model.name}}>\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<label>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n

Additionally you can yield properties into the context for use by the consumer:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n
<LabeledTextfield @value={{@model.validation}} @validator={{this.firstNameValidator}} as |validationError|>\n  {{#if validationError}}\n    <p class="error">{{validationError}}</p>\n  {{/if}}\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield this.validationError}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<label>\n  <p class="error">First Name must be at least 3 characters long.</p>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n", + "itemtype": "method", + "name": "yield", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "return": { + "description": "HTML string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 152, + "description": "

{{(has-block)}} indicates if the component was invoked with a block.

\n

This component is invoked with a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component}}
\n
\n
\n \n

Using angle bracket invocation, this looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent>Hi Jen!</MyComponent> {{! with a block}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent/> {{! without a block}}
\n
\n
\n \n

This is useful when you want to create a component that can optionally take a block\nand then render a default template when it is not invoked with a block.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n
{{#if (has-block)}}\n  Welcome {{yield}}, we are happy you're here!\n{{else}}\n  Hey you! You're great!\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with a block", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 197, + "description": "

{{(has-block-params)}} indicates if the component was invoked with block params.

\n

This component is invoked with block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component as |favoriteFlavor|}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jenn!\n{{/my-component}}
\n
\n
\n \n

With angle bracket syntax, block params look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent as |favoriteFlavor|>\nHi Jen!\n</MyComponent>
\n
\n
\n \n

And without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent>\n  Hi Jen!\n</MyComponent>
\n
\n
\n \n

This is useful when you want to create a component that can render itself\ndifferently when it is not invoked with block params.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if (has-block-params)}}\n  Welcome {{yield this.favoriteFlavor}}, we're happy you're here and hope you\n  enjoy your favorite ice cream flavor.\n{{else}}\n  Welcome {{yield}}, we're happy you're here, but we're unsure what\n  flavor ice cream you would enjoy.\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block-params", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with block params", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 252, + "description": "

Execute the debugger statement in the current template's context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{debugger}}
\n
\n
\n \n

When using the debugger helper you will have access to a get function. This\nfunction retrieves values available in the context of the template.\nFor example, if you're wondering why a value {{foo}} isn't rendering as\nexpected within a template, you could place a {{debugger}} statement and,\nwhen the debugger; breakpoint is hit, you can attempt to retrieve this value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('foo')
\n
\n
\n \n

get is also aware of keywords. So in this situation

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#each this.items as |item|}}\n  {{debugger}}\n{{/each}}
\n
\n
\n \n

You'll be able to get values from the current item:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('item.name')
\n
\n
\n \n

You can also access the context of the view to make sure it is the object that\nyou expect:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> context
\n
\n
\n \n", + "itemtype": "method", + "name": "debugger", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.Test-3c9dde19d1.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.Test-3c9dde19d1.json new file mode 100644 index 000000000..97649be6c --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.Test-3c9dde19d1.json @@ -0,0 +1,147 @@ +{ + "data": { + "id": "ember-4.0.1-Ember.Test", + "type": "class", + "attributes": { + "name": "Ember.Test", + "shortname": "Ember.Test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/ember-testing/lib/test.js", + "line": 11, + "description": "

This is a container for an assortment of testing related functionality:

\n
    \n
  • Choose your default test adapter (for your framework of choice).
  • \n
  • Register/Unregister additional test helpers.
  • \n
  • Setup callbacks to be fired when the test helpers are injected into\nyour application.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/ember-testing/lib/test/on_inject_helpers.js", + "line": 3, + "description": "

Used to register callbacks to be fired whenever App.injectTestHelpers\nis called.

\n

The callback will receive the current application as an argument.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import $ from 'jquery';\n\nEmber.Test.onInjectHelpers(function() {\n  $(document).ajaxSend(function() {\n    Test.pendingRequests++;\n  });\n\n  $(document).ajaxComplete(function() {\n    Test.pendingRequests--;\n  });\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "onInjectHelpers", + "params": [ + { + "name": "callback", + "description": "The function to be called.", + "type": "Function" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.js", + "line": 21, + "description": "

This returns a thenable tailored for testing. It catches failed\nonSuccess callbacks and invokes the Ember.Test.adapter.exception\ncallback in the last chained then.

\n

This method should be returned by async helpers such as wait.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "promise", + "params": [ + { + "name": "resolver", + "description": "The function used to resolve the promise.", + "type": "Function" + }, + { + "name": "label", + "description": "An optional string for identifying the promise.", + "type": "String" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.js", + "line": 39, + "description": "

Replacement for Ember.RSVP.resolve\nThe only difference is this uses\nan instance of Ember.Test.Promise

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "The", + "description": "value to resolve", + "type": "Mixed" + } + ], + "since": "1.2.0", + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/setup_for_testing.js", + "line": 8, + "description": "

Sets Ember up for testing. This is useful to perform\nbasic setup steps in order to unit test.

\n

Use App.setupForTesting to perform integration tests (full\napplication testing).

\n", + "itemtype": "method", + "name": "setupForTesting", + "since": "1.5.0", + "access": "private", + "tagname": "", + "class": "Ember.Test", + "module": "@ember/test", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/test.js", + "line": 24, + "description": "

Hash containing all known test helpers.

\n", + "itemtype": "property", + "name": "_helpers", + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/ember-testing/lib/test.js", + "line": 45, + "description": "

Used to allow ember-testing to communicate with a specific testing\nframework.

\n

You can manually set it before calling App.setupForTesting().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Ember.Test.adapter = MyCustomAdapter.create()
\n
\n
\n \n

If you do not set it, ember-testing will default to Ember.Test.QUnitAdapter.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "adapter", + "type": "{Class} The adapter to be used.", + "default": "Ember.Test.QUnitAdapter", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.ViewMixin-872625865a.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.ViewMixin-872625865a.json new file mode 100644 index 000000000..b5fb46f7d --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Ember.ViewMixin-872625865a.json @@ -0,0 +1,304 @@ +{ + "data": { + "id": "ember-4.0.1-Ember.ViewMixin", + "type": "class", + "attributes": { + "name": "Ember.ViewMixin", + "shortname": "Ember.ViewMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 422, + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 70, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 96, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 116, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 156, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 214, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 299, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 373, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 409, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 268, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 276, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 289, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 313, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 326, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 334, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 12, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 141, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 235, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 346, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-EmberArray-04735349cb.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-EmberArray-04735349cb.json new file mode 100644 index 000000000..fa7bc7583 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-EmberArray-04735349cb.json @@ -0,0 +1,836 @@ +{ + "data": { + "id": "ember-4.0.1-EmberArray", + "type": "class", + "attributes": { + "name": "EmberArray", + "shortname": "EmberArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "MutableArray" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 179, + "description": "

This mixin implements Observer-friendly Array-like behavior. It is not a\nconcrete implementation, but it can be used up by other classes that want\nto appear like arrays.

\n

For example, ArrayProxy is a concrete class that can be instantiated to\nimplement array-like behavior. This class uses the Array Mixin by way of\nthe MutableArray mixin, which allows observable changes to be made to the\nunderlying array.

\n

This mixin defines methods specifically for collections that provide\nindex-ordered access to their contents. When you are designing code that\nneeds to accept any kind of Array-like object, you should use these methods\ninstead of Array primitives because these will properly notify observers of\nchanges to the array.

\n

Although these methods are efficient, they do add a layer of indirection to\nyour application so it is a good idea to use them only when you need the\nflexibility of using both true JavaScript arrays and "virtual" arrays such\nas controllers and collections.

\n

You can use the methods defined in this module to access and modify array\ncontents in an observable-friendly way. You can also be notified whenever\nthe membership of an array changes by using .observes('myArray.[]').

\n

To support EmberArray in your own class, you must override two\nprimitives to use it: length() and objectAt().

\n", + "uses": [ + "Enumerable" + ], + "since": "Ember 0.9.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1116, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1154, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1166, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1182, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1215, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1259, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1278, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1300, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-EmberObject-20bb03115d.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-EmberObject-20bb03115d.json new file mode 100644 index 000000000..fc8b19f62 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-EmberObject-20bb03115d.json @@ -0,0 +1,596 @@ +{ + "data": { + "id": "ember-4.0.1-EmberObject", + "type": "class", + "attributes": { + "name": "EmberObject", + "shortname": "EmberObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/object.js", + "line": 13, + "description": "

EmberObject is the main base class for all Ember objects. It is a subclass\nof CoreObject with the Observable mixin applied. For details,\nsee the documentation for each of these.

\n", + "extends": "CoreObject", + "uses": [ + "Observable" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.0.1-ContainerDebugAdapter" + }, + { + "type": "class", + "id": "ember-4.0.1-DataAdapter" + }, + { + "type": "class", + "id": "ember-4.0.1-HashLocation" + }, + { + "type": "class", + "id": "ember-4.0.1-HistoryLocation" + }, + { + "type": "class", + "id": "ember-4.0.1-NoneLocation" + }, + { + "type": "class", + "id": "ember-4.0.1-Route" + }, + { + "type": "class", + "id": "ember-4.0.1-EmberRouter" + }, + { + "type": "class", + "id": "ember-4.0.1-ArrayProxy" + }, + { + "type": "class", + "id": "ember-4.0.1-Ember.Namespace" + }, + { + "type": "class", + "id": "ember-4.0.1-ObjectProxy" + }, + { + "type": "class", + "id": "ember-4.0.1-Ember.CoreView" + }, + { + "type": "class", + "id": "ember-4.0.1-Controller" + }, + { + "type": "class", + "id": "ember-4.0.1-EngineInstance" + }, + { + "type": "class", + "id": "ember-4.0.1-Service" + } + ] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-EmberRouter-1c6462909c.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-EmberRouter-1c6462909c.json new file mode 100644 index 000000000..dae52f512 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-EmberRouter-1c6462909c.json @@ -0,0 +1,1157 @@ +{ + "data": { + "id": "ember-4.0.1-EmberRouter", + "type": "class", + "attributes": { + "name": "EmberRouter", + "shortname": "EmberRouter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 126, + "description": "

The EmberRouter class manages the application state and URLs. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 203, + "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

The first parameter is the name of the route which is used by default as the\npath name as well.

\n

The 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\nsegments.
  • \n
  • resetNamespace: false by default; when nesting routes, ember will\ncombine the route names to form the fully-qualified route name, which is\nused with {{link-to}} or manually transitioning to routes. Setting\nresetNamespace: true will cause the route not to inherit from its\nparent route's names. This is handy for preventing extremely long route names.\nKeep in mind that the actual URL path behavior is still retained.
  • \n
\n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
Router.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
\n
\n \n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 525, + "description": "

Initializes the current router instance and sets up the change handling\nevent listeners used by the instances location implementation.

\n

A property named initialURL will be used to determine the initial URL.\nIf no value is found / will be used.

\n", + "itemtype": "method", + "name": "startRouting", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 647, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n

See transitionTo for more info.

\n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 704, + "description": "

Determines if the supplied route is currently active.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 716, + "description": "

An alternative form of isActive that doesn't require\nmanual concatenation of the arguments into a single\narray.

\n", + "itemtype": "method", + "name": "isActiveIntent", + "params": [ + { + "name": "routeName", + "description": "" + }, + { + "name": "models", + "description": "" + }, + { + "name": "queryParams", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 738, + "description": "

Does this router instance have the given route.

\n", + "itemtype": "method", + "name": "hasRoute", + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 749, + "description": "

Resets the state of the router by clearing the current route\nhandlers and deactivating them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 857, + "description": "

Serializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Arrray" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 884, + "description": "

Serializes the value of a query parameter based on a type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "type", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 902, + "description": "

Deserializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 927, + "description": "

Deserializes the value of a query parameter based on a default type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "defaultType", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 948, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_pruneDefaultQueryParamValues", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1030, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareQueryParams", + "params": [ + { + "name": "targetRouteName", + "description": "", + "type": "String" + }, + { + "name": "models", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + }, + { + "name": "keepDefaultQueryParamValues", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1057, + "description": "

Returns the meta information for the query params of a given route. This\nwill be overridden to allow support for lazy routes.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getQPMeta", + "params": [ + { + "name": "routeInfo", + "description": "", + "type": "RouteInfo" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1071, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_queryParamsFor", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1136, + "description": "

Maps all query param keys to their fully scoped property name of the form\ncontrollerName:propName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_fullyScopeQueryParams", + "params": [ + { + "name": "leafRouteName", + "description": "", + "type": "String" + }, + { + "name": "contexts", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1178, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_hydrateUnsuppliedQueryParams", + "params": [ + { + "name": "state", + "description": "", + "type": "TransitionState" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1341, + "description": "

Handles updating the paths and notifying any listeners of the URL\nchange.

\n

Triggers the router level didTransition hook.

\n

For example, to notify google analytics when the route changes,\nyou could use this hook. (Note: requires also including GA scripts, etc.)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import config from './config/environment';\nimport EmberRouter from '@ember/routing/router';\nimport { inject as 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
\n
\n \n", + "itemtype": "method", + "name": "didTransition", + "access": "private", + "tagname": "", + "since": "1.2.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1378, + "description": "

Handles notifying any listeners of an impending URL\nchange.

\n

Triggers the router level willTransition hook.

\n", + "itemtype": "method", + "name": "willTransition", + "access": "private", + "tagname": "", + "since": "1.11.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 54, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 80, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 101, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 124, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 139, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 136, + "description": "

Represents the URL of the root of the application, often '/'. This prefix is\n assumed on all routes defined on this router.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 147, + "description": "

The location property determines the type of URL's that your\n application will use.

\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

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1391, + "description": "

Represents the current URL.

\n", + "itemtype": "property", + "name": "url", + "type": "{String}", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Engine-64488041c4.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Engine-64488041c4.json new file mode 100644 index 000000000..d52cfcb64 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Engine-64488041c4.json @@ -0,0 +1,728 @@ +{ + "data": { + "id": "ember-4.0.1-Engine", + "type": "class", + "attributes": { + "name": "Engine", + "shortname": "Engine", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/index.js", + "line": 30, + "description": "

The Engine class contains core functionality for both applications and\nengines.

\n

Each engine manages a registry that's used for dependency injection and\nexposed through RegistryProxy.

\n

Engines also manage initializers and instance initializers.

\n

Engines can spawn EngineInstance instances via buildInstance().

\n", + "extends": "Ember.Namespace", + "uses": [ + "RegistryProxy" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/engine/index.js", + "line": 61, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 74, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 87, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 100, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 108, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 116, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 127, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 158, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 305, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 378, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 427, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Namespace" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/index.js", + "line": 53, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 418, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-Ember.Namespace", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.0.1-Application" + } + ] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-EngineInstance-bd34f43cb1.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-EngineInstance-bd34f43cb1.json new file mode 100644 index 000000000..c63c03a19 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-EngineInstance-bd34f43cb1.json @@ -0,0 +1,1002 @@ +{ + "data": { + "id": "ember-4.0.1-EngineInstance", + "type": "class", + "attributes": { + "name": "EngineInstance", + "shortname": "EngineInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/instance.js", + "line": 17, + "description": "

The EngineInstance encapsulates all of the stateful aspects of a\nrunning Engine.

\n", + "access": "public", + "tagname": "", + "extends": "EmberObject", + "uses": [ + "RegistryProxyMixin", + "ContainerProxyMixin" + ], + "methods": [ + { + "file": "packages/@ember/engine/instance.js", + "line": 62, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 124, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 139, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 167, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 200, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 18, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 31, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 101, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 124, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 134, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 145, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 155, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 165, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 198, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 208, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 23, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 49, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 110, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/instance.js", + "line": 29, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 15, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.0.1-ApplicationInstance" + } + ] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Evented-9eb749a461.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Evented-9eb749a461.json new file mode 100644 index 000000000..44188bbc5 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Evented-9eb749a461.json @@ -0,0 +1,190 @@ +{ + "data": { + "id": "ember-4.0.1-Evented", + "type": "class", + "attributes": { + "name": "Evented", + "shortname": "Evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Route", + "EmberRouter", + "Ember.CoreView" + ], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 13, + "description": "

This mixin allows for Ember objects to subscribe to and emit events.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/utils/person.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport Evented from '@ember/object/evented';\n\nexport default EmberObject.extend(Evented, {\n  greet() {\n    // ...\n    this.trigger('greet');\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
var person = Person.create();\n\nperson.on('greet', function() {\n  console.log('Our person has greeted');\n});\n\nperson.greet();\n\n// outputs: 'Our person has greeted'
\n
\n
\n \n

You can also chain multiple event subscriptions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
person.on('greet', function() {\n  console.log('Our person has greeted');\n}).one('greet', function() {\n  console.log('Offer one-time special');\n}).off('event', this, forgetThis);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 54, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 80, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 101, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 124, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 139, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-HashLocation-b21fdd13bb.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-HashLocation-b21fdd13bb.json new file mode 100644 index 000000000..ef5d656d6 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-HashLocation-b21fdd13bb.json @@ -0,0 +1,641 @@ +{ + "data": { + "id": "ember-4.0.1-HashLocation", + "type": "class", + "attributes": { + "name": "HashLocation", + "shortname": "HashLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 11, + "description": "

HashLocation implements the location API using the browser's\nhash. At present, it relies on a hashchange event existing in the\nbrowser.

\n

Using HashLocation results in URLs with a # (hash sign) separating the\nserver side URL portion of the URL from the portion that is used by Ember.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'hash'\n});
\n
\n
\n \n

This will result in a posts.new url of /#/posts/new.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 51, + "access": "private", + "tagname": "Returns normalized location.hash", + "since": "1.5.1", + "itemtype": "method", + "name": "getHash", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 63, + "description": "

Returns the normalized URL, constructed from location.hash.

\n

e.g. #/foo => /foo as well as #/foo#bar => /foo#bar.

\n

By convention, hashed paths must begin with a forward slash, otherwise they\nare not treated as a path so we can distinguish intent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 93, + "description": "

Set the location.hash and remembers what was set. This prevents\nonUpdateURL callbacks from triggering when the hash was set by\nHashLocation.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 107, + "description": "

Uses location.replace to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 122, + "description": "

Register a callback to be invoked when the hash changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 147, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 162, + "description": "

Cleans up the HashLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Helper-41053a2b49.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Helper-41053a2b49.json new file mode 100644 index 000000000..110452679 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Helper-41053a2b49.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.0.1-Helper", + "type": "class", + "attributes": { + "name": "Helper", + "shortname": "Helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 34, + "description": "

Ember Helpers are functions that can compute values, and are used in templates.\nFor example, this code calls a helper named format-currency:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Cost @cents={{230}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/cost.hbs
1\n
<div>{{format-currency @cents currency="$"}}</div>
\n
\n
\n \n

Additionally a helper can be called as a nested helper.\nIn this example, we show the formatted currency value if the showMoney\nnamed argument is truthy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{if @showMoney (format-currency @cents currency="$")}}
\n
\n
\n \n

Helpers defined using a class must provide a compute function. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n6\n7\n
import Helper from '@ember/component/helper';\n\nexport default class extends Helper {\n  compute([cents], { currency }) {\n    return `${currency}${cents * 0.01}`;\n  }\n}
\n
\n
\n \n

Each time the input to a helper changes, the compute function will be\ncalled again.

\n

As instances, these helpers also have access to the container and will accept\ninjected dependencies.

\n

Additionally, class helpers can call recompute to force a new computation.

\n", + "extends": "CoreObject", + "access": "public", + "tagname": "", + "since": "1.13.0", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 85, + "description": "

On a class-based helper, it may be useful to force a recomputation of that\nhelpers value. This is akin to rerender on a component.

\n

For example, this component will rerender when the currentUser on a\nsession service changes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
email.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Helper from '@ember/component/helper'\nimport { inject as service } from '@ember/service'\nimport { observer } from '@ember/object'\n\nexport default Helper.extend({\n  session: service(),\n\n  onNewUser: observer('session.currentUser', function() {\n    this.recompute();\n  }),\n\n  compute() {\n    return this.get('session.currentUser.email');\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "recompute", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 118, + "description": "

Override this function when writing a class-based helper.

\n", + "itemtype": "method", + "name": "compute", + "params": [ + { + "name": "params", + "description": "The positional arguments to the helper", + "type": "Array" + }, + { + "name": "hash", + "description": "The named arguments to the helper", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-HistoryLocation-973c4c79d6.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-HistoryLocation-973c4c79d6.json new file mode 100644 index 000000000..547fb3f3e --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-HistoryLocation-973c4c79d6.json @@ -0,0 +1,707 @@ +{ + "data": { + "id": "ember-4.0.1-HistoryLocation", + "type": "class", + "attributes": { + "name": "HistoryLocation", + "shortname": "HistoryLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 21, + "description": "

HistoryLocation implements the location API using the browser's\nhistory.pushState API.

\n

Using HistoryLocation results in URLs that are indistinguishable from a\nstandard URL. This relies upon the browser's history API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'history'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new.

\n

Keep in mind that your server must serve the Ember app at all the routes you\ndefine.

\n

Using HistoryLocation will also result in location states being recorded by\nthe browser history API with the following schema:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
window.history.state -> { path: '/', uuid: '3552e730-b4a6-46bd-b8bf-d8c3c1a97e0a' }
\n
\n
\n \n

This allows each in-app location state to be tracked uniquely across history\nstate changes via the uuid field.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 79, + "access": "private", + "tagname": "Returns normalized location.hash", + "itemtype": "method", + "name": "getHash", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 105, + "description": "

Used to set state on first call to setURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initState", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 126, + "description": "

Returns the current location.pathname without rootURL or baseURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 153, + "description": "

Uses history.pushState to update the url without a page reload.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 169, + "description": "

Uses history.replaceState to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 186, + "description": "

Pushes a new state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "pushState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 202, + "description": "

Replaces the current state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 218, + "description": "

Register a callback to be invoked whenever the browser\nhistory changes, including using forward and back buttons.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 243, + "description": "

Used when using {{action}} helper. The url is always appended to the rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "formatted url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 267, + "description": "

Cleans up the HistoryLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 71, + "description": "

Will be pre-pended to path upon state change

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Location-3b07fc6af3.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Location-3b07fc6af3.json new file mode 100644 index 000000000..77448cccd --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Location-3b07fc6af3.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.0.1-Location", + "type": "class", + "attributes": { + "name": "Location", + "shortname": "Location", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/api.ts", + "line": 21, + "description": "

Location returns an instance of the correct implementation of\nthe location API.

\n

Implementations

\n

You can pass an implementation name (hash, history, none, auto) to force a\nparticular implementation to be used in your application.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n

Location API

\n

Each location implementation must provide the following methods:

\n
    \n
  • implementation: returns the string name used to reference the implementation.
  • \n
  • getURL: returns the current URL.
  • \n
  • setURL(path): sets the current URL.
  • \n
  • replaceURL(path): replace the current URL (optional).
  • \n
  • onUpdateURL(callback): triggers the callback when the URL changes.
  • \n
  • formatURL(url): formats url to be placed into href attribute.
  • \n
  • detect() (optional): instructs the location to do any feature detection\n necessary. If the location needs to redirect to a different URL, it\n can cancel routing by setting the cancelRouterSetup property on itself\n to false.
  • \n
\n

Calling setURL or replaceURL will not trigger onUpdateURL callbacks.

\n

Custom implementation

\n

Ember scans app/locations/* for extending the Location API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import HistoryLocation from '@ember/routing/history-location';\n\nexport default class MyHistory {\n  implementation = 'my-custom-history';\n\n  constructor() {\n    this._history = HistoryLocation.create(...arguments);\n  }\n\n  create() {\n    return new this(...arguments);\n  }\n\n  pushState(path) {\n     this._history.pushState(path);\n  }\n}
\n
\n
\n \n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/api.ts", + "line": 82, + "description": "

This is deprecated in favor of using the container to lookup the location\nimplementation as desired.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
// Given a location registered as follows:\ncontainer.register('location:history-test', HistoryTestLocation);\n\n// You could create a new instance via:\ncontainer.lookup('location:history-test');
\n
\n
\n \n", + "itemtype": "method", + "name": "create", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "an instance of an implementation of the `location` API", + "type": "Object" + }, + "deprecated": true, + "deprecationMessage": "Use the container to lookup the location implementation that you\n need.", + "access": "private", + "tagname": "", + "class": "Location", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Mixin-7f8a6cdc1e.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Mixin-7f8a6cdc1e.json new file mode 100644 index 000000000..2aa6c3d34 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Mixin-7f8a6cdc1e.json @@ -0,0 +1,75 @@ +{ + "data": { + "id": "ember-4.0.1-Mixin", + "type": "class", + "attributes": { + "name": "Mixin", + "shortname": "Mixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 444, + "description": "

The Mixin class allows you to create mixins, whose properties can be\nadded to other classes. For instance,

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nconst EditableMixin = Mixin.create({\n  edit() {\n    console.log('starting to edit');\n    this.set('isEditing', true);\n  },\n  isEditing: false\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import EmberObject from '@ember/object';\nimport EditableMixin from '../mixins/editable';\n\n// Mix mixins into classes by passing them as the first arguments to\n// `.extend.`\nconst Comment = EmberObject.extend(EditableMixin, {\n  post: null\n});\n\nlet comment = Comment.create({\n  post: somePost\n});\n\ncomment.edit(); // outputs 'starting to edit'
\n
\n
\n \n

Note that Mixins are created with Mixin.create, not\nMixin.extend.

\n

Note that mixins extend a constructor's prototype so arrays and object literals\ndefined as properties will be shared amongst objects that implement the mixin.\nIf you want to define a property in a mixin that is not shared, you can define\nit either as a computed property or have it be created on initialization of the object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
// filters array will be shared amongst any object implementing mixin\nimport Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\nconst FilterableMixin = Mixin.create({\n  filters: A()\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\nimport { computed } from '@ember/object';\n\n// filters will be a separate array for every object implementing the mixin\nconst FilterableMixin = Mixin.create({\n  filters: computed(function() {\n    return A();\n  })\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\n// filters will be created as a separate array during the object's initialization\nconst Filterable = Mixin.create({\n  filters: null,\n\n  init() {\n    this._super(...arguments);\n    this.set("filters", A());\n  }\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 430, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Mixin", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.0.1-Ember.TargetActionSupport" + } + ] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-MutableArray-6a3cbd8f15.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-MutableArray-6a3cbd8f15.json new file mode 100644 index 000000000..5cb638faa --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-MutableArray-6a3cbd8f15.json @@ -0,0 +1,1239 @@ +{ + "data": { + "id": "ember-4.0.1-MutableArray", + "type": "class", + "attributes": { + "name": "MutableArray", + "shortname": "MutableArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "ArrayProxy" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1326, + "description": "

This mixin defines the API for modifying array-like objects. These methods\ncan be applied only to a collection that keeps its items in an ordered set.\nIt builds upon the Array mixin and adds methods to modify the array.\nOne concrete implementations of this class include ArrayProxy.

\n

It is important to use the methods in this class to modify arrays so that\nchanges are observable. This allows the binding system in Ember to function\ncorrectly.

\n

Note that an Array can change even if it does not implement this mixin.\nFor example, one might implement a SparseArray that cannot be directly\nmodified, but if its underlying enumerable changes, it will change also.

\n", + "uses": [ + "MutableEnumerable", + "EmberArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1348, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray" + } + ], + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1367, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1393, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1415, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1440, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1460, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1480, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1506, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1531, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1551, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumberable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1572, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1591, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1618, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1646, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1663, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1689, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1116, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1154, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1166, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1182, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1215, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1259, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1278, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1300, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-NoneLocation-aa8c0b0355.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-NoneLocation-aa8c0b0355.json new file mode 100644 index 000000000..740cecac4 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-NoneLocation-aa8c0b0355.json @@ -0,0 +1,639 @@ +{ + "data": { + "id": "ember-4.0.1-NoneLocation", + "type": "class", + "attributes": { + "name": "NoneLocation", + "shortname": "NoneLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 10, + "description": "

NoneLocation does not interact with the browser. It is useful for\ntesting, or when you need to manage state with your Router, but temporarily\ndon't want it to muck with the URL (for example when you embed your\napplication in a larger page).

\n

Using NoneLocation causes Ember to not store the applications URL state\nin the actual URL. This is generally used for testing purposes, and is one\nof the changes made when calling App.setupForTesting().

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 50, + "description": "

Returns the current path without rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "path", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 67, + "description": "

Set the path and remembers what was set. Using this method\nto change the path will not invoke the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 79, + "description": "

Register a callback to be invoked when the path changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 92, + "description": "

Sets the path and calls the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "handleURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 104, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 31, + "description": "

Will be pre-pended to path.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-ObjectProxy-e08d2e0204.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-ObjectProxy-e08d2e0204.json new file mode 100644 index 000000000..b80d6e5af --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-ObjectProxy-e08d2e0204.json @@ -0,0 +1,555 @@ +{ + "data": { + "id": "ember-4.0.1-ObjectProxy", + "type": "class", + "attributes": { + "name": "ObjectProxy", + "shortname": "ObjectProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/object_proxy.js", + "line": 4, + "description": "

ObjectProxy forwards all properties not defined by the proxy itself\nto a proxied content object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nlet exampleObject = EmberObject.create({\n  name: 'Foo'\n});\n\nlet exampleProxy = ObjectProxy.create({\n  content: exampleObject\n});\n\n// Access and change existing properties\nexampleProxy.get('name');          // 'Foo'\nexampleProxy.set('name', 'Bar');\nexampleObject.get('name');         // 'Bar'\n\n// Create new 'description' property on `exampleObject`\nexampleProxy.set('description', 'Foo is a whizboo baz');\nexampleObject.get('description');  // 'Foo is a whizboo baz'
\n
\n
\n \n

While content is unset, setting a property to be delegated will throw an\nError.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import ObjectProxy from '@ember/object/proxy';\n\nlet exampleProxy = ObjectProxy.create({\n  content: null,\n  flag: null\n});\nexampleProxy.set('flag', true);\nexampleProxy.get('flag');         // true\nexampleProxy.get('foo');          // undefined\nexampleProxy.set('foo', 'data');  // throws Error
\n
\n
\n \n

Delegated properties can be bound to and will change when content is updated.

\n

Computed properties on the proxy itself can depend on delegated properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { computed } from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nProxyWithComputedProperty = ObjectProxy.extend({\n  fullName: computed('firstName', 'lastName', function() {\n    var firstName = this.get('firstName'),\n        lastName = this.get('lastName');\n    if (firstName && lastName) {\n      return firstName + ' ' + lastName;\n    }\n    return firstName || lastName;\n  })\n});\n\nlet exampleProxy = ProxyWithComputedProperty.create();\n\nexampleProxy.get('fullName');  // undefined\nexampleProxy.set('content', {\n  firstName: 'Tom', lastName: 'Dale'\n}); // triggers property change for fullName on proxy\n\nexampleProxy.get('fullName');  // 'Tom Dale'
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "Ember.ProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.js", + "line": 64, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Observable-9181bd1ee5.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Observable-9181bd1ee5.json new file mode 100644 index 000000000..3875325f2 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Observable-9181bd1ee5.json @@ -0,0 +1,388 @@ +{ + "data": { + "id": "ember-4.0.1-Observable", + "type": "class", + "attributes": { + "name": "Observable", + "shortname": "Observable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "EmberObject" + ], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 21, + "description": "

Overview

\n

This mixin provides properties and property observing functionality, core\nfeatures of the Ember object model.

\n

Properties and observers allow one object to observe changes to a\nproperty on another object. This is one of the fundamental ways that\nmodels, controllers and views communicate with each other in an Ember\napplication.

\n

Any object that has this mixin applied can be used in observer\noperations. That includes EmberObject and most objects you will\ninteract with as you write your Ember application.

\n

Note that you will not generally apply this mixin to classes yourself,\nbut you will use the features provided by this module frequently, so it\nis important to understand how to use it.

\n

Using get() and set()

\n

Because of Ember's support for bindings and observers, you will always\naccess properties using the get method, and set properties using the\nset method. This allows the observing objects to be notified and\ncomputed properties to be handled properly.

\n

More documentation about get and set are below.

\n

Observing Property Changes

\n

You typically observe property changes simply by using the observer\nfunction in classes that you write.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { observer } from '@ember/object';\nimport EmberObject from '@ember/object';\n\nEmberObject.extend({\n  valueObserver: observer('value', function(sender, key, value, rev) {\n    // Executes whenever the "value" property changes\n    // See the addObserver method for more information about the callback arguments\n  })\n});
\n
\n
\n \n

Although this is the most common way to add an observer, this capability\nis actually built into the EmberObject class on top of two methods\ndefined in this mixin: addObserver and removeObserver. You can use\nthese two methods to add and remove observers yourself if you need to\ndo so at runtime.

\n

To add an observer for a property, call:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
object.addObserver('propertyKey', targetObject, targetAction)
\n
\n
\n \n

This will call the targetAction method on the targetObject whenever\nthe value of the propertyKey changes.

\n

Note that if propertyKey is a computed property, the observer will be\ncalled when any of the property dependencies are changed, even if the\nresulting value of the computed property is unchanged. This is necessary\nbecause computed properties are not computed until get is called.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Promise-54b7f198b8.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Promise-8901bae337.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Promise-54b7f198b8.json rename to json-docs/ember/4.0.1/classes/ember-4.0.1-Promise-8901bae337.json index 700d75751..72f482248 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Promise-54b7f198b8.json +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Promise-8901bae337.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Promise", + "id": "ember-4.0.1-Promise", "type": "class", "attributes": { "name": "Promise", @@ -231,13 +231,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-rsvp", + "id": "ember-4.0.1-rsvp", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.0.1", "type": "project-version" } } diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-PromiseProxyMixin-900b54daf3.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-PromiseProxyMixin-900b54daf3.json new file mode 100644 index 000000000..0d4a91ac4 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-PromiseProxyMixin-900b54daf3.json @@ -0,0 +1,186 @@ +{ + "data": { + "id": "ember-4.0.1-PromiseProxyMixin", + "type": "class", + "attributes": { + "name": "PromiseProxyMixin", + "shortname": "PromiseProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 37, + "description": "

A low level mixin making ObjectProxy promise-aware.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { resolve } from 'rsvp';\nimport $ from 'jquery';\nimport ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nlet ObjectPromiseProxy = ObjectProxy.extend(PromiseProxyMixin);\n\nlet proxy = ObjectPromiseProxy.create({\n  promise: resolve($.getJSON('/some/remote/data.json'))\n});\n\nproxy.then(function(json){\n   // the json\n}, function(reason) {\n   // the reason why you have no json\n});
\n
\n
\n \n

the proxy has bindable attributes which\ntrack the promises life cycle

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> true\nproxy.get('isSettled')  //=> false\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> false
\n
\n
\n \n

When the $.getJSON completes, and the promise is fulfilled\nwith json, the life cycle attributes will update accordingly.\nNote that $.getJSON doesn't return an ECMA specified promise,\nit is useful to wrap this with an RSVP.resolve so that it behaves\nas a spec compliant promise.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> false\nproxy.get('isSettled')   //=> true\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> true
\n
\n
\n \n

As the proxy is an ObjectProxy, and the json now its content,\nall the json properties will be available directly from the proxy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// Assuming the following json:\n{\n  firstName: 'Stefan',\n  lastName: 'Penner'\n}\n\n// both properties will accessible on the proxy\nproxy.get('firstName') //=> 'Stefan'\nproxy.get('lastName')  //=> 'Penner'
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 180, + "description": "

An alias to the proxied promise's then.

\n

See RSVP.Promise.then.

\n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 192, + "description": "

An alias to the proxied promise's catch.

\n

See RSVP.Promise.catch.

\n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 205, + "description": "

An alias to the proxied promise's finally.

\n

See RSVP.Promise.finally.

\n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 101, + "description": "

If the proxied promise is rejected this will contain the reason\nprovided.

\n", + "itemtype": "property", + "name": "reason", + "default": "null", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 111, + "description": "

Once the proxied promise has settled this will become false.

\n", + "itemtype": "property", + "name": "isPending", + "default": "true", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 122, + "description": "

Once the proxied promise has settled this will become true.

\n", + "itemtype": "property", + "name": "isSettled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 133, + "description": "

Will become true if the proxied promise is rejected.

\n", + "itemtype": "property", + "name": "isRejected", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 142, + "description": "

Will become true if the proxied promise is fulfilled.

\n", + "itemtype": "property", + "name": "isFulfilled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 151, + "description": "

The promise whose fulfillment value is being proxied by this object.

\n

This property must be specified upon creation, and should not be\nchanged once created.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nObjectProxy.extend(PromiseProxyMixin).create({\n  promise: <thenable>\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "promise", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Registry-aa9246bf5a.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Registry-aa9246bf5a.json new file mode 100644 index 000000000..9089c7e43 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Registry-aa9246bf5a.json @@ -0,0 +1,421 @@ +{ + "data": { + "id": "ember-4.0.1-Registry", + "type": "class", + "attributes": { + "name": "Registry", + "shortname": "Registry", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 65, + "description": "

A registry used to store factory and option information keyed\nby type.

\n

A Registry stores the factory and option information needed by a\nContainer to instantiate and cache objects.

\n

The API for Registry is still in flux and should not be considered stable.

\n", + "access": "private", + "tagname": "", + "since": "1.11.0", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 154, + "description": "

Creates a container based on this registry.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "container", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "created container", + "type": "Container" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 166, + "description": "

Registers a factory for later injection.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let registry = new Registry();\n\nregistry.register('model:user', Person, {singleton: false });\nregistry.register('fruit:favorite', Orange);\nregistry.register('communication:main', Email, {singleton: false});
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "factory", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 200, + "description": "

Unregister a fullName

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.register('model:user', User);\n\nregistry.resolve('model:user').create() instanceof User //=> true\n\nregistry.unregister('model:user')\nregistry.resolve('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 230, + "description": "

Given a fullName return the corresponding factory.

\n

By default resolve will retrieve the factory from\nthe registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let registry = new Registry();\nregistry.register('api:twitter', Twitter);\n\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n

Optionally the registry can be provided with a custom resolver.\nIf provided, resolve will first provide the custom resolver\nthe opportunity to resolve the fullName, otherwise it will fallback\nto the registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.resolver = function(fullName) {\n   // lookup via the module system of choice\n };\n\n// the twitter factory is added to the module system\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "the fullname of the request source (used for local lookups)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 273, + "description": "

A hook that can be used to describe how the resolver will\nattempt to find the factory.

\n

For example, the default Ember .describe returns the full\nclass name (including namespace) where Ember's resolver expects\nto find the fullName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "describe", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "described fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 296, + "description": "

A hook to enable custom fullName normalization behavior

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalizeFullName", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 314, + "description": "

Normalize a fullName based on the application's conventions

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalize", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 329, + "itemtype": "method", + "name": "makeToString", + "access": "private", + "tagname": "", + "params": [ + { + "name": "factory", + "description": "", + "type": "Any" + }, + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "toString function", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 347, + "description": "

Given a fullName check if the container is aware of its factory\nor singleton instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "the fullname of the request source (used for local lookups)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 366, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let registry = new Registry();\nlet container = registry.container();\n\n// if all of type `connection` must not be singletons\nregistry.optionsForType('connection', { singleton: false });\n\nregistry.register('connection:twitter', TwitterConnection);\nregistry.register('connection:facebook', FacebookConnection);\n\nlet twitter = container.lookup('connection:twitter');\nlet twitter2 = container.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = container.lookup('connection:facebook');\nlet facebook2 = container.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "optionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 407, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "options", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 478, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "knownForType", + "params": [ + { + "name": "type", + "description": "the type to iterate over", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 104, + "description": "

A backup registry for resolving registrations when no matches can be found.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "fallback", + "type": "Registry", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 112, + "description": "

An object that has a resolve method that resolves a name.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "resolver", + "type": "Resolver", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 120, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registrations", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 126, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_normalizeCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 133, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_resolveCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 140, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_options", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 147, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_typeOptions", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-RegistryProxyMixin-5199da5bad.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-RegistryProxyMixin-5199da5bad.json new file mode 100644 index 000000000..4d57fcff8 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-RegistryProxyMixin-5199da5bad.json @@ -0,0 +1,284 @@ +{ + "data": { + "id": "ember-4.0.1-RegistryProxyMixin", + "type": "class", + "attributes": { + "name": "RegistryProxyMixin", + "shortname": "RegistryProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Application", + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 8, + "description": "

RegistryProxyMixin is used to provide public access to specific\nregistry functionality.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 18, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 31, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 101, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 124, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 134, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 145, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 155, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 165, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 198, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 208, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Route-56f8777673.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Route-56f8777673.json new file mode 100644 index 000000000..f2d6adf4b --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Route-56f8777673.json @@ -0,0 +1,1704 @@ +{ + "data": { + "id": "ember-4.0.1-Route", + "type": "class", + "attributes": { + "name": "Route", + "shortname": "Route", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 84, + "description": "

The Route class is used to define individual routes. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented", + "ActionHandler" + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 308, + "description": "

Sets the name for this route, including a fully resolved name for routes\ninside engines.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_setRouteName", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 321, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_stashNames", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 361, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_updatingQPChanged", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 369, + "description": "

Returns a hash containing the parameters of an ancestor route.

\n

You may notice that this.paramsFor sometimes works when referring to a\nchild route, but this behavior should not be relied upon as only ancestor\nroutes are certain to be loaded in time.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('member', { path: ':name' }, function() {\n    this.route('interest', { path: ':interest' });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class MemberRoute extends Route {\n  queryParams = {\n    memberQp: { refreshModel: true }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member/interest.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default class MemberInterestRoute extends Route {\n  queryParams = {\n    interestQp: { refreshModel: true }\n  }\n\n  model() {\n    return this.paramsFor('member');\n  }\n}
\n
\n
\n \n

If we visit /turing/maths?memberQp=member&interestQp=interest the model for\nthe member.interest route is a hash with:

\n
    \n
  • name: turing
  • \n
  • memberQp: member
  • \n
\n", + "itemtype": "method", + "name": "paramsFor", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "return": { + "description": "hash containing the parameters of the route `name`", + "type": "Object" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 448, + "description": "

Serializes the query parameter key

\n", + "itemtype": "method", + "name": "serializeQueryParamKey", + "params": [ + { + "name": "controllerPropertyName", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 459, + "description": "

Serializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 475, + "description": "

Deserializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 500, + "description": "

A hook you can use to reset controller values either when the model\nchanges or the route is exiting.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/articles.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class ArticlesRoute extends Route {\n  resetController(controller, isExiting, transition) {\n    if (isExiting && transition.targetName !== 'error') {\n      controller.set('page', 1);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "resetController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "isExiting", + "description": "", + "type": "Boolean" + }, + { + "name": "transition", + "description": "", + "type": "Object" + } + ], + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 527, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "exit", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 538, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_internalReset", + "since": "3.6.0", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 551, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "enter", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 767, + "description": "

This hook is executed when the router completely exits this route. It is\nnot executed when the model for the route changes.

\n", + "itemtype": "method", + "name": "deactivate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 778, + "description": "

This hook is executed when the router enters the route. It is not executed\nwhen the model for the route changes.

\n", + "itemtype": "method", + "name": "activate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 789, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogPosts');\nthis.transitionTo('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('blogPost', { path:':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogComment', aPost, aComment);\nthis.transitionTo('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
this.transitionTo('/');\nthis.transitionTo('/blog/post/1/comment/13');\nthis.transitionTo('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
this.transitionTo('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\nthis.transitionTo({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceWith.

\n

Simple Transition Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n  this.route('fourOhFour', { path: '*:' });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToSecret(context) {\n    if (authorized()) {\n      this.transitionTo('secret', context);\n    } else {\n      this.transitionTo('fourOhFour');\n    }\n  }\n}
\n
\n
\n \n

Transition to a nested route

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('articles', { path: '/articles' }, function() {\n    this.route('new');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToNewArticle() {\n    this.transitionTo('articles.new');\n  }\n}
\n
\n
\n \n

Multiple Models Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n\n  this.route('breakfast', { path: ':breakfastId' }, function() {\n    this.route('cereal', { path: ':cerealId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToChocolateCereal() {\n    let cereal = { cerealId: 'ChocolateYumminess' };\n    let breakfast = { breakfastId: 'CerealAndMilk' };\n\n    this.transitionTo('breakfast.cereal', breakfast, cereal);\n  }\n}
\n
\n
\n \n

Nested Route with Query String Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('fruits', function() {\n    this.route('apples');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToApples() {\n    this.transitionTo('fruits.apples', { queryParams: { color: 'red' } });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL.", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 987, + "description": "

Perform a synchronous transition into another route without attempting\nto resolve promises, update the URL, or abort any currently active\nasynchronous transitions (i.e. regular transitions caused by\ntransitionTo or URL changes).

\n

This method is handy for performing intermediate transitions on the\nway to a final destination route, and is called internally by the\ndefault implementations of the error and loading handlers.

\n", + "itemtype": "method", + "name": "intermediateTransitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) to be used while transitioning\nto the route.", + "type": "...Object" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1009, + "description": "

Refresh the model on this route and any child routes, firing the\nbeforeModel, model, and afterModel hooks in a similar fashion\nto how routes are entered when transitioning in from other route.\nThe current route params (e.g. article_id) will be passed in\nto the respective model hooks, and if a different model is returned,\nsetupController and associated route hooks will re-fire as well.

\n

An example usage of this method is re-querying the server for the\nlatest information using the same parameters as when the route\nwas first entered.

\n

Note that this will cause model hooks to fire even on routes\nthat were provided a model object when the route was initially\nentered.

\n", + "itemtype": "method", + "name": "refresh", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1035, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionTo in all other respects. See\n'transitionTo' for additional information regarding multiple models.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/secret.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class SecretRoute Route {\n  afterModel() {\n    if (!authorized()){\n      this.replaceWith('index');\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1082, + "description": "

This hook is the entry point for router.js

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1162, + "description": "

This hook is the first of the route entry validation hooks\ncalled when an attempt is made to transition into a route\nor one of its children. It is called before model and\nafterModel, and is appropriate for cases when:

\n
    \n
  1. A decision can be made to redirect elsewhere without\nneeding to resolve the model first.
  2. \n
  3. Any async operations need to occur first before the\nmodel is attempted to be resolved.
  4. \n
\n

This hook is provided the current transition attempt\nas a parameter, which can be used to .abort() the transition,\nsave it for a later .retry(), or retrieve values set\non it from a previous hook. You can also just call\nthis.transitionTo to another route to implicitly\nabort the transition.

\n

You can return a promise from this hook to pause the\ntransition until the promise resolves (or rejects). This could\nbe useful, for instance, for retrieving async code from\nthe server that is required to enter a route.

\n", + "itemtype": "method", + "name": "beforeModel", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1196, + "description": "

This hook is called after this route's model has resolved.\nIt follows identical async/promise semantics to beforeModel\nbut is provided the route's resolved model in addition to\nthe transition, and is therefore suited to performing\nlogic that can only take place after the model has already\nresolved.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n  afterModel(posts, transition) {\n    if (posts.get('length') === 1) {\n      this.transitionTo('post.show', posts.get('firstObject'));\n    }\n  }\n}
\n
\n
\n \n

Refer to documentation for beforeModel for a description\nof transition-pausing semantics when a promise is returned\nfrom this hook.

\n", + "itemtype": "method", + "name": "afterModel", + "params": [ + { + "name": "resolvedModel", + "description": "the value returned from `model`,\n or its resolved value if it was a promise", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1233, + "description": "

A hook you can implement to optionally redirect to another route.

\n

Calling this.transitionTo from inside of the redirect hook will\nabort the current transition (into the route that has implemented redirect).

\n

redirect and afterModel behave very similarly and are\ncalled almost at the same time, but they have an important\ndistinction when calling this.transitionTo to a child route\nof the current route. From afterModel, this new transition\ninvalidates the current transition, causing beforeModel,\nmodel, and afterModel hooks to be called again. But the\nsame transition started from redirect does not invalidate\nthe current transition. In other words, by the time the redirect\nhook has been called, both the resolved model and the attempted\nentry into this route are considered fully validated.

\n", + "itemtype": "method", + "name": "redirect", + "params": [ + { + "name": "model", + "description": "the model for this route", + "type": "Object" + }, + { + "name": "transition", + "description": "the transition object associated with the current transition", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1258, + "description": "

Called when the context is changed by router.js.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "contextDidChange", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1268, + "description": "

A hook you can implement to convert the URL into the model for\nthis route.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

The model for the post route is store.findRecord('post', params.post_id).

\n

By default, if your route has a dynamic segment ending in _id:

\n
    \n
  • The model class is determined from the segment (post_id's\nclass is App.Post)
  • \n
  • The find method is called on the model class with the value of\nthe dynamic segment.
  • \n
\n

Note that for routes with dynamic segments, this hook is not always\nexecuted. If the route is entered through a transition (e.g. when\nusing the link-to Handlebars helper or the transitionTo method\nof routes), and a model context is already provided this hook\nis not called.

\n

A model context does not include a primitive string or number,\nwhich does cause the model hook to be called.

\n

Routes without dynamic segments will always execute the model hook.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
// no dynamic segment, model hook always called\nthis.transitionTo('posts');\n\n// model passed in, so model hook not called\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost);\n\n// integer passed in, model hook is called\nthis.transitionTo('post', 1);\n\n// model id passed in, model hook is called\n// useful for forcing the hook to execute\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost.id);
\n
\n
\n \n

This hook follows the asynchronous/promise semantics\ndescribed in the documentation for beforeModel. In particular,\nif a promise returned from model fails, the error will be\nhandled by the error hook on Route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model(params) {\n    return this.store.findRecord('post', params.post_id);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "model", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route. If\n a promise is returned, the transition will pause until\n the promise resolves, and the resolved value of the promise\n will be used as the model for this route.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1377, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "deserialize", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route.\n\nRouter.js hook.", + "type": "Any | Promise" + }, + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1390, + "itemtype": "method", + "name": "findModel", + "params": [ + { + "name": "type", + "description": "the model type", + "type": "String" + }, + { + "name": "value", + "description": "the value passed to find", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1401, + "description": "

A hook you can use to setup the controller for the current route.

\n

This method is called with the controller for the current route and the\nmodel supplied by the model hook.

\n

By default, the setupController hook sets the model property of\nthe controller to the specified model when it is not undefined.

\n

If you implement the setupController hook in your Route, it will\nprevent this default behavior. If you want to preserve that behavior\nwhen implementing your setupController function, make sure to call\nsuper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/photos.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PhotosRoute extends Route {\n  model() {\n    return this.store.findAll('photo');\n  }\n\n  setupController(controller, model) {\n    super.setupController(controller, model);\n\n    this.controllerFor('application').set('showingPhotos', true);\n  }\n}
\n
\n
\n \n

The provided controller will be one resolved based on the name\nof this route.

\n

If no explicit controller is defined, Ember will automatically create one.

\n

As an example, consider the router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

If you have defined a file for the post controller,\nthe framework will use it.\nIf it is not defined, a basic Controller instance would be used.

\n", + "example": [ + " Behavior of a basic Controller\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, model) {\n controller.set('model', model);\n }\n});\n```" + ], + "itemtype": "method", + "name": "setupController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "model", + "description": "", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition", + "optional": true + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1478, + "description": "

Returns the controller of the current route, or a parent (or any ancestor)\nroute in a route hierarchy.

\n

The controller instance must already have been created, either through entering the\nassociated route or using generateController.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.controllerFor('posts').set('currentPost', post);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "controllerFor", + "params": [ + { + "name": "name", + "description": "the name of the route or controller", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Controller" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1524, + "description": "

Generates a controller for a route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class Post extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.generateController('posts');\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "generateController", + "params": [ + { + "name": "name", + "description": "the name of the controller", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1551, + "description": "

Returns the resolved model of a parent (or any ancestor) route\nin a route hierarchy. During a transition, all routes\nmust resolve a model object, and if a route\nneeds access to a parent route's model in order to\nresolve a model (or just reuse the model from a parent),\nit can call this.modelFor(theNameOfParentRoute) to\nretrieve it. If the ancestor route's model was a promise,\nits resolved result is returned.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' }, function() {\n    this.route('comments');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post/comments.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostCommentsRoute extends Route {\n  model() {\n    let post = this.modelFor('post');\n\n    return post.comments;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "modelFor", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "the model object", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1622, + "description": "

this[RENDER] is used to render a template into a region of another template\n(indicated by an {{outlet}}).

\n", + "itemtype": "method", + "name": "this[RENDER]", + "params": [ + { + "name": "name", + "description": "the name of the template to render", + "type": "String" + }, + { + "name": "options", + "description": "the options", + "type": "Object", + "optional": true, + "props": [ + { + "name": "into", + "description": "the template to render into,\n referenced by name. Defaults to the parent template", + "type": "String", + "optional": true + }, + { + "name": "outlet", + "description": "the outlet inside `options.into` to render into.\n Defaults to 'main'", + "type": "String", + "optional": true + }, + { + "name": "controller", + "description": "the controller to use for this template,\n referenced by name or as a controller instance. Defaults to the Route's paired controller", + "type": "String|Object", + "optional": true + }, + { + "name": "model", + "description": "the model object to set on `options.controller`.\n Defaults to the return value of the Route's model hook", + "type": "Object", + "optional": true + } + ] + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1649, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "teardownViews", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1662, + "description": "

Allows you to produce custom metadata for the route.\nThe return value of this method will be attached to\nits corresponding RouteInfoWithAttributes object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostsIndexRoute extends Route {\n  buildRouteInfoMetadata() {\n    return { title: 'Posts Page' }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service router\n\n  constructor() {\n    super(...arguments);\n\n    this.router.on('routeDidChange', transition => {\n      document.title = transition.to.metadata.title;\n      // would update document's title to "Posts Page"\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "buildRouteInfoMetadata", + "return": { + "description": "any" + }, + "since": "3.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1907, + "description": "

Sends an action to the router, which will delegate it to the currently\nactive route hierarchy per the bubbling rules explained under actions.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  track(arg) {\n    console.log(arg, 'was clicked');\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  trackIfDebug(arg) {\n    if (debug) {\n      this.send('track', arg);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "name", + "description": "the name of the action to trigger", + "type": "String" + }, + { + "name": "args", + "description": "", + "type": "...*" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2234, + "description": "

A hook you can implement to convert the route's model into parameters\nfor the URL.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model({ post_id }) {\n    // the server returns `{ id: 12 }`\n    return fetch(`/posts/${post_id}`;\n  }\n\n  serialize(model) {\n    // this will make the URL `/posts/12`\n    return { post_id: model.id };\n  }\n}
\n
\n
\n \n

The default serialize method will insert the model's id into the\nroute's dynamic segment (in this case, :post_id) if the segment contains '_id'.\nIf the route has multiple dynamic segments or does not contain '_id', serialize\nwill return getProperties(model, params)

\n

This method is called when transitionTo is called with a context\nin order to populate the URL.

\n", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "model", + "description": "the routes model", + "type": "Object" + }, + { + "name": "params", + "description": "an Array of parameter names for the current\n route (in the example, `['post_id']`.", + "type": "Array" + } + ], + "return": { + "description": "the serialized parameters", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2335, + "description": "

This action is called when one or more query params have changed. Bubbles.

\n", + "itemtype": "method", + "name": "queryParamsDidChange", + "params": [ + { + "name": "changed", + "description": "Keys are names of query params that have changed.", + "type": "Object" + }, + { + "name": "totalPresent", + "description": "Keys are names of query params that are currently set.", + "type": "Object" + }, + { + "name": "removed", + "description": "Keys are names of query params that have been removed.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 54, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 80, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 101, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 124, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 139, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 562, + "description": "

The willTransition action 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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ContactFormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData')) {\n      this.controller.displayNavigationConfirm();\n      transition.abort();\n    }\n  }\n}
\n
\n
\n \n

You can also redirect elsewhere by calling\nthis.transitionTo('elsewhere') from within willTransition.\nNote that willTransition will not be fired for the\nredirecting transitionTo, since willTransition doesn't\nfire when there is already a transition underway. If you want\nsubsequent willTransition actions to fire for the redirecting\ntransition, you must first explicitly call\ntransition.abort().

\n

To allow the willTransition event to continue bubbling to the parent\nroute, use return true;. When the willTransition method has a\nreturn value of true then the parent route's willTransition method\nwill be fired, enabling "bubbling" behavior for the event.

\n", + "itemtype": "event", + "name": "willTransition", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 606, + "description": "

The didTransition action is fired after a transition has\nsuccessfully been completed. This occurs after the normal model\nhooks (beforeModel, model, afterModel, setupController)\nhave resolved. The didTransition action has no arguments,\nhowever, it can be useful for tracking page views or resetting\nstate on the controller.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/login.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class LoginRoute extends Route {\n  @action\n  didTransition() {\n    this.controller.get('errors.base').clear();\n    return true; // Bubble the didTransition event\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "didTransition", + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 632, + "description": "

The loading action is fired on the route when a route's model\nhook returns a promise that is not already resolved. The current\nTransition object is the first parameter and the route that\ntriggered the loading event is the second parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  loading(transition, route) {\n    let controller = this.controllerFor('foo');\n\n    // The controller may not be instantiated when initially loading\n    if (controller) {\n      controller.currentlyLoading = true;\n\n      transition.finally(function() {\n        controller.currentlyLoading = false;\n      });\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "loading", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + }, + { + "name": "route", + "description": "The route that triggered the loading event", + "type": "Route" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 666, + "description": "

When attempting to transition into a route, any of the hooks\nmay return a promise that rejects, at which point an error\naction will be fired on the partially-entered routes, allowing\nfor per-route error handling logic, or shared error handling\nlogic defined on a parent route.

\n

Here is an example of an error handler that will be invoked\nfor rejected promises from the various hooks on the route,\nas well as any unhandled errors from child routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/admin.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { reject } from 'rsvp';\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class AdminRoute extends Route {\n  beforeModel() {\n    return reject('bad things!');\n  }\n\n  @action\n  error(error, transition) {\n    // Assuming we got here due to the error in `beforeModel`,\n    // we can expect that error === "bad things!",\n    // but a promise model rejecting would also\n    // call this hook, as would any errors encountered\n    // in `afterModel`.\n\n    // The `error` hook is also provided the failed\n    // `transition`, which can be stored and later\n    // `.retry()`d if desired.\n\n    this.transitionTo('login');\n  }\n}
\n
\n
\n \n

error actions that bubble up all the way to ApplicationRoute\nwill fire a default error handler that logs the error. You can\nspecify your own global default error handler by overriding the\nerror handler on ApplicationRoute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  error(error, transition) {\n    this.controllerFor('banner').displayError(error.message);\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "error", + "params": [ + { + "name": "error", + "description": "", + "type": "Error" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 727, + "description": "

This event is triggered when the router enters the route. It is\nnot executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  collectAnalytics: on('activate', function(){\n    collectAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "activate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 747, + "description": "

This event is triggered when the router completely exits this\nroute. It is not executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  trackPageLeaveAnalytics: on('deactivate', function(){\n    trackPageLeaveAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "deactivate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 146, + "description": "

Configuration hash for this route's queryParams. The possible\nconfiguration options and their defaults are as follows\n(assuming a query param whose controller property is page):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
queryParams: {\n  page: {\n    // By default, controller query param properties don't\n    // cause a full transition when they are changed, but\n    // rather only cause the URL to update. Setting\n    // `refreshModel` to true will cause an "in-place"\n    // transition to occur, whereby the model hooks for\n    // this route (and any child routes) will re-fire, allowing\n    // you to reload models (e.g., from the server) using the\n    // updated query param values.\n    refreshModel: false,\n\n    // By default, changes to controller query param properties\n    // cause the URL to update via `pushState`, which means an\n    // item will be added to the browser's history, allowing\n    // you to use the back button to restore the app to the\n    // previous state before the query param property was changed.\n    // Setting `replace` to true will use `replaceState` (or its\n    // hash location equivalent), which causes no browser history\n    // item to be added. This options name and default value are\n    // the same as the `link-to` helper's `replace` option.\n    replace: false,\n\n    // By default, the query param URL key is the same name as\n    // the controller property name. Use `as` to specify a\n    // different URL key.\n    as: 'page'\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 192, + "description": "

The name of the template to use by default when rendering this routes\ntemplate.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/list.js
1\n2\n3\n4\n5\n
import Route from '@ember/routing/route';\n\nexport default class extends Route {\n  templateName = 'posts/list'\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n
import PostsList from '../posts/list';\n\nexport default class extends PostsList {};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/archived.js
1\n2\n3\n
import PostsList from '../posts/list';\n\nexport default class extends PostsList {};
\n
\n
\n \n", + "itemtype": "property", + "name": "templateName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 225, + "description": "

The name of the controller to associate with this route.

\n

By default, Ember will lookup a route's controller that matches the name\nof the route (i.e. posts.new). However,\nif you would like to define a specific controller to use, you can do so\nusing this property.

\n

This is useful in many ways, as the controller specified will be:

\n
    \n
  • passed to the setupController method.
  • \n
  • used as the controller for the template being rendered by the route.
  • \n
  • returned from a call to controllerFor for the route.
  • \n
\n", + "itemtype": "property", + "name": "controllerName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 248, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 279, + "description": "

The name of the route, dot-delimited.

\n

For example, a route found at app/routes/posts/post.js will have\na routeName of posts.post.

\n", + "itemtype": "property", + "name": "routeName", + "type": "String", + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 293, + "description": "

The name of the route, dot-delimited, including the engine prefix\nif applicable.

\n

For example, a route found at addon/routes/posts/post.js within an\nengine named admin will have a fullRouteName of admin.posts.post.

\n", + "itemtype": "property", + "name": "fullRouteName", + "type": "String", + "since": "2.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 352, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_activeQPChanged", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 491, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_optionsForQueryParam", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1712, + "description": "

Store property provides a hook for data persistence libraries to inject themselves.

\n

By default, this store property provides the exact same functionality previously\nin the model hook.

\n

Currently, the required interface is:

\n

store.find(modelName, findArguments)

\n", + "itemtype": "property", + "name": "store", + "type": "{Object}", + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1777, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_qp", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2304, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-RouteInfo-916bbb4624.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-RouteInfo-916bbb4624.json new file mode 100644 index 000000000..2b757e0d9 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-RouteInfo-916bbb4624.json @@ -0,0 +1,171 @@ +{ + "data": { + "id": "ember-4.0.1-RouteInfo", + "type": "class", + "attributes": { + "name": "RouteInfo", + "shortname": "RouteInfo", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 118, + "description": "

A RouteInfo is an object that contains metadata\nabout a specific route within a Transition. It is\nread-only and internally immutable. It is also not\nobservable, because a Transition instance is never\nchanged after creation.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 192, + "description": "

Allows you to traverse through the linked list\nof RouteInfos from the topmost to leafmost.\nReturns the first RouteInfo in the linked list\nfor which the callback returns true.

\n

This method is similar to the find() method\n defined in ECMAScript 2015.

\n

The callback method you provide should have the\n following signature (all parameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in\n the results, false otherwise.

\n

Note that in addition to a callback, you can also\n pass an optional target object that will be set as\n this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 129, + "description": "

The dot-separated, fully-qualified name of the\nroute, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 136, + "description": "

The final segment of the fully-qualified name of\nthe route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 143, + "description": "

The values of the route's parameters. These are the\nsame params that are received as arguments to the\nroute's model hook. Contains only the parameters\nvalid for this route, if any (params for parent or\nchild routes are not merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 153, + "description": "

The ordered list of the names of the params\nrequired for this route. It will contain the same\nstrings as Object.keys(params), but here the order\nis significant. This allows users to correctly pass\nparams into routes programmatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 163, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 169, + "description": "

Will contain the result Route#buildRouteInfoMetadata\nfor the corresponding Route.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 176, + "description": "

A reference to the parent route's RouteInfo.\nThis can be used to traverse upward to the topmost\nRouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 184, + "description": "

A reference to the child route's RouteInfo.\nThis can be used to traverse downward to the\nleafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-RouteInfoWithAttributes-8db2d159aa.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-RouteInfoWithAttributes-8db2d159aa.json new file mode 100644 index 000000000..1627aa262 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-RouteInfoWithAttributes-8db2d159aa.json @@ -0,0 +1,183 @@ +{ + "data": { + "id": "ember-4.0.1-RouteInfoWithAttributes", + "type": "class", + "attributes": { + "name": "RouteInfoWithAttributes", + "shortname": "RouteInfoWithAttributes", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 1, + "description": "

A RouteInfoWithAttributes is an object that contains\nmetadata, including the resolved value from the routes\nmodel hook. Like RouteInfo, a RouteInfoWithAttributes\nrepresents a specific route within a Transition.\nIt is read-only and internally immutable. It is also not\nobservable, because a Transition instance is never\nchanged after creation.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 84, + "description": "

Allows you to traverse through the linked list\nof RouteInfos from the topmost to leafmost.\nReturns the first RouteInfo in the linked list\nfor which the callback returns true.

\n

This method is similar to the find() method\n defined in ECMAScript 2015.

\n

The callback method you provide should have the\n following signature (all parameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in\n the results, false otherwise.

\n

Note that in addition to a callback, you can also\n pass an optional target object that will be set as\n this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 14, + "description": "

The dot-separated, fully-qualified name of the\nroute, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 21, + "description": "

The final segment of the fully-qualified name of\nthe route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 28, + "description": "

The values of the route's parameters. These are the\nsame params that are received as arguments to the\nroute's model hook. Contains only the parameters\nvalid for this route, if any (params for parent or\nchild routes are not merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 38, + "description": "

The ordered list of the names of the params\nrequired for this route. It will contain the same\nstrings as Object.keys(params), but here the order\nis significant. This allows users to correctly pass\nparams into routes programmatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 48, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 54, + "description": "

This is the resolved return value from the\nroute's model hook.

\n", + "itemtype": "property", + "name": "attributes", + "type": "Object|Array|String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 61, + "description": "

Will contain the result Route#buildRouteInfoMetadata\nfor the corresponding Route.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 68, + "description": "

A reference to the parent route's RouteInfo.\nThis can be used to traverse upward to the topmost\nRouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 76, + "description": "

A reference to the child route's RouteInfo.\nThis can be used to traverse downward to the\nleafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-RouterService-1793760d6a.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-RouterService-1793760d6a.json new file mode 100644 index 000000000..d07ba8a21 --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-RouterService-1793760d6a.json @@ -0,0 +1,831 @@ +{ + "data": { + "id": "ember-4.0.1-RouterService", + "type": "class", + "attributes": { + "name": "RouterService", + "shortname": "RouterService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 23, + "description": "

The Router service is the public API that provides access to the router.

\n

The immediate benefit of the Router service is that you can inject it into components,\ngiving them a friendly way to initiate transitions and ask questions about the current\nglobal router state.

\n

In this example, the Router service is injected into a component to initiate a transition\nto a dedicated route:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\n\nexport default class ExampleComponent extends Component {\n  @service router;\n\n  @action\n  next() {\n    this.router.transitionTo('other.route');\n  }\n}
\n
\n
\n \n

Like any service, it can also be injected into helpers, routes, etc.

\n", + "access": "public", + "tagname": "", + "extends": "Service", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 71, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n

See transitionTo for more info.

\n

Calling transitionTo from the Router service will cause default query parameter values to be included in the URL.\nThis behavior is different from calling transitionTo on a route or transitionToRoute on a controller.\nSee the Router Service RFC for more info.

\n

In the following example we use the Router service to navigate to a route with a\nspecific model from a Component in the first action, and in the second we trigger\na query-params only transition.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\n\nexport default class extends Component {\n  @service router;\n\n  @action\n  goToComments(post) {\n    this.router.transitionTo('comments', post);\n  }\n\n  @action\n  fetchMoreComments(latestComment) {\n    this.router.transitionTo({\n      queryParams: { commentsAfter: latestComment }\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 133, + "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

See replaceWith for more info.

\n

Calling 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 for more info.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class extends Route {\n  beforeModel() {\n    if (!authorized()){\n      this.replaceWith('unauthorized');\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL of the desired destination", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route i.e. an object of params to pass to the destination route", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 174, + "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

In this example, the URL for the author.books route for a given author\nis copied to the clipboard.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Component from '@glimmer/component';\nimport { inject as 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
\n \n

Just like with transitionTo and replaceWith, urlFor can also handle\nquery parameters.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import Component from '@glimmer/component';\nimport { inject as 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
\n
\n \n", + "itemtype": "method", + "name": "urlFor", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the string representing the generated URL", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 248, + "description": "

Returns true if routeName/models/queryParams is the active route, where models and queryParams are optional.\nSee model and\nqueryParams for more information about these arguments.

\n

In the following example, isActive will return true if the current route is /posts.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@glimmer/component';\nimport { inject as 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
\n \n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@glimmer/component';\nimport { inject as 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
\n \n

Where 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.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used when determining the active route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "true if the provided routeName/models/queryParams are active", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 345, + "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

See RouteInfo for more info.

\n

In the following example recognize is used to verify if a path belongs to our\napplication before transitioning to it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Component from '@ember/component';\nimport { inject as 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
\n
\n \n", + "itemtype": "method", + "name": "recognize", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 385, + "description": "

Takes a string URL and returns a promise that resolves to a\nRouteInfoWithAttributes 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.

\n", + "itemtype": "method", + "name": "recognizeAndLoad", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 487, + "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.

\n", + "itemtype": "method", + "name": "refresh", + "params": [ + { + "name": "routeName", + "description": "the route to refresh (along with all child routes)", + "type": "String", + "optional": true + } + ], + "return": { + "description": "Transition" + }, + "category": [ + "EMBER_ROUTING_ROUTER_SERVICE_REFRESH" + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 406, + "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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Route from '@ember/routing';\nimport { inject as service } from '@ember/service';\n\nexport default class extends Route {\n  @service router;\n\n  constructor() {\n    super(...arguments);\n\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
\n \n

The 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.

\n", + "itemtype": "event", + "name": "routeWillChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 442, + "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

A good example is sending some analytics when the route has transitioned:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Route from '@ember/routing';\nimport { inject as service } from '@ember/service';\n\nexport default class extends Route {\n  @service router;\n\n  constructor() {\n    super(...arguments);\n\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 \n

routeDidChange will be called after any Route's\ndidTransition\naction has been fired.\nThe updates of properties\ncurrentURL,\ncurrentRouteName\nand\ncurrentRoute\nare completed at the time routeDidChange is called.

\n", + "itemtype": "event", + "name": "routeDidChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 520, + "description": "

Name of the current route.

\n

This property represents the logical name of the route,\nwhich is comma separated.\nFor the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentRouteName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 549, + "description": "

Current URL for the application.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
This property represents the URL path for this route.\nFor the following router:
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentURL", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 577, + "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

See Location for more information.

\n

To 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\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
\n \n

The following location types are available by default:\nauto, hash, history, none.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 616, + "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

If you change the rootURL in your environment configuration\nlike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\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
\n \n

This property will return /my-root.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 645, + "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

See RouteInfo for more info.

\n

This 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

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/header.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
  import Component from '@glimmer/component';\n  import { inject as 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
\n
\n \n", + "itemtype": "property", + "name": "currentRoute", + "type": "RouteInfo", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-Service", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-Service-e7c8f43e1b.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-Service-e7c8f43e1b.json new file mode 100644 index 000000000..29740dc8c --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-Service-e7c8f43e1b.json @@ -0,0 +1,541 @@ +{ + "data": { + "id": "ember-4.0.1-Service", + "type": "class", + "attributes": { + "name": "Service", + "shortname": "Service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "file": "packages/@ember/service/index.js", + "line": 60, + "extends": "EmberObject", + "since": "1.10.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.0.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.0.1-RouterService" + } + ] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/classes/ember-4.0.1-String-24bddac681.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-String-24bddac681.json new file mode 100644 index 000000000..cd766daef --- /dev/null +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-String-24bddac681.json @@ -0,0 +1,200 @@ +{ + "data": { + "id": "ember-4.0.1-String", + "type": "class", + "attributes": { + "name": "String", + "shortname": "String", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/string", + "namespace": "", + "file": "packages/@ember/string/index.ts", + "line": 73, + "description": "

Defines string helper methods including string formatting and localization.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/string/index.ts", + "line": 80, + "description": "

Splits a string into separate units separated by spaces, eliminating any\nempty strings in the process.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { w } from '@ember/string';\n\nw("alpha beta gamma").forEach(function(key) {\n  console.log(key);\n});\n\n// > alpha\n// > beta\n// > gamma
\n
\n
\n \n", + "itemtype": "method", + "name": "w", + "params": [ + { + "name": "str", + "description": "The string to split", + "type": "String" + } + ], + "return": { + "description": "array containing the split strings", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 105, + "description": "

Converts a camelized string into all lower case separated by underscores.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { decamelize } from '@ember/string';\n\ndecamelize('innerHTML');          // 'inner_html'\ndecamelize('action_name');        // 'action_name'\ndecamelize('css-class-name');     // 'css-class-name'\ndecamelize('my favorite items');  // 'my favorite items'
\n
\n
\n \n", + "itemtype": "method", + "name": "decamelize", + "params": [ + { + "name": "str", + "description": "The string to decamelize.", + "type": "String" + } + ], + "return": { + "description": "the decamelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 126, + "description": "

Replaces underscores, spaces, or camelCase with dashes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { dasherize } from '@ember/string';\n\ndasherize('innerHTML');                // 'inner-html'\ndasherize('action_name');              // 'action-name'\ndasherize('css-class-name');           // 'css-class-name'\ndasherize('my favorite items');        // 'my-favorite-items'\ndasherize('privateDocs/ownerInvoice';  // 'private-docs/owner-invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "dasherize", + "params": [ + { + "name": "str", + "description": "The string to dasherize.", + "type": "String" + } + ], + "return": { + "description": "the dasherized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 148, + "description": "

Returns the lowerCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { camelize } from '@ember/string';\n\ncamelize('innerHTML');                   // 'innerHTML'\ncamelize('action_name');                 // 'actionName'\ncamelize('css-class-name');              // 'cssClassName'\ncamelize('my favorite items');           // 'myFavoriteItems'\ncamelize('My Favorite Items');           // 'myFavoriteItems'\ncamelize('private-docs/owner-invoice');  // 'privateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "camelize", + "params": [ + { + "name": "str", + "description": "The string to camelize.", + "type": "String" + } + ], + "return": { + "description": "the camelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 171, + "description": "

Returns the UpperCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { classify } from '@ember/string';\n\nclassify('innerHTML');                   // 'InnerHTML'\nclassify('action_name');                 // 'ActionName'\nclassify('css-class-name');              // 'CssClassName'\nclassify('my favorite items');           // 'MyFavoriteItems'\nclassify('private-docs/owner-invoice');  // 'PrivateDocs/OwnerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "classify", + "params": [ + { + "name": "str", + "description": "the string to classify", + "type": "String" + } + ], + "return": { + "description": "the classified string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 193, + "description": "

More general than decamelize. Returns the lower_case_and_underscored\nform of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { underscore } from '@ember/string';\n\nunderscore('innerHTML');                 // 'inner_html'\nunderscore('action_name');               // 'action_name'\nunderscore('css-class-name');            // 'css_class_name'\nunderscore('my favorite items');         // 'my_favorite_items'\nunderscore('privateDocs/ownerInvoice');  // 'private_docs/owner_invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "underscore", + "params": [ + { + "name": "str", + "description": "The string to underscore.", + "type": "String" + } + ], + "return": { + "description": "the underscored string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 216, + "description": "

Returns the Capitalized form of a string

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capitalize } from '@ember/string';\n\ncapitalize('innerHTML')                 // 'InnerHTML'\ncapitalize('action_name')               // 'Action_name'\ncapitalize('css-class-name')            // 'Css-class-name'\ncapitalize('my favorite items')         // 'My favorite items'\ncapitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "capitalize", + "params": [ + { + "name": "str", + "description": "The string to capitalize.", + "type": "String" + } + ], + "return": { + "description": "The capitalized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/string", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-rsvp-2b4998f7ea.json b/json-docs/ember/4.0.1/classes/ember-4.0.1-rsvp-e1bd919c65.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-rsvp-2b4998f7ea.json rename to json-docs/ember/4.0.1/classes/ember-4.0.1-rsvp-e1bd919c65.json index 429c55be8..1625859ae 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-rsvp-2b4998f7ea.json +++ b/json-docs/ember/4.0.1/classes/ember-4.0.1-rsvp-e1bd919c65.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-rsvp", + "id": "ember-4.0.1-rsvp", "type": "class", "attributes": { "name": "rsvp", @@ -430,13 +430,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-rsvp", + "id": "ember-4.0.1-rsvp", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.0.1", "type": "project-version" } } diff --git a/json-docs/ember/4.0.1/modules/ember-4.0.1-@ember/component-d15d9abbfb.json b/json-docs/ember/4.0.1/modules/ember-4.0.1-@ember/component-d15d9abbfb.json new file mode 100644 index 000000000..effe6e8f7 --- /dev/null +++ b/json-docs/ember/4.0.1/modules/ember-4.0.1-@ember/component-d15d9abbfb.json @@ -0,0 +1,89 @@ +{ + "data": { + "id": "ember-4.0.1-@ember/component", + "type": "module", + "attributes": { + "name": "@ember/component", + "submodules": {}, + "elements": {}, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/component": 1, + "Ember.Templates.components": 1, + "@ember/component/helper": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 34, + "description": "

Glimmer is a templating engine used by Ember.js that is compatible with a subset of the Handlebars syntax.

\n

Showing a property

\n

Templates manage the flow of an application's UI, and display state (through\nthe DOM) to a user. For example, given a component with the property "name",\nthat component's template can use the name in several ways:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  name: 'Jill'\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
{{this.name}}\n<div>{{this.name}}</div>\n<span data-name={{this.name}}></span>
\n
\n
\n \n

Any time the "name" property on the component changes, the DOM will be\nupdated.

\n

Properties can be chained as well:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{@aUserModel.name}}\n<div>{{@listOfUsers.firstObject.name}}</div>
\n
\n
\n \n

Using Ember helpers

\n

When content is passed in mustaches {{}}, Ember will first try to find a helper\nor component with that name. For example, the if helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
{{if this.name "I have a name" "I have no name"}}\n<span data-has-name={{if this.name true}}></span>
\n
\n
\n \n

The returned value is placed where the {{}} is called. The above style is\ncalled "inline". A second style of helper usage is called "block". For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#if this.name}}\n  I have a name\n{{else}}\n  I have no name\n{{/if}}
\n
\n
\n \n

The block form of helpers allows you to control how the UI is created based\non the values of properties.\nA third form of helper is called "nested". For example here the concat\nhelper will add " Doe" to a displayed name if the person has no last name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<span data-name={{concat this.firstName (\n  if this.lastName (concat " " this.lastName) "Doe"\n)}}></span>
\n
\n
\n \n

Ember's built-in helpers are described under the Ember.Templates.helpers\nnamespace. Documentation on creating custom helpers can be found under\nhelper (or\nunder Helper if a helper requires access to\ndependency injection).

\n

Invoking a Component

\n

Ember components represent state to the UI of an application. Further\nreading on components can be found under Component.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "Component", + "Helper" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 231, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "allstaticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 231, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "version": "4.0.1" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/modules/ember-4.0.1-@glimmer/component-2b60cfc50c.json b/json-docs/ember/4.0.1/modules/ember-4.0.1-@glimmer/component-2b60cfc50c.json new file mode 100644 index 000000000..8ef6497fe --- /dev/null +++ b/json-docs/ember/4.0.1/modules/ember-4.0.1-@glimmer/component-2b60cfc50c.json @@ -0,0 +1,36 @@ +{ + "data": { + "id": "ember-4.0.1-@glimmer/component", + "type": "module", + "attributes": { + "name": "@glimmer/component", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts", + "line": 1, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault component's for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Template-only and Glimmer components. If you\nare looking for the API documentation for Classic components, it is\navailable here. The source code for\nGlimmer components can be found in @glimmer/component.

\n

Defining a Template-only Component

\n

The simplest way to create a component is to create a template file in\napp/templates/components. For example, if you name a template\napp/templates/components/person-profile.hbs:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
<h1>{{@person.name}}</h1>\n<img src={{@person.avatar}}>\n<p class='signature'>{{@person.signature}}</p>
\n
\n
\n \n

You will be able to use <PersonProfile /> to invoke this component elsewhere\nin your application:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<PersonProfile @person={{this.currentUser}} />
\n
\n
\n \n

Note that component names are capitalized here in order to distinguish them\nfrom regular HTML elements, but they are dasherized in the file system.

\n

While the angle bracket invocation form is generally preferred, it is also\npossible to invoke the same component with the {{person-profile}} syntax:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person-profile person=this.currentUser}}
\n
\n
\n \n

Note that with this syntax, you use dashes in the component name and\narguments are passed without the @ sign.

\n

In both cases, Ember will render the content of the component template we\ncreated above. The end result will be something like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\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 \n

File System Nesting

\n

Components can be nested inside sub-folders for logical groupping. For\nexample, if we placed our template in\napp/templates/components/person/short-profile.hbs, we can invoke it as\n<Person::ShortProfile />:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Person::ShortProfile @person={{this.currentUser}} />
\n
\n
\n \n

Or equivalently, {{person/short-profile}}:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person/short-profile person=this.currentUser}}
\n
\n
\n \n

Using Blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield}}
\n
\n
\n \n

We could then invoke it like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}}>\n  <p>Admin mode</p>\n</PersonProfile>
\n
\n
\n \n

or with curly syntax like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-profile person=this.currentUser}}\n  <p>Admin mode</p>\n{{/person-profile}}
\n
\n
\n \n

And 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

Blocks are executed in their original context, meaning they have access to the\nscope and any in-scope variables where they were defined.

\n

Passing parameters to blocks

\n

You can also pass positional parameters to {{yield}}, which are then made\navailable in the block:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

We can then use this value in the block like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}} as |signature|>\n  {{signature}}\n</PersonProfile>
\n
\n
\n \n

Passing multiple blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield to="title"}}</h1>\n{{yield}}
\n
\n
\n \n

This component could then be invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title>{{this.currentUser.name}}</:title>\n  <:default>{{this.currentUser.signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

When 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

Passing parameters to named blocks

\n

You can also pass parameters to named blocks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield @person.name to="title"}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

These parameters can then be used like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title as |name|>{{name}}</:title>\n  <:default as |signature|>{{signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

Checking to see if a block exists

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\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
\n \n

With this template, we can then optionally pass in one block, both blocks, or\nnone at all:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\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 \n

Checking to see if a block has parameters

\n

We can also check if a block receives parameters using the (has-block-params)\nkeyword, and conditionally yield different values if so.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
{{#if (has-block-params)}}\n  {{yield @person.signature}}\n{{else}}\n  {{yield}}\n{{/if}}
\n
\n
\n \n

Customizing Components With JavaScript

\n

To 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\nPersonProfile component which we defined above, we would create\napp/comopnents/person-profile.js and export our class as the default, like\nso:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n \n

You 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\ndisplayName property of our PersonProfile component instance in the\ntemplate like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

constructor

\n

params: owner object and args object

\n

Constructs 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import 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
\n \n

Service injections and arguments are available in the constructor.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Component from '@glimmer/component';\nimport { inject as 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 \n

willDestroy

\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@glimmer/component';\nimport { inject as 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 \n

args

\n

The args property of Glimmer components is an object that contains the\narguments that are passed to the component. For instance, the\nfollowing component usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @fadeIn={{true}} />
\n
\n
\n \n

Would result in the following args object to be passed to the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ fadeIn: true }
\n
\n
\n \n

args can be accessed at any point in the component lifecycle, including\nconstructor and willDestroy. They are also automatically marked as tracked\nproperties, and they can be depended on as computed property dependencies:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import 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 \n

isDestroying

\n

A boolean flag to tell if the component is in the process of destroying. This is set to\ntrue before willDestroy is called.

\n

isDestroyed

\n

A boolean to tell if the component has been fully destroyed. This is set to true\nafter willDestroy is called.

\n", + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "4.0.1" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.0.1/namespaces/ember-4.0.1-AutoLocation-1e5fae2940.json b/json-docs/ember/4.0.1/namespaces/ember-4.0.1-AutoLocation-1e5fae2940.json new file mode 100644 index 000000000..5f71634a5 --- /dev/null +++ b/json-docs/ember/4.0.1/namespaces/ember-4.0.1-AutoLocation-1e5fae2940.json @@ -0,0 +1,129 @@ +{ + "data": { + "id": "ember-4.0.1-AutoLocation", + "type": "namespace", + "attributes": { + "name": "AutoLocation", + "shortname": "AutoLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 21, + "description": "

AutoLocation will select the best location option based off browser\nsupport with the priority order: history, hash, none.

\n

Clean pushState paths accessed by hashchange-only browsers will be redirected\nto the hash-equivalent and vice versa so future transitions are consistent.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n

Browsers that support the history API will use HistoryLocation, those that\ndo not, but still support the hashchange event will use HashLocation, and\nin the rare case neither is supported will use NoneLocation.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'auto'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new for modern browsers that\nsupport the history api or /#/posts/new for older ones, like Internet\nExplorer 9 and below.

\n

When a user visits a link to your application, they will be automatically\nupgraded or downgraded to the appropriate Location class, with the URL\ntransformed accordingly, if needed.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n", + "static": 1, + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 344, + "access": "private", + "tagname": "Returns the current path as it should appear for HashLocation supported\nbrowsers. This may very well differ from the real current path.", + "itemtype": "method", + "name": "_getHashPath", + "class": "AutoLocation", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 79, + "access": "private", + "tagname": "Will be pre-pended to path upon state change.", + "since": "1.5.1", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 91, + "access": "private", + "tagname": "The browser's `location` object. This is typically equivalent to\n`window.location`, but may be overridden for testing.", + "itemtype": "property", + "name": "location", + "default": "environment.location", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 103, + "access": "private", + "tagname": "The browser's `history` object. This is typically equivalent to\n`window.history`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "history", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 116, + "access": "private", + "tagname": "The user agent's global variable. In browsers, this will be `window`.", + "since": "1.11", + "itemtype": "property", + "name": "global", + "default": "window", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 128, + "access": "private", + "tagname": "The browser's `userAgent`. This is typically equivalent to\n`navigator.userAgent`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "userAgent", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 141, + "access": "private", + "tagname": "This property is used by the router to know whether to cancel the routing\nsetup process, which is needed while we redirect the browser.", + "since": "1.5.1", + "itemtype": "property", + "name": "cancelRouterSetup", + "default": "false", + "class": "AutoLocation", + "module": "@ember/routing" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.0.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.0.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/namespaces/ember-4.12.1-Instrumentation-15d3fa04c8.json b/json-docs/ember/4.0.1/namespaces/ember-4.0.1-Instrumentation-f7974dcbbd.json similarity index 96% rename from json-docs/ember/4.12.1/namespaces/ember-4.12.1-Instrumentation-15d3fa04c8.json rename to json-docs/ember/4.0.1/namespaces/ember-4.0.1-Instrumentation-f7974dcbbd.json index c517cd99d..34fe95c0c 100644 --- a/json-docs/ember/4.12.1/namespaces/ember-4.12.1-Instrumentation-15d3fa04c8.json +++ b/json-docs/ember/4.0.1/namespaces/ember-4.0.1-Instrumentation-f7974dcbbd.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Instrumentation", + "id": "ember-4.0.1-Instrumentation", "type": "namespace", "attributes": { "name": "Instrumentation", @@ -31,13 +31,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/instrumentation", + "id": "ember-4.0.1-@ember/instrumentation", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.0.1", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/application-c977ee6794.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/application-4c936d26b7.json similarity index 96% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/application-c977ee6794.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/application-4c936d26b7.json index e2de190b4..609e6d297 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/application-c977ee6794.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/application-4c936d26b7.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/application", + "id": "ember-4.10.0-@ember/application", "type": "class", "attributes": { "name": "@ember/application", @@ -74,13 +74,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/application", + "id": "ember-4.10.0-@ember/application", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/component/helper-4b0e2cdd75.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/component/helper-94a2ea764e.json similarity index 95% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/component/helper-4b0e2cdd75.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/component/helper-94a2ea764e.json index d0ba4b3c1..6a02fcf70 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/component/helper-4b0e2cdd75.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/component/helper-94a2ea764e.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/component/helper", + "id": "ember-4.10.0-@ember/component/helper", "type": "class", "attributes": { "name": "@ember/component/helper", @@ -46,13 +46,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/component", + "id": "ember-4.10.0-@ember/component", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/debug-4e2be54526.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/debug-4e2be54526.json new file mode 100644 index 000000000..cee9c5688 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/debug-4e2be54526.json @@ -0,0 +1,310 @@ +{ + "data": { + "id": "ember-4.10.0-@ember/debug", + "type": "class", + "attributes": { + "name": "@ember/debug", + "shortname": "@ember/debug", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 917, + "description": "

Allows checking if a given property on an object is a computed property. For the most part,\nthis doesn't matter (you would normally just access the property directly and use its value),\nbut for some tooling specific scenarios (e.g. the ember-inspector) it is important to\ndifferentiate if a property is a computed property or a "normal" property.

\n

This will work on either a class's prototype or an instance itself.

\n", + "static": 1, + "itemtype": "method", + "name": "isComputed", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/object" + }, + { + "file": "packages/@ember/debug/lib/capture-render-tree.ts", + "line": 9, + "description": "

Ember Inspector calls this function to capture the current render tree.

\n

In production mode, this requires turning on ENV._DEBUG_RENDER_TREE\nbefore loading Ember.

\n", + "access": "private", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "captureRenderTree", + "params": [ + { + "name": "app", + "description": "An `ApplicationInstance`.", + "type": "ApplicationInstance" + } + ], + "since": "3.14.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 37, + "description": "

Allows for runtime registration of handler functions that override the default deprecation behavior.\nDeprecations are invoked by calls to @ember/debug/deprecate.\nThe following example demonstrates its usage by registering a handler that throws an error if the\nmessage contains the word "should", otherwise defers to the default handler.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { registerDeprecationHandler } from '@ember/debug';\n\nregisterDeprecationHandler((message, options, next) => {\n  if (message.indexOf('should') !== -1) {\n    throw new Error(`Deprecation message with should: ${message}`);\n  } else {\n    // defer to whatever handler was registered before this one\n    next(message, options);\n  }\n});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the deprecation call.
  • \n
  • options - An object passed in with the deprecation call containing additional information including:
  • \n
      \n
    • id - An id of the deprecation in the form of package-name.specific-deprecation.
    • \n
    • until - The Ember version number the feature and deprecation will be removed in.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerDeprecationHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle deprecation calls.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 182, + "description": "

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only).

\n

Ember itself leverages Semantic Versioning to aid\nprojects in keeping up with changes to the framework. Before any\nfunctionality or API is removed, it first flows linearly through a\ndeprecation staging process. The staging process currently contains two\nstages: available and enabled.

\n

Deprecations are initially released into the 'available' stage.\nDeprecations will stay in this stage until the replacement API has been\nmarked as a recommended practice via the RFC process and the addon\necosystem has generally adopted the change.

\n

Once a deprecation meets the above criteria, it will move into the\n'enabled' stage where it will remain until the functionality or API is\neventually removed.

\n

For application and addon developers, "available" deprecations are not\nurgent and "enabled" deprecations require action.

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { deprecate } from '@ember/debug';\n\ndeprecate(\n  'Use of `assign` has been deprecated. Please use `Object.assign` or the spread operator instead.',\n  false,\n  {\n    id: 'ember-polyfills.deprecate-assign',\n    until: '5.0.0',\n    url: 'https://deprecations.emberjs.com/v4.x/#toc_ember-polyfills-deprecate-assign',\n    for: 'ember-source',\n    since: {\n      available: '4.0.0',\n      enabled: '4.0.0',\n    },\n  }\n);
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecate", + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "test", + "description": "A boolean. If falsy, the deprecation will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "", + "type": "Object", + "props": [ + { + "name": "id", + "description": "A unique id for this deprecation. The id can be\n used by Ember debugging tools to change the behavior (raise, log or silence)\n for that specific deprecation. The id should be namespaced by dots, e.g.\n \"view.helper.select\".", + "type": "String" + }, + { + "name": "until", + "description": "The version of Ember when this deprecation\n warning will be removed.", + "type": "String" + }, + { + "name": "for", + "description": "A namespace for the deprecation, usually the package name", + "type": "String" + }, + { + "name": "since", + "description": "Describes when the deprecation became available and enabled.", + "type": "Object" + }, + { + "name": "url", + "description": "An optional url to the transition guide on the\n emberjs.com website.", + "type": "String", + "optional": true + } + ] + } + ], + "static": 1, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 24, + "description": "

Allows for runtime registration of handler functions that override the default warning behavior.\nWarnings are invoked by calls made to @ember/debug/warn.\nThe following example demonstrates its usage by registering a handler that does nothing overriding Ember's\ndefault warning behavior.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { registerWarnHandler } from '@ember/debug';\n\n// next is not called, so no warnings get the default behavior\nregisterWarnHandler(() => {});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the warn call.
  • \n
  • options - An object passed in with the warn call containing additional information including:
  • \n
      \n
    • id - An id of the warning in the form of package-name.specific-warning.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWarnHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle warnings.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 71, + "description": "

Display a warning with the provided message.

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { warn } from '@ember/debug';\nimport tomsterCount from './tomster-counter'; // a module in my project\n\n// Log a warning if we have more than 3 tomsters\nwarn('Too many tomsters!', tomsterCount <= 3, {\n  id: 'ember-debug.too-many-tomsters'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "warn", + "static": 1, + "params": [ + { + "name": "message", + "description": "A warning to display.", + "type": "String" + }, + { + "name": "test", + "description": "An optional boolean. If falsy, the warning\n will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "An object that can be used to pass a unique\n `id` for this warning. The `id` can be used by Ember debugging tools\n to change the behavior (raise, log, or silence) for that specific warning.\n The `id` should be namespaced by dots, e.g. \"ember-debug.feature-flag-with-features-stripped\"", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 135, + "description": "

Verify that a certain expectation is met, or throw a exception otherwise.

\n

This is useful for communicating assumptions in the code to other human\nreaders as well as catching bugs that accidentally violates these\nexpectations.

\n

Assertions are removed from production builds, so they can be freely added\nfor documentation and debugging purposes without worries of incuring any\nperformance penalty. However, because of that, they should not be used for\nchecks that could reasonably fail during normal usage. Furthermore, care\nshould be taken to avoid accidentally relying on side-effects produced from\nevaluating the condition itself, since the code will not run in production.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assert } from '@ember/debug';\n\n// Test for truthiness\nassert('Must pass a string', typeof str === 'string');\n\n// Fail unconditionally\nassert('This code path should never be run');
\n
\n
\n \n", + "itemtype": "method", + "name": "assert", + "static": 1, + "params": [ + { + "name": "description", + "description": "Describes the expectation. This will become the\n text of the Error thrown if the assertion fails.", + "type": "String" + }, + { + "name": "condition", + "description": "Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.", + "type": "Any" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 175, + "description": "

Display a debug notice.

\n

Calls to this function are not invoked in production builds.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { debug } from '@ember/debug';\n\ndebug('I\\'m a debug notice!');
\n
\n
\n \n", + "itemtype": "method", + "name": "debug", + "static": 1, + "params": [ + { + "name": "message", + "description": "A debug message to display.", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 196, + "description": "

Display an info notice.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n", + "itemtype": "method", + "name": "info", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 215, + "description": "

Alias an old, deprecated method with its new counterpart.

\n

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only) when the assigned method is called.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { deprecateFunc } from '@ember/debug';\n\nEmber.oldMethod = deprecateFunc('Please use the new, updated method', options, Ember.newMethod);
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecateFunc", + "static": 1, + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "options", + "description": "The options object for `deprecate`.", + "type": "Object", + "optional": true + }, + { + "name": "func", + "description": "The new function called to replace its deprecated counterpart.", + "type": "Function" + } + ], + "return": { + "description": "A new function that wraps the original function with a deprecation warning", + "type": "Function" + }, + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 260, + "description": "

Run a function meant for debugging.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport { runInDebug } from '@ember/debug';\n\nrunInDebug(() => {\n  Component.reopen({\n    didInsertElement() {\n      console.log("I'm happy");\n    }\n  });\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "runInDebug", + "static": 1, + "params": [ + { + "name": "func", + "description": "The function to be executed.", + "type": "Function" + } + ], + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/destroyable-308a93840c.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/destroyable-719367262a.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/destroyable-308a93840c.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/destroyable-719367262a.json index a49b46ead..8667f6ade 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/destroyable-308a93840c.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/destroyable-719367262a.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/destroyable", + "id": "ember-4.10.0-@ember/destroyable", "type": "class", "attributes": { "name": "@ember/destroyable", @@ -191,13 +191,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/destroyable", + "id": "ember-4.10.0-@ember/destroyable", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/helper-254286c260.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/helper-254286c260.json new file mode 100644 index 000000000..3708a6304 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/helper-254286c260.json @@ -0,0 +1,128 @@ +{ + "data": { + "id": "ember-4.10.0-@ember/helper", + "type": "class", + "attributes": { + "name": "@ember/helper", + "shortname": "@ember/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/helper", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/helper/index.ts", + "line": 5, + "description": "

capabilities returns a capabilities configuration which can be used to modify\nthe behavior of the manager. Manager capabilities must be provided using the\ncapabilities function, as the underlying implementation can change over time.

\n

The first argument to capabilities is a version string, which is the version of\nEmber that the capabilities were defined in. Ember can add new versions at any\ntime, and these may have entirely different behaviors, but it will not remove\nold versions until the next major version.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
capabilities('3.23');
\n
\n
\n \n

The second argument is an object of capabilities and boolean values indicating\nwhether they are enabled or disabled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
capabilities('3.23', {\n  hasValue: true,\n  hasDestructor: true,\n});
\n
\n
\n \n

If no value is specified, then the default value will be used.

\n

3.23 capabilities

\n

hasDestroyable

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a destroyable to include in the destructor\nhierarchy. If enabled, the getDestroyable hook will be called, and its result\nwill be associated with the destroyable parent block.

\n

hasValue

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a value which can be used externally. The helper's\ngetValue hook will be run whenever the value of the helper is accessed if this\ncapability is enabled.

\n", + "itemtype": "method", + "name": "capabilities", + "static": 1, + "params": [ + { + "name": "managerApiVersion", + "description": "The version of capabilities that are being used", + "type": "String" + }, + { + "name": "options", + "description": "The capabilities values" + } + ], + "return": { + "description": "The capabilities object instance", + "type": "Capabilities" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 58, + "description": "

Sets the helper manager for an object or function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
setHelperManager((owner) => new ClassHelperManager(owner), Helper)
\n
\n
\n \n

When a value is used as a helper in a template, the helper manager is looked up\non the object by walking up its prototype chain and finding the first helper\nmanager. This manager then receives the value and can create and manage an\ninstance of a helper from it. This provides a layer of indirection that allows\nusers to design high-level helper APIs, without Ember needing to worry about the\ndetails. High-level APIs can be experimented with and iterated on while the\ncore of Ember helpers remains stable, and new APIs can be introduced gradually\nover time to existing code bases.

\n

setHelperManager receives two arguments:

\n
    \n
  1. A factory function, which receives the owner and returns an instance of a\n helper manager.
  2. \n
  3. A helper definition, which is the object or function to associate the factory function with.
  4. \n
\n

The first time the object is looked up, the factory function will be called to\ncreate the helper manager. It will be cached, and in subsequent lookups the\ncached helper manager will be used instead.

\n

Only one helper manager is guaranteed to exist per owner and per usage of\nsetHelperManager, so many helpers will end up using the same instance of the\nhelper manager. As such, you should only store state that is related to the\nmanager itself. If you want to store state specific to a particular helper\ndefinition, you should assign a unique helper manager to that helper. In\ngeneral, most managers should either be stateless, or only have the owner they\nwere created with as state.

\n

Helper managers must fulfill the following interface (This example uses\nTypeScript interfaces\nfor precision, you do not need to write helper managers using TypeScript):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
interface HelperManager<HelperStateBucket> {\n  capabilities: HelperCapabilities;\n\n  createHelper(definition: HelperDefinition, args: TemplateArgs): HelperStateBucket;\n\n  getValue?(bucket: HelperStateBucket): unknown;\n\n  runEffect?(bucket: HelperStateBucket): void;\n\n  getDestroyable?(bucket: HelperStateBucket): object;\n}
\n
\n
\n \n

The capabilities property must be provided using the capabilities() function\nimported from the same module as setHelperManager:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capabilities } from '@ember/helper';\n\nclass MyHelperManager {\n  capabilities = capabilities('3.21.0', { hasValue: true });\n\n  // ...snip...\n}
\n
\n
\n \n

Below is a description of each of the methods on the interface and their\nfunctions.

\n

createHelper

\n

createHelper is a required hook on the HelperManager interface. The hook is\npassed the definition of the helper that is currently being created, and is\nexpected to return a state bucket. This state bucket is what represents the\ncurrent state of the helper, and will be passed to the other lifecycle hooks at\nappropriate times. It is not necessarily related to the definition of the\nhelper itself - for instance, you could return an object containing an\ninstance of the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
class MyManager {\n  createHelper(Definition, args) {\n    return {\n      instance: new Definition(args);\n    };\n  }\n}
\n
\n
\n \n

This allows the manager to store metadata that it doesn't want to expose to the\nuser.

\n

This hook is not autotracked - changes to tracked values used within this hook\nwill not result in a call to any of the other lifecycle hooks. This is because\nit is unclear what should happen if it invalidates, and rather than make a\ndecision at this point, the initial API is aiming to allow as much expressivity\nas possible. This could change in the future with changes to capabilities and\ntheir behaviors.

\n

If users do want to autotrack some values used during construction, they can\neither create the instance of the helper in runEffect or getValue, or they\ncan use the cache API to autotrack the createHelper hook themselves. This\nprovides maximum flexibility and expressiveness to manager authors.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called as discovered during DOM construction
  • \n
  • called in definition order in the template
  • \n
\n

getValue

\n

getValue is an optional hook that should return the value of the helper. This\nis the value that is returned from the helper and passed into the template.

\n

This hook is called when the value is requested from the helper (e.g. when the\ntemplate is rendering and the helper value is needed). The hook is autotracked,\nand will rerun whenever any tracked values used inside of it are updated.\nOtherwise it does not rerun.

\n
\n

Note: This means that arguments which are not consumed within the hook will\nnot trigger updates.

\n
\n

This hook is only called for helpers with the hasValue capability enabled.\nThis hook has the following timing semantics:

\n

Always

\n
    \n
  • called the first time the helper value is requested
  • \n
  • called after autotracked state has changed
  • \n
\n

Never

\n
    \n
  • called if the hasValue capability is disabled
  • \n
\n

runEffect

\n

runEffect is an optional hook that should run the effect that the helper is\napplying, setting it up or updating it.

\n

This hook is scheduled to be called some time after render and prior to paint.\nThere is not a guaranteed, 1-to-1 relationship between a render pass and this\nhook firing. For instance, multiple render passes could occur, and the hook may\nonly trigger once. It may also never trigger if it was dirtied in one render\npass and then destroyed in the next.

\n

The hook is autotracked, and will rerun whenever any tracked values used inside\nof it are updated. Otherwise it does not rerun.

\n

The hook is also run during a time period where state mutations are disabled\nin Ember. Any tracked state mutation will throw an error during this time,\nincluding changes to tracked properties, changes made using Ember.set, updates\nto computed properties, etc. This is meant to prevent infinite rerenders and\nother antipatterns.

\n

This hook is only called for helpers with the hasScheduledEffect capability\nenabled. This hook is also not called in SSR currently, though this could be\nadded as a capability in the future. It has the following timing semantics:

\n

Always

\n
    \n
  • called after the helper was first created, if the helper has not been\ndestroyed since creation
  • \n
  • called after autotracked state has changed, if the helper has not been\ndestroyed during render
  • \n
\n

Never

\n
    \n
  • called if the hasScheduledEffect capability is disabled
  • \n
  • called in SSR
  • \n
\n

getDestroyable

\n

getDestroyable is an optional hook that users can use to register a\ndestroyable object for the helper. This destroyable will be registered to the\ncontaining block or template parent, and will be destroyed when it is destroyed.\nSee the Destroyables RFC\nfor more details.

\n

getDestroyable is only called if the hasDestroyable capability is enabled.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called immediately after the createHelper hook is called
  • \n
\n

Never

\n
    \n
  • called if the hasDestroyable capability is disabled
  • \n
\n", + "itemtype": "method", + "name": "setHelperManager", + "static": 1, + "params": [ + { + "name": "factory", + "description": "A factory function which receives an optional owner, and returns a helper manager", + "type": "Function" + }, + { + "name": "definition", + "description": "The definition to associate the manager factory with", + "type": "Object" + } + ], + "return": { + "description": "The definition passed into setHelperManager", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 251, + "description": "

The invokeHelper function can be used to create a helper instance in\nJavaScript.

\n

To access a helper's value you have to use getValue from\n@glimmer/tracking/primitives/cache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
// app/components/data-loader.js\nimport Component from '@glimmer/component';\nimport { getValue } from '@glimmer/tracking/primitives/cache';\nimport Helper from '@ember/component/helper';\nimport { invokeHelper } from '@ember/helper';\n\nclass PlusOne extends Helper {\n  compute([number]) {\n    return number + 1;\n  }\n}\n\nexport default class PlusOneComponent extends Component {\n  plusOne = invokeHelper(this, PlusOne, () => {\n    return {\n      positional: [this.args.number],\n    };\n  });\n\n  get value() {\n    return getValue(this.plusOne);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{this.value}}
\n
\n
\n \n

It receives three arguments:

\n
    \n
  • context: The parent context of the helper. When the parent is torn down and\nremoved, the helper will be as well.
  • \n
  • definition: The definition of the helper.
  • \n
  • computeArgs: An optional function that produces the arguments to the helper.\nThe function receives the parent context as an argument, and must return an\nobject with a positional property that is an array and/or a named\nproperty that is an object.
  • \n
\n

And it returns a Cache instance that contains the most recent value of the\nhelper. You can access the helper using getValue() like any other cache. The\ncache is also destroyable, and using the destroy() function on it will cause\nthe helper to be torn down.

\n

Note that using getValue() on helpers that have scheduled effects will not\ntrigger the effect early. Effects will continue to run at their scheduled time.

\n", + "itemtype": "method", + "name": "invokeHelper", + "static": 1, + "params": [ + { + "name": "context", + "description": "The parent context of the helper", + "type": "Object" + }, + { + "name": "definition", + "description": "The helper definition", + "type": "Object" + }, + { + "name": "computeArgs", + "description": "An optional function that produces args", + "type": "Function" + } + ], + "return": { + "description": "" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/helper", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/object-08c8502400.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/object-08c8502400.json new file mode 100644 index 000000000..9bb0c4918 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/object-08c8502400.json @@ -0,0 +1,521 @@ +{ + "data": { + "id": "ember-4.10.0-@ember/object", + "type": "class", + "attributes": { + "name": "@ember/object", + "shortname": "@ember/object", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 729, + "description": "

This helper returns a new property descriptor that wraps the passed\ncomputed property function. You can use this helper to define properties with\nnative decorator syntax, mixins, or via defineProperty().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', function() {\n    return `${this.get('firstName')} ${this.get('lastName')}`;\n  })\n});\n\nlet client = Person.create();\n\nclient.get('fullName'); // 'Betty Jones'\n\nclient.set('lastName', 'Fuller');\nclient.get('fullName'); // 'Betty Fuller'
\n
\n
\n \n

You can also provide a setter, either directly on the class using native class\nsyntax, or by passing a hash with get and set functions.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(/\\s+/);\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n\n    return value;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', {\n    get(key) {\n      return `${this.get('firstName')} ${this.get('lastName')}`;\n    },\n    set(key, value) {\n      let [firstName, lastName] = value.split(/\\s+/);\n      this.setProperties({ firstName, lastName });\n      return value;\n    }\n  })\n});\n\nlet client = Person.create();\nclient.get('firstName'); // 'Betty'\n\nclient.set('fullName', 'Carroll Fuller');\nclient.get('firstName'); // 'Carroll'
\n
\n
\n \n

When passed as an argument, the set function should accept two parameters,\nkey and value. The value returned from set will be the new value of the\nproperty.

\n

Note: This is the preferred way to define computed properties when writing third-party\nlibraries that depend on or use Ember, since there is no guarantee that the user\nwill have prototype Extensions enabled.

\n", + "itemtype": "method", + "name": "computed", + "static": 1, + "params": [ + { + "name": "dependentKeys*", + "description": "Optional dependent keys that trigger this computed property.", + "type": "String", + "optional": true + }, + { + "name": "func", + "description": "The computed property function.", + "type": "Function" + } + ], + "return": { + "description": "property decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/get_properties.ts", + "line": 6, + "description": "

To get multiple properties at once, call getProperties\nwith an object followed by a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, 'firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, ['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + }, + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/properties.ts", + "line": 13, + "description": "

NOTE: This is a low-level method used by other parts of the API. You almost\nnever want to call this method directly. Instead you should use\nmixin() to define new properties.

\n

Defines a property on an object. This method works much like the ES5\nObject.defineProperty() method except that it can also accept computed\nproperties and other special descriptors.

\n

Normally this method takes only three parameters. However if you pass an\ninstance of Descriptor as the third param then you can pass an\noptional value as the fourth parameter. This is often more efficient than\ncreating new descriptor hashes for each property.

\n

Examples

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { defineProperty, computed } from '@ember/object';\n\n// ES5 compatible mode\ndefineProperty(contact, 'firstName', {\n  writable: true,\n  configurable: false,\n  enumerable: true,\n  value: 'Charles'\n});\n\n// define a simple property\ndefineProperty(contact, 'lastName', undefined, 'Jolley');\n\n// define a computed property\ndefineProperty(contact, 'fullName', computed('firstName', 'lastName', function() {\n  return this.firstName+' '+this.lastName;\n}));
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "defineProperty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "the object to define this property on. This may be a prototype.", + "type": "Object" + }, + { + "name": "keyName", + "description": "the name of the property", + "type": "String" + }, + { + "name": "desc", + "description": "an instance of `Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.", + "type": "Descriptor", + "optional": true + }, + { + "name": "data", + "description": "something other than a descriptor, that will\n become the explicit value of this property.", + "type": "*", + "optional": true + } + ], + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 32, + "description": "

This function is called just after an object property has changed.\nIt will notify any observers and clear caches among other things.

\n

Normally you will not need to call this method directly but if for some\nreason you can't directly watch a property you can invoke this method\nmanually.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "obj", + "description": "The object with the property that will change", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key (or path) that will change.", + "type": "String" + }, + { + "name": "_meta", + "description": "The objects meta.", + "type": "Meta", + "optional": true + }, + { + "name": "value", + "description": "The new value to set for the property", + "type": "Unknown", + "optional": true + } + ], + "return": { + "description": "", + "type": "Void" + }, + "since": "3.1.0", + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 83, + "itemtype": "method", + "name": "beginPropertyChanges", + "chainable": 1, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 93, + "itemtype": "method", + "name": "endPropertyChanges", + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 105, + "description": "

Make a series of property changes together in an\nexception-safe way.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
Ember.changeProperties(function() {\n  obj1.set('foo', mayBlowUpWhenSet);\n  obj2.set('bar', baz);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "changeProperties", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_get.ts", + "line": 50, + "description": "

Gets the value of a property on an object. If the property is computed,\nthe function will be invoked. If the property is not defined but the\nobject implements the unknownProperty method then that will be invoked.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { get } from '@ember/object';\nget(obj, "name");
\n
\n
\n \n

If you plan to run on IE8 and older browsers then you should use this\nmethod anytime you want to retrieve a property on an object that you don't\nknow for sure is private. (Properties beginning with an underscore '_'\nare considered private.)

\n

On all newer browsers, you only need to use this method to retrieve\nproperties if the property might not be defined on the object and you want\nto respect the unknownProperty handler. Otherwise you can ignore this\nmethod.

\n

Note that if the object itself is undefined, this method will throw\nan error.

\n", + "itemtype": "method", + "name": "get", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to retrieve from.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to retrieve", + "type": "String" + } + ], + "return": { + "description": "the property value or `null`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 17, + "description": "

Sets the value of a property on an object, respecting computed properties\nand notifying observers and other listeners of the change.\nIf the specified property is not defined on the object and the object\nimplements the setUnknownProperty method, then instead of setting the\nvalue of the property on the object, its setUnknownProperty handler\nwill be invoked with the two parameters keyName and value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { set } from '@ember/object';\nset(obj, "name", value);
\n
\n
\n \n", + "itemtype": "method", + "name": "set", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "return": { + "description": "the passed value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 121, + "description": "

Error-tolerant form of set. Will not blow up if any part of the\nchain is undefined, null, or destroyed.

\n

This is primarily used when syncing bindings, which may try to update after\nan object has been destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { trySet } from '@ember/object';\n\nlet obj = { name: "Zoey" };\ntrySet(obj, "contacts.twitter", "@emberjs");
\n
\n
\n \n", + "itemtype": "method", + "name": "trySet", + "static": 1, + "params": [ + { + "name": "root", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "path", + "description": "The property path to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/set_properties.ts", + "line": 6, + "description": "

Set a list of properties on an object. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nlet anObject = EmberObject.create();\n\nanObject.setProperties({\n  firstName: 'Stanley',\n  lastName: 'Stuart',\n  age: 21\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "properties", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "properties" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 617, + "description": "

Creates a new subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(thing);\n   }\n});
\n
\n
\n \n

This defines a new subclass of EmberObject: Person. It contains one method: say().

\n

You can also create a subclass from any existing class by calling its extend() method.\nFor example, you might want to create a subclass of Ember's built-in Component class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nconst PersonComponent = Component.extend({\n  tagName: 'li',\n  classNameBindings: ['isAdministrator']\n});
\n
\n
\n \n

When defining a subclass, you can override methods but still access the\nimplementation of your parent class by calling the special _super() method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    let name = this.get('name');\n    alert(`${name} says: ${thing}`);\n  }\n});\n\nconst Soldier = Person.extend({\n  say(thing) {\n    this._super(`${thing}, sir!`);\n  },\n  march(numberOfHours) {\n    alert(`${this.get('name')} marches for ${numberOfHours} hours.`);\n  }\n});\n\nlet yehuda = Soldier.create({\n  name: 'Yehuda Katz'\n});\n\nyehuda.say('Yes');  // alerts "Yehuda Katz says: Yes, sir!"
\n
\n
\n \n

The create() on line #17 creates an instance of the Soldier class.\nThe extend() on line #8 creates a subclass of Person. Any instance\nof the Person class will not have the march() method.

\n

You can also pass Mixin classes to add additional properties to the subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import EmberObject from '@ember/object';\nimport Mixin from '@ember/object/mixin';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(`${this.get('name')} says: ${thing}`);\n  }\n});\n\nconst SingingMixin = Mixin.create({\n  sing(thing) {\n    alert(`${this.get('name')} sings: la la la ${thing}`);\n  }\n});\n\nconst BroadwayStar = Person.extend(SingingMixin, {\n  dance() {\n    alert(`${this.get('name')} dances: tap tap tap tap `);\n  }\n});
\n
\n
\n \n

The BroadwayStar class contains three methods: say(), sing(), and dance().

\n", + "itemtype": "method", + "name": "extend", + "static": 1, + "params": [ + { + "name": "mixins", + "description": "One or more Mixin classes", + "type": "Mixin", + "optional": true, + "multiple": true + }, + { + "name": "arguments", + "description": "Object containing values to use within the new class", + "type": "Object", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 721, + "description": "

Creates an instance of a class. Accepts either no arguments, or an object\ncontaining values to initialize the newly instantiated object with.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  helloWorld() {\n    alert(`Hi, my name is ${this.get('name')}`);\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\n\ntom.helloWorld(); // alerts "Hi, my name is Tom Dale".
\n
\n
\n \n

create will call the init function if defined during\nAnyObject.extend

\n

If no arguments are passed to create, it will not set values to the new\ninstance during initialization:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let noName = Person.create();\nnoName.helloWorld(); // alerts undefined
\n
\n
\n \n

NOTE: For performance reasons, you cannot declare methods or computed\nproperties during create. You should instead declare methods and computed\nproperties when using extend.

\n", + "itemtype": "method", + "name": "create", + "static": 1, + "params": [ + { + "name": "arguments", + "description": "", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 796, + "description": "

Augments a constructor's prototype with additional\nproperties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\no = MyObject.create();\no.get('name'); // 'an object'\n\nMyObject.reopen({\n  say(msg) {\n    console.log(msg);\n  }\n});\n\no2 = MyObject.create();\no2.say('hello'); // logs "hello"\n\no.say('goodbye'); // logs "goodbye"
\n
\n
\n \n

To add functions and properties to the constructor itself,\nsee reopenClass

\n", + "itemtype": "method", + "name": "reopen", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 850, + "description": "

Augments a constructor's own properties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\nMyObject.reopenClass({\n  canBuild: false\n});\n\nMyObject.canBuild; // false\no = MyObject.create();
\n
\n
\n \n

In other words, this creates static properties and functions for the class.\nThese are only available on the class and not on any instance of that class.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  name: '',\n  sayHello() {\n    alert(`Hello. My name is ${this.get('name')}`);\n  }\n});\n\nPerson.reopenClass({\n  species: 'Homo sapiens',\n\n  createPerson(name) {\n    return Person.create({ name });\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\nlet yehuda = Person.createPerson('Yehuda Katz');\n\ntom.sayHello(); // "Hello. My name is Tom Dale"\nyehuda.sayHello(); // "Hello. My name is Yehuda Katz"\nalert(Person.species); // "Homo sapiens"
\n
\n
\n \n

Note that species and createPerson are not valid on the tom and yehuda\nvariables. They are only valid on Person.

\n

To add functions and properties to instances of\na constructor by extending the constructor's prototype\nsee reopen

\n", + "itemtype": "method", + "name": "reopenClass", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 933, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For\nexample, computed property functions may close over variables that are then\nno longer available for introspection.

\n

You can pass a hash of these values to a computed property like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { computed } from '@ember/object';\n\nperson: computed(function() {\n  let personId = this.get('personId');\n  return Person.create({ id: personId });\n}).meta({ type: Person })
\n
\n
\n \n

Once you've done this, you can retrieve the values saved to the computed\nproperty from your class like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyClass.metaForProperty('person');
\n
\n
\n \n

This will return the original hash that was passed to meta().

\n", + "static": 1, + "itemtype": "method", + "name": "metaForProperty", + "params": [ + { + "name": "key", + "description": "property name", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 976, + "description": "

Iterate over each computed property for the class, passing its name\nand any associated metadata (see metaForProperty) to the callback.

\n", + "static": 1, + "itemtype": "method", + "name": "eachComputedProperty", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "binding", + "description": "", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 1068, + "description": "

Provides lookup-time type validation for injected properties.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_onLookup", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 1089, + "description": "

Returns a hash of property names and container names that injected\nproperties will lookup on the container lazily.

\n", + "itemtype": "method", + "name": "_lazyInjections", + "return": { + "description": "Hash of all lazy injected property keys to container names", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/index.ts", + "line": 50, + "description": "

Decorator that turns the target function into an Action which can be accessed\ndirectly by reference.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action this.toggleShowing}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

Decorated actions also interop with the string style template actions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action "toggleShowing"}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

It also binds the function directly to the instance, so it can be used in any\ncontext and will correctly refer to the class it came from:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert this.toggleShowing}}\n  {{on "click" this.toggleShowing}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

This can also be used in JavaScript code directly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  constructor() {\n    super(...arguments);\n\n    // this.toggleShowing is still bound correctly when added to\n    // the event listener\n    document.addEventListener('click', this.toggleShowing);\n  }\n\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n

This is considered best practice, since it means that methods will be bound\ncorrectly no matter where they are used. By contrast, the {{action}} helper\nand modifier can also be used to bind context, but it will be required for\nevery usage of the method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert (action this.toggleShowing)}}\n  {{on "click" (action this.toggleShowing)}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

They also do not have equivalents in JavaScript directly, so they cannot be\nused for other situations where binding would be useful.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "action", + "static": 1, + "params": [ + { + "name": "callback", + "description": "The function to turn into an action,\n when used in classic classes", + "type": "Function|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/index.ts", + "line": 288, + "description": "

Specify a method that observes property changes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nimport { observer } from '@ember/object';\n\nexport default EmberObject.extend({\n  valueObserver: observer('value', function() {\n    // Executes whenever the "value" property changes\n  })\n});
\n
\n
\n \n

Also available as Function.prototype.observes if prototype extensions are\nenabled.

\n", + "itemtype": "method", + "name": "observer", + "params": [ + { + "name": "propertyNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "func" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/object", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/compat-2096008353.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/object/compat-6336b079b1.json similarity index 98% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/compat-2096008353.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/object/compat-6336b079b1.json index b51d5df49..8eb5d0ba4 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/compat-2096008353.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/object/compat-6336b079b1.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/object/compat", + "id": "ember-4.10.0-@ember/object/compat", "type": "class", "attributes": { "name": "@ember/object/compat", @@ -49,13 +49,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/object", + "id": "ember-4.10.0-@ember/object", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/computed-d3cb7b2a2b.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/object/computed-76216d32d0.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/computed-d3cb7b2a2b.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/object/computed-76216d32d0.json index ccad24597..bbd801595 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/computed-d3cb7b2a2b.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/object/computed-76216d32d0.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/object/computed", + "id": "ember-4.10.0-@ember/object/computed", "type": "class", "attributes": { "name": "@ember/object/computed", @@ -888,13 +888,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/object", + "id": "ember-4.10.0-@ember/object", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/evented-3b046e4e25.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/object/evented-7901080243.json similarity index 96% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/evented-3b046e4e25.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/object/evented-7901080243.json index 9ca3dadb6..210556dea 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/evented-3b046e4e25.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/object/evented-7901080243.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/object/evented", + "id": "ember-4.10.0-@ember/object/evented", "type": "class", "attributes": { "name": "@ember/object/evented", @@ -55,13 +55,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/object", + "id": "ember-4.10.0-@ember/object", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/owner-6a4fedbee5.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/owner-436e8db55e.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/owner-6a4fedbee5.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/owner-436e8db55e.json index b71b239c6..af08ea31e 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/owner-6a4fedbee5.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/owner-436e8db55e.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.10.0-@ember/owner", "type": "class", "attributes": { "name": "@ember/owner", @@ -270,13 +270,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.10.0-@ember/owner", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/polyfills-82b425b116.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/polyfills-82b425b116.json new file mode 100644 index 000000000..58039f336 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/polyfills-82b425b116.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.10.0-@ember/polyfills", + "type": "class", + "attributes": { + "name": "@ember/polyfills", + "shortname": "@ember/polyfills", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/polyfills", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/polyfills/lib/assign.ts", + "line": 11, + "description": "

Copy properties from a source object to a target object. Source arguments remain unchanged.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assign } from '@ember/polyfills';\n\nvar a = { first: 'Yehuda' };\nvar b = { last: 'Katz' };\nvar c = { company: 'Other Company' };\nvar d = { company: 'Tilde Inc.' };\nassign(a, b, c, d); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' };
\n
\n
\n \n", + "itemtype": "method", + "name": "assign", + "params": [ + { + "name": "target", + "description": "The object to assign into", + "type": "Object" + }, + { + "name": "args", + "description": "The objects to copy properties from", + "type": "Object", + "multiple": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/polyfills", + "module": "@ember/polyfills" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/polyfills", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/runloop-c5b2144f6a.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/runloop-9f0700afdd.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/runloop-c5b2144f6a.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/runloop-9f0700afdd.json index ee0716761..e2fa6e898 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/runloop-c5b2144f6a.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/runloop-9f0700afdd.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/runloop", + "id": "ember-4.10.0-@ember/runloop", "type": "class", "attributes": { "name": "@ember/runloop", @@ -482,13 +482,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/runloop", + "id": "ember-4.10.0-@ember/runloop", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/service-57bffdefe8.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/service-996f0f3ffe.json similarity index 97% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/service-57bffdefe8.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/service-996f0f3ffe.json index 2ebdfce42..2014442a6 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/service-57bffdefe8.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/service-996f0f3ffe.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/service", + "id": "ember-4.10.0-@ember/service", "type": "class", "attributes": { "name": "@ember/service", @@ -73,13 +73,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/service", + "id": "ember-4.10.0-@ember/service", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/template-f0ca9b2ec5.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/template-f0ca9b2ec5.json new file mode 100644 index 000000000..6b0b12aa6 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/template-f0ca9b2ec5.json @@ -0,0 +1,100 @@ +{ + "data": { + "id": "ember-4.10.0-@ember/template", + "type": "class", + "attributes": { + "name": "@ember/template", + "shortname": "@ember/template", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/template", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/utils/managers.ts", + "line": 9, + "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).

\n", + "itemtype": "method", + "name": "setComponentManager", + "params": [ + { + "name": "factory", + "description": "a function to create the owner for an object", + "type": "Function" + }, + { + "name": "obj", + "description": "the object to associate with the componetn manager", + "type": "Object" + } + ], + "return": { + "description": "the same object passed in", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 61, + "description": "

Use this method to indicate that a string should be rendered as HTML\nwhen the string is used in a template. To say this another way,\nstrings marked with htmlSafe will not be HTML escaped.

\n

A word of warning - The htmlSafe method does not make the string safe;\nit only tells the framework to treat the string as if it is safe to render\nas HTML. If a string contains user inputs or other untrusted\ndata, you must sanitize the string before using the htmlSafe method.\nOtherwise your code is vulnerable to\nCross-Site Scripting.\nThere are many open source sanitization libraries to choose from,\nboth for front end and server-side sanitization.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { htmlSafe } from '@ember/template';\n\nconst someTrustedOrSanitizedString = "<div>Hello!</div>"\n\nhtmlSafe(someTrustedorSanitizedString)
\n
\n
\n \n", + "itemtype": "method", + "name": "htmlSafe", + "static": 1, + "return": { + "description": "A string that will not be HTML escaped by Handlebars.", + "type": "SafeString" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 98, + "description": "

Detects if a string was decorated using htmlSafe.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { htmlSafe, isHTMLSafe } from '@ember/template';\n\nvar plainString = 'plain string',\n    safeString = htmlSafe('<div>someValue</div>');\n\nisHTMLSafe(plainString); // false\nisHTMLSafe(safeString);  // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isHTMLSafe", + "static": 1, + "return": { + "description": "`true` if the string was decorated with `htmlSafe`, `false` otherwise.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/template", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/test-1fd8caf21c.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/test-1fb153826e.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/test-1fd8caf21c.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/test-1fb153826e.json index 32bde4bd9..06c80990f 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/test-1fd8caf21c.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/test-1fb153826e.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/test", + "id": "ember-4.10.0-@ember/test", "type": "class", "attributes": { "name": "@ember/test", @@ -380,13 +380,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/test", + "id": "ember-4.10.0-@ember/test", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/utils-70146b5648.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/utils-2e789af849.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/utils-70146b5648.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/utils-2e789af849.json index c29c63c5a..758d119ee 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/utils-70146b5648.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@ember/utils-2e789af849.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/utils", + "id": "ember-4.10.0-@ember/utils", "type": "class", "attributes": { "name": "@ember/utils", @@ -198,13 +198,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/utils", + "id": "ember-4.10.0-@ember/utils", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@glimmer/tracking-5d6bf95268.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@glimmer/tracking-670954b24e.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@glimmer/tracking-5d6bf95268.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-@glimmer/tracking-670954b24e.json index 63ceaed65..0b52a02dd 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@glimmer/tracking-5d6bf95268.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@glimmer/tracking-670954b24e.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@glimmer/tracking", + "id": "ember-4.10.0-@glimmer/tracking", "type": "class", "attributes": { "name": "@glimmer/tracking", @@ -50,13 +50,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@glimmer/tracking", + "id": "ember-4.10.0-@glimmer/tracking", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@glimmer/tracking/primitives/cache-4c37a858a5.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-@glimmer/tracking/primitives/cache-1242306ebb.json similarity index 97% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@glimmer/tracking/primitives/cache-4c37a858a5.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-@glimmer/tracking/primitives/cache-1242306ebb.json index 845923839..f59279eca 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@glimmer/tracking/primitives/cache-4c37a858a5.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-@glimmer/tracking/primitives/cache-1242306ebb.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@glimmer/tracking/primitives/cache", + "id": "ember-4.10.0-@glimmer/tracking/primitives/cache", "type": "class", "attributes": { "name": "@glimmer/tracking/primitives/cache", @@ -62,13 +62,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@glimmer/tracking/primitives/cache", + "id": "ember-4.10.0-@glimmer/tracking/primitives/cache", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Application-918c026414.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Application-d6529ecc5d.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Application-918c026414.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-Application-d6529ecc5d.json index 7ea1ee586..269ae971a 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Application-918c026414.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Application-d6529ecc5d.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Application", + "id": "ember-4.10.0-Application", "type": "class", "attributes": { "name": "Application", @@ -580,7 +580,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-Engine", + "id": "ember-4.10.0-Engine", "type": "class" } }, @@ -589,13 +589,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/application", + "id": "ember-4.10.0-@ember/application", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-ApplicationInstance-8f1607bee9.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-ApplicationInstance-8f1607bee9.json new file mode 100644 index 000000000..dfb4f3b19 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-ApplicationInstance-8f1607bee9.json @@ -0,0 +1,834 @@ +{ + "data": { + "id": "ember-4.10.0-ApplicationInstance", + "type": "class", + "attributes": { + "name": "ApplicationInstance", + "shortname": "ApplicationInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/instance.ts", + "line": 19, + "description": "

The ApplicationInstance encapsulates all of the stateful aspects of a\nrunning Application.

\n

At a high-level, we break application boot into two distinct phases:

\n
    \n
  • Definition time, where all of the classes, templates, and other\ndependencies are loaded (typically in the browser).
  • \n
  • Run time, where we begin executing the application once everything\nhas loaded.
  • \n
\n

Definition time can be expensive and only needs to happen once since it is\nan idempotent operation. For example, between test runs and FastBoot\nrequests, the application stays the same. It is only the state that we want\nto reset.

\n

That state is what the ApplicationInstance manages: it is responsible for\ncreating the container that contains all application state, and disposing of\nit once the particular test run or FastBoot request has finished.

\n", + "access": "public", + "tagname": "", + "extends": "EngineInstance", + "methods": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 296, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 55, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 106, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 172, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 189, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 219, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 41, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 189, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ApplicationInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 238, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ApplicationInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 45, + "description": "

The Application for which this is an instance.

\n", + "itemtype": "property", + "name": "application", + "type": "Application", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 53, + "description": "

The root DOM element of the Application as an element or a\nCSS selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "String|DOMElement", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 67, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 25, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EngineInstance", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-ApplicationInstance.BootOptions-eb97f21167.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-ApplicationInstance.BootOptions-7c4356c4ca.json similarity index 98% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-ApplicationInstance.BootOptions-eb97f21167.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-ApplicationInstance.BootOptions-7c4356c4ca.json index 37b0974a2..1844759c4 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-ApplicationInstance.BootOptions-eb97f21167.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-ApplicationInstance.BootOptions-7c4356c4ca.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-ApplicationInstance.BootOptions", + "id": "ember-4.10.0-ApplicationInstance.BootOptions", "type": "class", "attributes": { "name": "ApplicationInstance.BootOptions", @@ -128,13 +128,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/application", + "id": "ember-4.10.0-@ember/application", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-ArrayProxy-d3d367586e.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-ArrayProxy-d3d367586e.json new file mode 100644 index 000000000..122be9343 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-ArrayProxy-d3d367586e.json @@ -0,0 +1,1834 @@ +{ + "data": { + "id": "ember-4.10.0-ArrayProxy", + "type": "class", + "attributes": { + "name": "ArrayProxy", + "shortname": "ArrayProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/array/proxy", + "namespace": "", + "file": "packages/@ember/array/proxy.ts", + "line": 59, + "description": "

An ArrayProxy wraps any other object that implements Array and/or\nMutableArray, forwarding all requests. This makes it very useful for\na number of binding use cases or other cases where being able to swap\nout the underlying array is useful.

\n

A simple example of usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({ content: A(pets) });\n\nap.get('firstObject');                        // 'dog'\nap.set('content', ['amoeba', 'paramecium']);\nap.get('firstObject');                        // 'amoeba'
\n
\n
\n \n

This class can also be useful as a layer to transform the contents of\nan array, as they are accessed. This can be done by overriding\nobjectAtContent:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({\n    content: A(pets),\n    objectAtContent: function(idx) {\n        return this.get('content').objectAt(idx).toUpperCase();\n    }\n});\n\nap.get('firstObject'); // . 'DOG'
\n
\n
\n \n

When overriding this class, it is important to place the call to\n_super after setting content so the internal observers have\na chance to fire properly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nexport default ArrayProxy.extend({\n  init() {\n    this.set('content', A(['dog', 'cat', 'fish']));\n    this._super(...arguments);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/array/proxy.ts", + "line": 138, + "description": "

Should actually retrieve the object at the specified index from the\ncontent. You can override this method in subclasses to transform the\ncontent item to something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "objectAtContent", + "params": [ + { + "name": "idx", + "description": "The index to retrieve.", + "type": "Number" + } + ], + "return": { + "description": "the value or undefined if none found", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/array/proxy.ts", + "line": 151, + "description": "

Should actually replace the specified objects on the content array.\nYou can override this method in subclasses to transform the content item\ninto something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "replaceContent", + "params": [ + { + "name": "idx", + "description": "The starting index", + "type": "Number" + }, + { + "name": "amt", + "description": "The number of items to remove from the content.", + "type": "Number" + }, + { + "name": "objects", + "description": "Optional array of objects to insert.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1484, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1503, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1520, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1538, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1560, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1577, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1593, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1609, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1625, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1642, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1659, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1668, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1686, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1703, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1712, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1729, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/proxy.ts", + "line": 120, + "description": "

The content array. Must be an object that implements Array and/or\nMutableArray.

\n", + "itemtype": "property", + "name": "content", + "type": "EmberArray", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/array/proxy.ts", + "line": 129, + "description": "

The array that the proxy pretends to be. In the default ArrayProxy\nimplementation, this and content are the same. Subclasses of ArrayProxy\ncan override this property to provide things like sorting and filtering.

\n", + "itemtype": "property", + "name": "arrangedContent", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/array/proxy", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-BasicContainer-2474d54d7c.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-BasicContainer-c6055a03a2.json similarity index 97% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-BasicContainer-2474d54d7c.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-BasicContainer-c6055a03a2.json index 846838818..465df8a6d 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-BasicContainer-2474d54d7c.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-BasicContainer-c6055a03a2.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-BasicContainer", + "id": "ember-4.10.0-BasicContainer", "type": "class", "attributes": { "name": "BasicContainer", @@ -81,19 +81,19 @@ "data": [ { "type": "class", - "id": "ember-4.12.1-ContainerProxy" + "id": "ember-4.10.0-ContainerProxy" } ] }, "module": { "data": { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.10.0-@ember/owner", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-BasicRegistry-fbe8c9119c.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-BasicRegistry-85657687ec.json similarity index 97% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-BasicRegistry-fbe8c9119c.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-BasicRegistry-85657687ec.json index e88484dc2..b5b3442aa 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-BasicRegistry-fbe8c9119c.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-BasicRegistry-85657687ec.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-BasicRegistry", + "id": "ember-4.10.0-BasicRegistry", "type": "class", "attributes": { "name": "BasicRegistry", @@ -60,19 +60,19 @@ "data": [ { "type": "class", - "id": "ember-4.12.1-RegistryProxy" + "id": "ember-4.10.0-RegistryProxy" } ] }, "module": { "data": { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.10.0-@ember/owner", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-Component-8eadf01636.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Component-8eadf01636.json new file mode 100644 index 000000000..c5a8b5cbf --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Component-8eadf01636.json @@ -0,0 +1,1587 @@ +{ + "data": { + "id": "ember-4.10.0-Component", + "type": "class", + "attributes": { + "name": "Component", + "shortname": "Component", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 39, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault component's for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Classic components. If you are looking for the\nAPI documentation for Template-only or Glimmer components, it is\navailable here.

\n

Defining a Classic Component

\n

If you want to customize the component in order to handle events, transform\narguments or maintain internal state, you implement a subclass of Component.

\n

One example is to add computed properties to your component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  displayName: computed('person.title', 'person.firstName', 'person.lastName', function() {\n    let { title, firstName, lastName } = this.person;\n\n    if (title) {\n      return `${title} ${lastName}`;\n    } else {\n      return `${firstName} ${lastName}`;\n    }\n  })\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

Customizing a Classic Component's HTML Element in JavaScript

\n

HTML Tag

\n

The default HTML tag name used for a component's HTML representation is div.\nThis can be customized by setting the tagName property.

\n

Consider the following component class:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
paragraph.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'em'\n});
\n
\n
\n \n

When invoked, this component would produce output that looks something like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<em id="ember1" class="ember-view"></em>
\n
\n
\n \n

HTML class Attribute

\n

The HTML class attribute of a component's tag can be set by providing a\nclassNames property that is set to an array of strings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class']\n});
\n
\n
\n \n

Invoking this component will produce output that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class"></div>
\n
\n
\n \n

class attribute values can also be set by providing a classNameBindings\nproperty set to an array of properties names for the component. The return\nvalue of these properties will be added as part of the value for the\ncomponents's class attribute. These properties can be computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class'],\n  classNameBindings: ['propertyA', 'propertyB'],\n\n  propertyA: 'from-a',\n  propertyB: computed(function() {\n    if (someLogic) { return 'from-b'; }\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

Note that classNames and classNameBindings is in addition to the class\nattribute passed with the angle bracket invocation syntax. Therefore, if this\ncomponent was invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyWidget class="from-invocation" />
\n
\n
\n \n

The resulting HTML will look similar to this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="from-invocation ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

If the value of a class name binding returns a boolean the property name\nitself will be used as the class name if the property is true. The class name\nwill not be added if the value is false or undefined.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['hovered'],\n\n  hovered: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view hovered"></div>
\n
\n
\n \n

Custom Class Names for Boolean Values

\n

When using boolean class name bindings you can supply a string value other\nthan the property name for use as the class HTML attribute by appending the\npreferred value after a ":" character when defining the binding:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['awesome:so-very-cool'],\n\n  awesome: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view so-very-cool"></div>
\n
\n
\n \n

Boolean value class name bindings whose property names are in a\ncamelCase-style format will be converted to a dasherized format:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isUrgent'],\n\n  isUrgent: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view is-urgent"></div>
\n
\n
\n \n

Class name bindings can also refer to object values that are found by\ntraversing a path relative to the component itself:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport EmberObject from '@ember/object';\n\nexport default Component.extend({\n  classNameBindings: ['messages.empty'],\n\n  messages: EmberObject.create({\n    empty: true\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view empty"></div>
\n
\n
\n \n

If you want to add a class name for a property which evaluates to true and\nand a different class name if it evaluates to false, you can pass a binding\nlike this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isEnabled:enabled:disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view enabled"></div>
\n
\n
\n \n

When isEnabled is false, the resulting HTML representation looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

This syntax offers the convenience to add a class if a property is false:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\n// Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\nexport default Component.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component when the isEnabled property is true will produce\nHTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view"></div>
\n
\n
\n \n

Invoking it when the isEnabled property on the component is false will\nproduce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

Updates to the value of a class name binding will result in automatic update\nof the HTML class attribute in the component's rendered HTML\nrepresentation. If the value becomes false or undefined the class name\nwill be removed.

\n

Both classNames and classNameBindings are concatenated properties. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Other HTML Attributes

\n

The HTML attribute section of a component's tag can be set by providing an\nattributeBindings property set to an array of property names on the component.\nThe return value of these properties will be used as the value of the component's\nHTML associated attribute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['href'],\n\n  href: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

One property can be mapped on to another by placing a ":" between\nthe source property and the destination property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['url:href'],\n\n  url: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

HTML attributes passed with angle bracket invocations will take precedence\nover those specified in attributeBindings. Therefore, if this component was\ninvoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyAnchor href="http://bing.com" @url="http://google.com" />
\n
\n
\n \n

The resulting HTML will looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://bing.com"></a>
\n
\n
\n \n

Note that the href attribute is ultimately set to http://bing.com,\ndespite it having attribute binidng to the url property, which was\nset to http://google.com.

\n

Namespaced attributes (e.g. xlink:href) are supported, but have to be\nmapped, since : is not a valid character for properties in Javascript:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
use.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'use',\n  attributeBindings: ['xlinkHref:xlink:href'],\n\n  xlinkHref: '#triangle'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<use xlink:href="#triangle"></use>
\n
\n
\n \n

If the value of a property monitored by attributeBindings is a boolean, the\nattribute will be present or absent depending on the value:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: false\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id="ember1" class="ember-view" />
\n
\n
\n \n

attributeBindings can refer to computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: computed(function() {\n    if (someLogic) {\n      return true;\n    } else {\n      return false;\n    }\n  })\n});
\n
\n
\n \n

To prevent setting an attribute altogether, use null or undefined as the\nvalue of the property used in attributeBindings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'form',\n  attributeBindings: ['novalidate'],\n  novalidate: null\n});
\n
\n
\n \n

Updates to the property of an attribute binding will result in automatic\nupdate of the HTML attribute in the component's HTML output.

\n

attributeBindings is a concatenated property. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Layouts

\n

The layout property can be used to dynamically specify a template associated\nwith a component class, instead of relying on Ember to link together a\ncomponent class and a template based on file names.

\n

In general, applications should not use this feature, but it's commonly used\nin addons for historical reasons.

\n

The layout property should be set to the default export of a template\nmodule, which is the name of a template file without the .hbs extension.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>Person's Title</h1>\n<div class='details'>{{yield}}</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n
  import Component from '@ember/component';\n  import layout from '../templates/components/person-profile';\n\n  export default Component.extend({\n    layout\n  });
\n
\n
\n \n

If you invoke the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile>\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</PersonProfile>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#person-profile}}\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n{{/person-profile}}
\n
\n
\n \n

It will result in the following HTML output:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<h1>Person's Title</h1>\n  <div class="details">\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</div>
\n
\n
\n \n

Handling Browser Events

\n

Components can respond to user-initiated events in one of three ways: passing\nactions with angle bracket invocation, adding event handler methods to the\ncomponent's class, or adding actions to the component's template.

\n

Passing Actions With Angle Bracket Invocation

\n

For one-off events specific to particular instance of a component, it is possible\nto pass actions to the component's element using angle bracket invocation syntax.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyWidget {{action 'firstWidgetClicked'}} />\n\n<MyWidget {{action 'secondWidgetClicked'}} />
\n
\n
\n \n

In this case, when the first component is clicked on, Ember will invoke the\nfirstWidgetClicked action. When the second component is clicked on, Ember\nwill invoke the secondWidgetClicked action instead.

\n

Besides {{action}}, it is also possible to pass any arbitrary element modifiers\nusing the angle bracket invocation syntax.

\n

Event Handler Methods

\n

Components can also respond to user-initiated events by implementing a method\nthat matches the event name. This approach is appropriate when the same event\nshould be handled by all instances of the same component.

\n

An event object will be passed as the argument to the event handler method.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click(event) {\n    // `event.target` is either the component's element or one of its children\n    let tag = event.target.tagName.toLowerCase();\n    console.log('clicked on a `<${tag}>` HTML element!');\n  }\n});
\n
\n
\n \n

In this example, whenever the user clicked anywhere inside the component, it\nwill log a message to the console.

\n

It is possible to handle event types other than click by implementing the\nfollowing event handler methods. In addition, custom events can be registered\nby using Application.customEvents.

\n

Touch events:

\n
    \n
  • touchStart
  • \n
  • touchMove
  • \n
  • touchEnd
  • \n
  • touchCancel
  • \n
\n

Keyboard events:

\n
    \n
  • keyDown
  • \n
  • keyUp
  • \n
  • keyPress
  • \n
\n

Mouse events:

\n
    \n
  • mouseDown
  • \n
  • mouseUp
  • \n
  • contextMenu
  • \n
  • click
  • \n
  • doubleClick
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
\n

Form events:

\n
    \n
  • submit
  • \n
  • change
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
  • input
  • \n
\n

Drag and drop events:

\n
    \n
  • dragStart
  • \n
  • drag
  • \n
  • dragEnter
  • \n
  • dragLeave
  • \n
  • dragOver
  • \n
  • dragEnd
  • \n
  • drop
  • \n
\n

{{action}} Helper

\n

Instead of handling all events of a particular type anywhere inside the\ncomponent's element, you may instead want to limit it to a particular\nelement in the component's template. In this case, it would be more\nconvenient to implement an action instead.

\n

For example, you could implement the action hello for the person-profile\ncomponent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  actions: {\n    hello(name) {\n      console.log("Hello", name);\n    }\n  }\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
<h1>{{@person.name}}</h1>\n\n<button {{action 'hello' @person.name}}>\n  Say Hello to {{@person.name}}\n</button>
\n
\n
\n \n

When the user clicks the button, Ember will invoke the hello action,\npassing in the current value of @person.name as an argument.

\n

See Ember.Templates.helpers.action.

\n", + "extends": "Ember.CoreView", + "uses": [ + "Ember.ViewStateSupport", + "Ember.ViewMixin", + "Ember.ActionSupport", + "Ember.ClassNamesSupport", + "Ember.TargetActionSupport" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 656, + "description": "

Called when the attributes passed into the component have been updated.\n Called both during the initial render of a container and during a rerender.\n Can be used in place of an observer; code placed here will be executed\n every time any attribute updates.

\n", + "itemtype": "method", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 677, + "description": "

Called after a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "method", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 694, + "description": "

Called before a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "method", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 711, + "description": "

Called when the attributes passed into the component have been changed.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 728, + "description": "

Called when the component is about to update and rerender itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 745, + "description": "

Called when the component has updated and rerendered itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 951, + "description": "

Normally, Ember's component model is "write-only". The component takes a\nbunch of attributes that it got passed in, and uses them to render its\ntemplate.

\n

One nice thing about this model is that if you try to set a value to the\nsame thing as last time, Ember (through HTMLBars) will avoid doing any\nwork on the DOM.

\n

This is not just a performance optimization. If an attribute has not\nchanged, it is important not to clobber the element's "hidden state".\nFor example, if you set an input's value to the same value as before,\nit will clobber selection state and cursor position. In other words,\nsetting an attribute is not always idempotent.

\n

This method provides a way to read an element's attribute and also\nupdate the last value Ember knows about at the same time. This makes\nsetting an attribute idempotent.

\n

In particular, what this means is that if you get an <input> element's\nvalue attribute and then re-render the template with the same value,\nit will avoid clobbering the cursor and selection position.\nSince most attribute sets are idempotent in the browser, you typically\ncan get away with reading attributes using jQuery, but the most reliable\nway to do so is through this method.

\n", + "itemtype": "method", + "name": "readDOMAttr", + "params": [ + { + "name": "name", + "description": "the name of the attribute", + "type": "String" + } + ], + "return": { + "description": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 36, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 58, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 78, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 110, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 153, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 162, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 177, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 193, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 209, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 77, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 93, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 121, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 141, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 181, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 246, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 331, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 405, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 439, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 52, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.TargetActionSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/mixin.ts", + "line": 425, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/mixin", + "inherited": true, + "inheritedFrom": "Mixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 667, + "description": "

Called when the attributes passed into the component have been updated.\n Called both during the initial render of a container and during a rerender.\n Can be used in place of an observer; code placed here will be executed\n every time any attribute updates.

\n", + "itemtype": "event", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 686, + "description": "

Called after a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "event", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 703, + "description": "

Called before a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "event", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 720, + "description": "

Called when the attributes passed into the component have been changed.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 737, + "description": "

Called when the component is about to update and rerender itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 754, + "description": "

Called when the component has updated and rerendered itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 300, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 308, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 321, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 345, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 358, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 366, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 762, + "description": "

The HTML id of the component's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent @elementId="a-really-cool-id" />
\n
\n
\n \n

If not manually set a default value will be provided by the framework.\nOnce rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
export default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    var index = this.get('index');\n    this.set('elementId', `component-id${index}`);\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1011, + "description": "

Layout can be used to wrap content in a component.

\n", + "itemtype": "property", + "name": "layout", + "type": "Function", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1019, + "description": "

The name of the layout to lookup if no layout is provided.\nBy default Component will lookup a template with this name in\nEmber.TEMPLATES (a shared global object).

\n", + "itemtype": "property", + "name": "layoutName", + "type": "String", + "default": "undefined", + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1030, + "description": "

The WAI-ARIA role of the control represented by this view. For example, a\n button may have a role of type 'button', or a pane may have a role of\n type 'alertdialog'. This property is used by assistive software to help\n visually challenged users navigate rich web applications.

\n

The full list of valid WAI-ARIA roles is available at:\n https://www.w3.org/TR/wai-aria/#roles_categorization

\n", + "itemtype": "property", + "name": "ariaRole", + "type": "String", + "default": "undefined", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1055, + "description": "

Enables components to take a list of parameters as arguments.\n For example, a component that takes two parameters with the names\n name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: ['name', 'age']\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" 38}}
\n
\n
\n \n

The parameters can be referred to just like named parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Name: {{name}}, Age: {{age}}.
\n
\n
\n \n

Using a string instead of an array allows for an arbitrary number of\n parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: 'names'\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" "Michael" "Scott"}}
\n
\n
\n \n

The parameters can then be referred to by enumerating over the list:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{#each names as |name|}}{{name}}{{/each}}
\n
\n
\n \n", + "static": 1, + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "positionalParams", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 38, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 35, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 166, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 267, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 378, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/child_views_support.ts", + "line": 14, + "description": "

Array of child views. You should never edit this array directly.

\n", + "itemtype": "property", + "name": "childViews", + "type": "Array", + "default": "[]", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 36, + "description": "

Standard CSS class names to apply to the view's outer element. This\nproperty automatically inherits any class names defined by the view's\nsuperclasses as well.

\n", + "itemtype": "property", + "name": "classNames", + "type": "Array", + "default": "['ember-view']", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 48, + "description": "

A list of properties of the view to apply as class names. If the property\nis a string value, the value of that string will be applied as a class\nname.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'high' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['priority'],\n  priority: 'high'\n});
\n
\n
\n \n

If the value of the property is a Boolean, the name of that property is\nadded as a dasherized class name.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'is-urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would prefer to use a custom value instead of the dasherized\nproperty name, you can pass a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent:urgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would like to specify a class that should only be added when the\nproperty is false, you can declare a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'disabled' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: false\n});
\n
\n
\n \n

This list of properties is inherited from the component's superclasses as well.

\n", + "itemtype": "property", + "name": "classNameBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-Ember.CoreView", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-ComputedProperty-787ea57d5f.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-ComputedProperty-59394376dc.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-ComputedProperty-787ea57d5f.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-ComputedProperty-59394376dc.json index ac188f14e..526953be9 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-ComputedProperty-787ea57d5f.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-ComputedProperty-59394376dc.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-ComputedProperty", + "id": "ember-4.10.0-ComputedProperty", "type": "class", "attributes": { "name": "ComputedProperty", @@ -66,13 +66,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/object", + "id": "ember-4.10.0-@ember/object", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Container-ebacd7be32.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Container-c271dbdd0e.json similarity index 98% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Container-ebacd7be32.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-Container-c271dbdd0e.json index b16a7eaa8..b8b33f128 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Container-ebacd7be32.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Container-c271dbdd0e.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Container", + "id": "ember-4.10.0-Container", "type": "class", "attributes": { "name": "Container", @@ -160,13 +160,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-rsvp", + "id": "ember-4.10.0-rsvp", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-ContainerDebugAdapter-78cbafd901.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-ContainerDebugAdapter-78cbafd901.json new file mode 100644 index 000000000..27edf8ce1 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-ContainerDebugAdapter-78cbafd901.json @@ -0,0 +1,592 @@ +{ + "data": { + "id": "ember-4.10.0-ContainerDebugAdapter", + "type": "class", + "attributes": { + "name": "ContainerDebugAdapter", + "shortname": "ContainerDebugAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug/container-debug-adapter", + "namespace": "", + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 13, + "description": "

The ContainerDebugAdapter helps the container and resolver interface\nwith tools that debug Ember such as the\nEmber Inspector\nfor Chrome and Firefox.

\n

This class can be extended by a custom resolver implementer\nto override some of the methods with library-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • canCatalogEntriesByType
  • \n
  • catalogEntriesByType
  • \n
\n

The adapter will need to be registered\nin the application's container as container-debug-adapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "containerDebugAdapter",\n\n  initialize(application) {\n    application.register('container-debug-adapter:main', require('app/container-debug-adapter'));\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "since": "1.5.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 64, + "description": "

Returns true if it is possible to catalog a list of available\nclasses in the resolver for a given type.

\n", + "itemtype": "method", + "name": "canCatalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "whether a list is available for this type.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug/container-debug-adapter" + }, + { + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 81, + "description": "

Returns the available classes a given type.

\n", + "itemtype": "method", + "name": "catalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "An array of strings.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug/container-debug-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 54, + "description": "

The resolver instance of the application\nbeing debugged. This property will be injected\non creation.

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug/container-debug-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/debug/container-debug-adapter", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-ContainerProxy-c9dce3e98b.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-ContainerProxy-601fcc1546.json similarity index 97% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-ContainerProxy-c9dce3e98b.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-ContainerProxy-601fcc1546.json index 66e1eee5e..215c746cb 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-ContainerProxy-c9dce3e98b.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-ContainerProxy-601fcc1546.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-ContainerProxy", + "id": "ember-4.10.0-ContainerProxy", "type": "class", "attributes": { "name": "ContainerProxy", @@ -79,7 +79,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-BasicContainer", + "id": "ember-4.10.0-BasicContainer", "type": "class" } }, @@ -87,19 +87,19 @@ "data": [ { "type": "class", - "id": "ember-4.12.1-ContainerProxyMixin" + "id": "ember-4.10.0-ContainerProxyMixin" } ] }, "module": { "data": { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.10.0-@ember/owner", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-ContainerProxyMixin-d884258c05.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-ContainerProxyMixin-17458cef2c.json similarity index 97% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-ContainerProxyMixin-d884258c05.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-ContainerProxyMixin-17458cef2c.json index bf7a59b6c..16dfe2d57 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-ContainerProxyMixin-d884258c05.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-ContainerProxyMixin-17458cef2c.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-ContainerProxyMixin", + "id": "ember-4.10.0-ContainerProxyMixin", "type": "class", "attributes": { "name": "ContainerProxyMixin", @@ -94,7 +94,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-ContainerProxy", + "id": "ember-4.10.0-ContainerProxy", "type": "class" } }, @@ -103,13 +103,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.10.0-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-CoreObject-6642193f5c.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-CoreObject-6642193f5c.json new file mode 100644 index 000000000..8496cd40c --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-CoreObject-6642193f5c.json @@ -0,0 +1,158 @@ +{ + "data": { + "id": "ember-4.10.0-CoreObject", + "type": "class", + "attributes": { + "name": "CoreObject", + "shortname": "CoreObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/core", + "namespace": "", + "file": "packages/@ember/object/core.ts", + "line": 171, + "description": "

CoreObject is the base class for all Ember constructs. It establishes a\nclass system based on Ember's Mixin system, and provides the basis for the\nEmber Object Model. CoreObject should generally not be used directly,\ninstead you should use EmberObject.

\n

Usage

\n

You can define a class by extending from CoreObject using the extend\nmethod:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Person = CoreObject.extend({\n  name: 'Tomster',\n});
\n
\n
\n \n

For detailed usage, see the Object Model\nsection of the guides.

\n

Usage with Native Classes

\n

Native JavaScript class syntax can be used to extend from any CoreObject\nbased class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
class Person extends CoreObject {\n  init() {\n    super.init(...arguments);\n    this.name = 'Tomster';\n  }\n}
\n
\n
\n \n

Some notes about class usage:

\n
    \n
  • new syntax is not currently supported with classes that extend from\nEmberObject or CoreObject. You must continue to use the create method\nwhen making new instances of classes, even if they are defined using native\nclass syntax. If you want to use new syntax, consider creating classes\nwhich do not extend from EmberObject or CoreObject. Ember features,\nsuch as computed properties and decorators, will still work with base-less\nclasses.
  • \n
  • Instead of using this._super(), you must use standard super syntax in\nnative classes. See the MDN docs on classes\nfor more details.
  • \n
  • Native classes support using constructors\nto set up newly-created instances. Ember uses these to, among other things,\nsupport features that need to retrieve other entities by name, like Service\ninjection and getOwner. To ensure your custom instance setup logic takes\nplace after this important work is done, avoid using the constructor in\nfavor of init.
  • \n
  • Properties passed to create will be available on the instance by the time\ninit runs, so any code that requires these values should work at that\ntime.
  • \n
  • Using native classes, and switching back to the old Ember Object model is\nfully supported.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.10.0-Helper" + }, + { + "type": "class", + "id": "ember-4.10.0-EmberObject" + } + ] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/object/core", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-DataAdapter-57dbc8e422.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-DataAdapter-57dbc8e422.json new file mode 100644 index 000000000..1de4fd2c8 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-DataAdapter-57dbc8e422.json @@ -0,0 +1,935 @@ +{ + "data": { + "id": "ember-4.10.0-DataAdapter", + "type": "class", + "attributes": { + "name": "DataAdapter", + "shortname": "DataAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug/data-adapter", + "namespace": "", + "file": "packages/@ember/debug/data-adapter.ts", + "line": 173, + "description": "

The DataAdapter helps a data persistence library\ninterface with tools that debug Ember such\nas the Ember Inspector\nfor Chrome and Firefox.

\n

This class will be extended by a persistence library\nwhich will override some of the methods with\nlibrary-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • getFilters
  • \n
  • detect
  • \n
  • columnsForType
  • \n
  • getRecords
  • \n
  • getRecordColumnValues
  • \n
  • getRecordKeywords
  • \n
  • getRecordFilterValues
  • \n
  • getRecordColor
  • \n
\n

The adapter will need to be registered\nin the application's container as dataAdapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "data-adapter",\n\n  initialize: function(application) {\n    application.register('data-adapter:main', DS.DataAdapter);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 300, + "description": "

Specifies how records can be filtered.\nRecords returned will need to have a filterValues\nproperty with a key for every name in the returned array.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getFilters", + "return": { + "description": "List of objects defining filters.\n The object should have a `name` and `desc` property.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 314, + "description": "

Fetch the model types and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchModelTypes", + "params": [ + { + "name": "typesAdded", + "description": "Callback to call to add types.\nTakes an array of objects containing wrapped types (returned from `wrapModelType`).", + "type": "Function" + }, + { + "name": "typesUpdated", + "description": "Callback to call when a type has changed.\nTakes an array of objects containing wrapped types.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 362, + "description": "

Fetch the records of a given type and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchRecords", + "params": [ + { + "name": "modelName", + "description": "The model name.", + "type": "String" + }, + { + "name": "recordsAdded", + "description": "Callback to call to add records.\nTakes an array of objects containing wrapped records.\nThe object should have the following properties:\n columnValues: {Object} The key and value of a table cell.\n object: {Object} The actual record object.", + "type": "Function" + }, + { + "name": "recordsUpdated", + "description": "Callback to call when a record has changed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + }, + { + "name": "recordsRemoved", + "description": "Callback to call when a record has removed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 434, + "description": "

Clear all observers before destruction

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 452, + "description": "

Detect whether a class is a model.

\n

Test that against the model class\nof your persistence library.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "detect", + "return": { + "description": "boolean Whether the class is a model class or not." + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 466, + "description": "

Get the columns for a given model type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "columnsForType", + "return": { + "description": "An array of columns of the following format:\n name: {String} The name of the column.\n desc: {String} Humanized description (what would show in a table column name).", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 479, + "description": "

Adds observers to a model type class.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "observeModelType", + "params": [ + { + "name": "modelName", + "description": "The model type name.", + "type": "String" + }, + { + "name": "typesUpdated", + "description": "Called when a type is modified.", + "type": "Function" + } + ], + "return": { + "description": "The function to call to remove observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 516, + "description": "

Wraps a given model type and observes changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapModelType", + "params": [ + { + "name": "klass", + "description": "A model class.", + "type": "Class" + }, + { + "name": "modelName", + "description": "Name of the class.", + "type": "String" + } + ], + "return": { + "description": "The wrapped type has the following format:\n name: {String} The name of the type.\n count: {Integer} The number of records available.\n columns: {Columns} An array of columns to describe the record.\n object: {Class} The actual Model type class.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 540, + "description": "

Fetches all models defined in the application.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getModelTypes", + "return": { + "description": "Array of model types.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 565, + "description": "

Loops over all namespaces and all objects\nattached to them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getObjectsOnNamespaces", + "return": { + "description": "Array of model type strings.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 594, + "description": "

Fetches all loaded records for a given type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecords", + "return": { + "description": "An array of records.\n This array will be observed for changes,\n so it should update when new records are added/removed.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 607, + "description": "

Wraps a record and observers changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapRecord", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The wrapped record. Format:\ncolumnValues: {Array}\nsearchKeywords: {Array}", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 627, + "description": "

Gets the values for each column.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColumnValues", + "return": { + "description": "Keys should match column names defined\nby the model type.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 639, + "description": "

Returns keywords to match when searching records.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordKeywords", + "return": { + "description": "Relevant keywords for search.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 650, + "description": "

Returns the values of filters defined by getFilters.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordFilterValues", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The filter values.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 662, + "description": "

Each record can have a color that represents its state.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColor", + "params": [ + { + "name": "record", + "description": "The record instance", + "type": "Object" + } + ], + "return": { + "description": "The records color.\n Possible options: black, red, blue, green.", + "type": "String" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 229, + "description": "

The container-debug-adapter which is used\nto list all models.

\n", + "itemtype": "property", + "name": "containerDebugAdapter", + "default": "undefined", + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 239, + "description": "

The number of attributes to send\nas columns. (Enough to make the record\nidentifiable).

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "attributeLimit", + "default": "3", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 251, + "description": "

Ember Data > v1.0.0-beta.18\nrequires string model names to be passed\naround instead of the actual factories.

\n

This is a stamp for the Ember Inspector\nto differentiate between the versions\nto be able to support older versions too.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "acceptsModelName", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 265, + "description": "

Map from records arrays to RecordsWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "recordsWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 273, + "description": "

Map from records arrays to TypeWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "typeWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 281, + "description": "

Callback that is currently scheduled on backburner end to flush and check\nall active watchers.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "flushWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 291, + "description": "

Stores all methods that clear observers.\nThese methods will be called on destruction.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "releaseMethods", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/debug/data-adapter", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.@ember/controller-a9cbed58ef.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.@ember/controller-a9cbed58ef.json new file mode 100644 index 000000000..1332fe60f --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.@ember/controller-a9cbed58ef.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.10.0-Ember.@ember/controller", + "type": "class", + "attributes": { + "name": "Ember.@ember/controller", + "shortname": "@ember/controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember/controller", + "namespace": "Ember", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 344, + "description": "

Creates a property that lazily looks up another controller in the container.\nCan only be used when defining another controller.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default class PostController extends Controller {\n  @controller posts;\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default Controller.extend({\n  posts: controller()\n});
\n
\n
\n \n

This example will create a posts property on the post controller that\nlooks up the posts controller in the container, making it easy to reference\nother controllers.

\n", + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the controller to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "Ember.@ember/controller", + "module": "ember/controller" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ActionHandler-0d6d68a9dd.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.ActionHandler-856e62296c.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ActionHandler-0d6d68a9dd.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.ActionHandler-856e62296c.json index b357c967b..2815f6cd6 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ActionHandler-0d6d68a9dd.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.ActionHandler-856e62296c.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.ActionHandler", + "id": "ember-4.10.0-Ember.ActionHandler", "type": "class", "attributes": { "name": "Ember.ActionHandler", @@ -73,13 +73,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.10.0-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.Controller-61c1867549.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.Controller-61c1867549.json new file mode 100644 index 000000000..c3ec2688e --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.Controller-61c1867549.json @@ -0,0 +1,729 @@ +{ + "data": { + "id": "ember-4.10.0-Ember.Controller", + "type": "class", + "attributes": { + "name": "Ember.Controller", + "shortname": "Controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember/controller", + "namespace": "Ember", + "file": "packages/@ember/controller/index.ts", + "line": 335, + "extends": "EmberObject", + "uses": [ + "Ember.ControllerMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 91, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 169, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 264, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 285, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 36, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 54, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 63, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.ControllerMixin-53e01dc81c.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.ControllerMixin-53e01dc81c.json new file mode 100644 index 000000000..5b46bd4f2 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.ControllerMixin-53e01dc81c.json @@ -0,0 +1,228 @@ +{ + "data": { + "id": "ember-4.10.0-Ember.ControllerMixin", + "type": "class", + "attributes": { + "name": "Ember.ControllerMixin", + "shortname": "Ember.ControllerMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.Controller" + ], + "module": "ember/controller", + "namespace": "Ember", + "file": "packages/@ember/controller/index.ts", + "line": 24, + "uses": [ + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 91, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 169, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 264, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 285, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 36, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 54, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 63, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.CoreView-958a0d615f.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.CoreView-958a0d615f.json new file mode 100644 index 000000000..43c5d5137 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.CoreView-958a0d615f.json @@ -0,0 +1,933 @@ +{ + "data": { + "id": "ember-4.10.0-Ember.CoreView", + "type": "class", + "attributes": { + "name": "Ember.CoreView", + "shortname": "Ember.CoreView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 9, + "description": "

Ember.CoreView is an abstract class that exists to give view-like behavior\nto both Ember's main view class Component and other classes that don't need\nthe full functionality of Component.

\n

Unless you have specific needs for CoreView, you will use Component\nin your applications.

\n", + "extends": "EmberObject", + "deprecated": true, + "deprecationMessage": "Use `Component` instead.", + "uses": [ + "Evented", + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 36, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 58, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 78, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 110, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 153, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 162, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 177, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 193, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 209, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 77, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 38, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.10.0-Component" + } + ] + }, + "module": { + "data": { + "id": "ember-4.10.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.EventDispatcher-cd779b9c4b.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.EventDispatcher-cd779b9c4b.json new file mode 100644 index 000000000..e08a507db --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.EventDispatcher-cd779b9c4b.json @@ -0,0 +1,659 @@ +{ + "data": { + "id": "ember-4.10.0-Ember.EventDispatcher", + "type": "class", + "attributes": { + "name": "Ember.EventDispatcher", + "shortname": "Ember.EventDispatcher", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 19, + "description": "

Ember.EventDispatcher handles delegating browser events to their\ncorresponding Ember.Views. For example, when you click on a view,\nEmber.EventDispatcher ensures that that view's mouseDown method gets\ncalled.

\n", + "access": "private", + "tagname": "", + "extends": "EmberObject", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 114, + "description": "

Sets up event listeners for standard browser events.

\n

This will be called after the browser sends a DOMContentReady event. By\ndefault, it will set up all of the listeners on the document body. If you\nwould like to register the listeners on a different element, set the event\ndispatcher's root property.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "params": [ + { + "name": "addedEvents", + "description": "", + "type": "Object" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 208, + "description": "

Setup event listeners for the given browser event name

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForBrowserEvent", + "params": [ + { + "name": "event", + "description": "the name of the event in the browser" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 221, + "description": "

Setup event listeners for the given Ember event name (camel case)

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForEmberEvent", + "params": [ + { + "name": "eventName", + "description": "" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 238, + "description": "

Registers an event listener on the rootElement. If the given event is\ntriggered, the provided event handler will be triggered on the target view.

\n

If the target view does not implement the event handler, or if the handler\nreturns false, the parent view will be called. The event will continue to\nbubble to each successive parent view until it reaches the top.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandler", + "params": [ + { + "name": "rootElement", + "description": "", + "type": "Element" + }, + { + "name": "event", + "description": "the name of the event in the browser", + "type": "String" + }, + { + "name": "eventName", + "description": "the name of the method to call on the view", + "type": "String" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/system/action_manager.ts", + "line": 9, + "description": "

Global action id hash.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registeredActions", + "type": "Object", + "class": "Ember.EventDispatcher", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 31, + "description": "

The set of events names (and associated handler function names) to be setup\nand dispatched by the EventDispatcher. Modifications to this list can be done\nat setup time, generally via the Application.customEvents hash.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "events", + "type": "Object", + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 91, + "description": "

The root DOM element to which event listeners should be attached. Event\nlisteners will be attached to the document unless this is overridden.

\n

Can be specified as a DOMElement or a selector string.

\n

The default body is a string since this may be evaluated before document.body\nexists in the DOM.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.NativeArray-acfee2da3d.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.NativeArray-3a5d219d3f.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.NativeArray-acfee2da3d.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.NativeArray-3a5d219d3f.json index 386fe7a5c..7ed8ce0f9 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.NativeArray-acfee2da3d.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.NativeArray-3a5d219d3f.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.NativeArray", + "id": "ember-4.10.0-Ember.NativeArray", "type": "class", "attributes": { "name": "Ember.NativeArray", @@ -1621,13 +1621,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.10.0-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.TargetActionSupport-c67dd9d325.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.TargetActionSupport-c67dd9d325.json new file mode 100644 index 000000000..3a40444b4 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.TargetActionSupport-c67dd9d325.json @@ -0,0 +1,101 @@ +{ + "data": { + "id": "ember-4.10.0-Ember.TargetActionSupport", + "type": "class", + "attributes": { + "name": "Ember.TargetActionSupport", + "shortname": "Ember.TargetActionSupport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 11, + "description": "

Ember.TargetActionSupport is a mixin that can be included in a class\nto add a triggerAction method with semantics similar to the Handlebars\n{{action}} helper. In normal Ember usage, the {{action}} helper is\nusually the best choice. This mixin is most often useful when you are\ndoing more complex event handling in Components.

\n", + "extends": "Mixin", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 52, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/object/mixin.ts", + "line": 425, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "@ember/object/mixin", + "inherited": true, + "inheritedFrom": "Mixin" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-Mixin", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Templates.components-2b8ad12ec2.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.Templates.components-2a77dfff4e.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Templates.components-2b8ad12ec2.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.Templates.components-2a77dfff4e.json index b974e0a0f..b8c55b37d 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Templates.components-2b8ad12ec2.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.Templates.components-2a77dfff4e.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.Templates.components", + "id": "ember-4.10.0-Ember.Templates.components", "type": "class", "attributes": { "name": "Ember.Templates.components", @@ -66,13 +66,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/routing", + "id": "ember-4.10.0-@ember/routing", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.Templates.helpers-2abf3fe060.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.Templates.helpers-2abf3fe060.json new file mode 100644 index 000000000..9b9d8c671 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.Templates.helpers-2abf3fe060.json @@ -0,0 +1,508 @@ +{ + "data": { + "id": "ember-4.10.0-Ember.Templates.helpers", + "type": "class", + "attributes": { + "name": "Ember.Templates.helpers", + "shortname": "Ember.Templates.helpers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 86, + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 45, + "description": "

See Ember.Templates.components.Input.

\n", + "itemtype": "method", + "name": "input", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 254, + "description": "

See Ember.Templates.components.LinkTo.

\n", + "itemtype": "method", + "name": "link-to", + "see": [ + "{Ember.Templates.components.LinkTo}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 122, + "description": "

See Ember.Templates.components.Textarea.

\n", + "itemtype": "method", + "name": "textarea", + "see": [ + "{Ember.Templates.components.Textarea}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/action.ts", + "line": 18, + "description": "

The {{action}} helper provides a way to pass triggers for behavior (usually\njust a function) between components, and into components from controllers.

\n

Passing functions with the action helper

\n

There are three contexts an action helper can be used in. The first two\ncontexts to discuss are attribute context, and Handlebars value context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>\n{{! Examples of Handlebars value context }}\n{{input on-input=(action "save")}}\n{{yield (action "refreshData") andAnotherParam}}
\n
\n
\n \n

In these contexts,\nthe helper is called a "closure action" helper. Its behavior is simple:\nIf passed a function name, read that function off the actions property\nof the current context. Once that function is read, or immediately if a function was\npassed, create a closure over that function and any arguments.\nThe resulting value of an action helper used this way is simply a function.

\n

For example, in the attribute context:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>
\n
\n
\n \n

The resulting template render logic would be:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
var div = document.createElement('div');\nvar actionFunction = (function(context){\n  return function() {\n    return context.actions.save.apply(context, arguments);\n  };\n})(context);\ndiv.onclick = actionFunction;
\n
\n
\n \n

Thus when the div is clicked, the action on that context is called.\nBecause the actionFunction is just a function, closure actions can be\npassed between components and still execute in the correct context.

\n

Here is an example action handler on a component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  save() {\n    this.model.save();\n  }\n}
\n
\n
\n \n

Actions are always looked up on the actions property of the current context.\nThis avoids collisions in the naming of common actions, such as destroy.\nTwo options can be passed to the action helper when it is used in this way.

\n
    \n
  • target=someProperty will look to someProperty instead of the current\ncontext for the actions hash. This can be useful when targeting a\nservice for actions.
  • \n
  • value="target.value" will read the path target.value off the first\nargument to the action when it is called and rewrite the first argument\nto be that value. This is useful when attaching actions to event listeners.
  • \n
\n

Invoking an action

\n

Closure actions curry both their scope and any arguments. When invoked, any\nadditional arguments are added to the already curried list.\nActions are presented in JavaScript as callbacks, and are\ninvoked like any other JavaScript function.

\n

For example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.hbs
1\n
{{input on-input=(action (action 'setName' @model) value="target.value")}}
\n
\n
\n \n

The first argument (@model) was curried over, and the run-time argument (event)\nbecomes a second argument. Action calls can be nested this way because each simply\nreturns a function. Any function can be passed to the {{action}} helper, including\nother actions.

\n

Actions invoked with sendAction have the same currying behavior as demonstrated\nwith on-input above. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyInput @submit={{action 'setName' @model}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-input submit=(action 'setName' @model)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    // Note that model is not passed, it was curried in the template\n    this.submit('bob');\n  }\n});
\n
\n
\n \n

Attaching actions to DOM elements

\n

The third context of the {{action}} helper can be called "element space".\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of element space }}\n<div {{action "save"}}></div>
\n
\n
\n \n

Used this way, the {{action}} helper provides a useful shortcut for\nregistering an HTML element in a template for a single DOM event and\nforwarding that interaction to the template's context (controller or component).\nIf the context of a template is a controller, actions used this way will\nbubble to routes when the controller does not implement the specified action.\nOnce an action hits a route, it will bubble through the route hierarchy.

\n

Event Propagation

\n

{{action}} helpers called in element space can control event bubbling. Note\nthat the closure style actions cannot.

\n

Events triggered through the action helper will automatically have\n.preventDefault() called on them. You do not need to do so in your event\nhandlers. If you need to allow event propagation (to handle file inputs for\nexample) you can supply the preventDefault=false option to the {{action}} helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<div {{action "sayHello" preventDefault=false}}>\n  <input type="file" />\n  <input type="checkbox" />\n</div>
\n
\n
\n \n

To disable bubbling, pass bubbles=false to the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<button {{action 'edit' post bubbles=false}}>Edit</button>
\n
\n
\n \n

To disable bubbling with closure style actions you must create your own\nwrapper helper that makes use of event.stopPropagation():

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div onclick={{disable-bubbling (action "sayHello")}}>Hello</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
bubbling.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { helper } from '@ember/component/helper';\n\nexport function disableBubbling([action]) {\n  return function(event) {\n    event.stopPropagation();\n    return action(event);\n  };\n}\nexport default helper(disableBubbling);
\n
\n
\n \n

If you need the default handler to trigger you should either register your\nown event handler, or use event methods on your view class. See\n"Responding to Browser Events"\nin the documentation for Component for more information.

\n

Specifying DOM event type

\n

{{action}} helpers called in element space can specify an event type.\nBy default the {{action}} helper registers for DOM click events. You can\nsupply an on option to the helper to specify a different DOM event name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" on="doubleClick"}}>\n  click me\n</div>
\n
\n
\n \n

See "Event Names" for a list of\nacceptable DOM event names.

\n

Specifying whitelisted modifier keys

\n

{{action}} helpers called in element space can specify modifier keys.\nBy default the {{action}} helper will ignore click events with pressed modifier\nkeys. You can supply an allowedKeys option to specify which keys should not be ignored.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="alt"}}>\n  click me\n</div>
\n
\n
\n \n

This way the action will fire when clicking with the alt key pressed down.\nAlternatively, supply "any" to the allowedKeys option to accept any combination of modifier keys.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="any"}}>\n  click me with any key pressed\n</div>
\n
\n
\n \n

Specifying a Target

\n

A target option can be provided to the helper to change\nwhich object will receive the method call. This option must be a path\nto an object, accessible in the current context:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<div {{action "anActionName" target=someService}}>\n  click me\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n
import Controller from '@ember/controller';\nimport { service } from '@ember/service';\n\nexport default class extends Controller {\n  @service someService;\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "action", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/array.ts", + "line": 5, + "description": "

Use the {{array}} helper to create an array to pass as an option to your\ncomponents.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<MyComponent @people={{array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson}}\n/>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{my-component people=(array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson)\n}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Tom Dale', 'Yehuda Katz', this.get('myOtherPerson')]
\n
\n
\n \n

Where the 3rd item in the array is bound to updates of the myOtherPerson property.

\n", + "itemtype": "method", + "name": "array", + "params": [ + { + "name": "options", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "Array", + "type": "Array" + }, + "since": "3.8.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/component.ts", + "line": 5, + "description": "

The {{component}} helper lets you add instances of Component to a\ntemplate. See Component for\nadditional information on how a Component functions.\n{{component}}'s primary use is for cases where you want to dynamically\nchange which type of component is rendered as the state of your application\nchanges. This helper has three modes: inline, block, and nested.

\n

Inline Form

\n

Given the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/application.hbs
1\n
{{component this.infographicComponentName}}
\n
\n
\n \n

And the following application code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Controller from '@ember/controller';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

The live-updating-chart component will be appended when isMarketOpen is\ntrue, and the market-close-summary component will be appended when\nisMarketOpen is false. If the value changes while the app is running,\nthe component will be automatically swapped out accordingly.\nNote: You should not use this helper when you are consistently rendering the same\ncomponent. In that case, use standard component syntax, for example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LiveUpdatingChart />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{live-updating-chart}}
\n
\n
\n \n

Block Form

\n

Using the block form of this helper is similar to using the block form\nof a component. Given the following application template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
{{#component this.infographicComponentName}}\n  Last update: {{this.lastUpdateTimestamp}}\n{{/component}}
\n
\n
\n \n

The following controller code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Controller from '@ember/controller';\nimport { computed } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get lastUpdateTimestamp() {\n    return new Date();\n  }\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

And the following component template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
chart.hbs
1\n2\n
{{! chart }}\n{{yield}}
\n
\n
\n \n

The Last Update: {{this.lastUpdateTimestamp}} will be rendered in place of the {{yield}}.

\n

Nested Usage

\n

The component helper can be used to package a component path with initial attrs.\nThe included attrs can then be merged during the final invocation.\nFor example, given a person-form component with the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.hbs
1\n2\n3\n
{{yield (hash\n  nameInput=(component "my-input-component" value=@model.name placeholder="First Name")\n)}}
\n
\n
\n \n

When yielding the component via the hash helper, the component is invoked directly.\nSee the following snippet:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonForm as |form|>\n  <form.nameInput @placeholder="Username" />\n</PersonForm>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-form as |form|}}\n  {{form.nameInput placeholder="Username"}}\n{{/person-form}}
\n
\n
\n \n

Which outputs an input whose value is already bound to model.name and placeholder\nis "Username".

\n

When yielding the component without the hash helper use the component helper.\nFor example, below is a full-name component template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{yield (component "my-input-component" value=@model.name placeholder="Name")}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<FullName as |field|>\n  {{component field placeholder="Full name"}}\n</FullName>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#full-name as |field|}}\n  {{component field placeholder="Full name"}}\n{{/full-name}}
\n
\n
\n \n", + "itemtype": "method", + "name": "component", + "since": "1.11.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/concat.ts", + "line": 5, + "description": "

Concatenates the given arguments into a string.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{some-component name=(concat firstName " " lastName)}}\n\n{{! would pass name="<first name value> <last name value>" to the component}}
\n
\n
\n \n

or for angle bracket invocation, you actually don't need concat at all.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @name="{{firstName}} {{lastName}}" />
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "concat", + "since": "1.13.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 13, + "description": "

The {{#each}} helper loops over elements in a collection. It is an extension\nof the base Handlebars {{#each}} helper.

\n

The default behavior of {{#each}} is to yield its inner block once for every\nitem in an array passing the item as the first block parameter.

\n

Assuming the @developers argument contains this array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
[{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }];
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

The same rules apply to arrays of primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Yehuda', 'Tom', 'Paul']
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developerNames as |name|}}\n    <li>Hello, {{name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

During iteration, the index of each item in the array is provided as a second block\nparameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person index|}}\n    <li>Hello, {{person.name}}! You're number {{index}} in line</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

Specifying Keys

\n

In order to improve rendering speed, Ember will try to reuse the DOM elements\nwhere possible. Specifically, if the same item is present in the array both\nbefore and after the change, its DOM output will be reused.

\n

The key option is used to tell Ember how to determine if the items in the\narray being iterated over with {{#each}} has changed between renders. By\ndefault the item's object identity is used.

\n

This is usually sufficient, so in most cases, the key option is simply not\nneeded. However, in some rare cases, the objects' identities may change even\nthough they represent the same underlying data.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
people.map(person => {\n  return { ...person, type: 'developer' };\n});
\n
\n
\n \n

In this case, each time the people array is map-ed over, it will produce\nan new array with completely different objects between renders. In these cases,\nyou can help Ember determine how these objects related to each other with the\nkey option:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers key="name" as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

By doing so, Ember will use the value of the property specified (person.name\nin the example) to find a "match" from the previous render. That is, if Ember\nhas previously seen an object from the @developers array with a matching\nname, its DOM elements will be re-used.

\n

There are two special values for key:

\n
    \n
  • @index - The index of the item in the array.
  • \n
  • @identity - The item in the array itself.
  • \n
\n

{{else}} condition

\n

{{#each}} can have a matching {{else}}. The contents of this block will render\nif the collection is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<ul>\n  {{#each @developers as |person|}}\n    <li>{{person.name}} is available!</li>\n  {{else}}\n    <li>Sorry, nobody is available for this task.</li>\n  {{/each}}\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 124, + "description": "

The {{each-in}} helper loops over properties on an object.

\n

For example, given this component definition:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    "name": "Shelly Sails",\n    "age": 42\n  };\n}
\n
\n
\n \n

This template would display all properties on the developer\nobject in a list:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.hbs
1\n2\n3\n4\n5\n
<ul>\n  {{#each-in this.developer as |key value|}}\n    <li>{{key}}: {{value}}</li>\n  {{/each-in}}\n</ul>
\n
\n
\n \n

Outputting their name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<ul>\n  <li>name: Shelly Sails</li>\n  <li>age: 42</li>\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each-in", + "access": "public", + "tagname": "", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/fn.ts", + "line": 5, + "description": "

The fn helper allows you to ensure a function that you are passing off\nto another component, helper, or modifier has access to arguments that are\navailable in the template.

\n

For example, if you have an each helper looping over a number of items, you\nmay need to pass a function that expects to receive the item as an argument\nto a component invoked within the loop. Here's how you could use the fn\nhelper to pass both the function and its arguments together:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
listing.hbs
1\n2\n3\n
{{#each @items as |item|}}\n<DisplayItem @item=item @select={{fn this.handleSelected item}} />\n{{/each}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class ItemsList extends Component {\n  @action\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this case the display-item component will receive a normal function\nthat it can invoke. When it invokes the function, the handleSelected\nfunction will receive the item and any arguments passed, thanks to the\nfn helper.

\n

Let's take look at what that means in a couple circumstances:

\n
    \n
  • When invoked as this.args.select() the handleSelected function will\nreceive the item from the loop as its first and only argument.
  • \n
  • When invoked as this.args.select('foo') the handleSelected function\nwill receive the item from the loop as its first argument and the\nstring 'foo' as its second argument.
  • \n
\n

In the example above, we used @action to ensure that handleSelected is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class ItemsList extends Component {\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when handleSelected is invoked inside the display-item\ncomponent, it will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into fn!

\n

See also partial application.

\n", + "itemtype": "method", + "name": "fn", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/get.ts", + "line": 5, + "description": "

Dynamically look up a property on an object or an element in an array.\nThe second argument to {{get}} should have a string or number value,\nalthough it can be bound.

\n

For example, these two usages are equivalent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{this.developer.name}}\n{{get this.developer "name"}}
\n
\n
\n \n

If there were several facts about a person, the {{get}} helper can dynamically\npick one:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<DeveloperDetail @factName="language" />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.developer @factName}}
\n
\n
\n \n

For a more complex example, this template would allow the user to switch\nbetween showing the user's name and preferred coding language with a click:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n\n  @tracked currentFact = 'name'\n\n  @action\n  showFact(fact) {\n    this.currentFact = fact;\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
{{get this.developer this.currentFact}}\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

The {{get}} helper can also respect mutable values itself. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
<Input @value={{mut (get this.person this.currentFact)}} />\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

Would allow the user to swap what fact is being displayed, and also edit\nthat fact via a two-way mutable binding.

\n

The {{get}} helper can also be used for array element access via index.\nThis would display the value of the first element in the array this.names:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names 0}}
\n
\n
\n \n

Array element access also works with a dynamic second argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names @index}}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "get", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/hash.ts", + "line": 5, + "description": "

Use the {{hash}} helper to create a hash to pass as an option to your\ncomponents. This is specially useful for contextual components where you can\njust yield a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{yield (hash\n   name='Sarah'\n   title=office\n)}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ name: 'Sarah', title: this.get('office') }
\n
\n
\n \n

Where the title is bound to updates of the office property.

\n

Note that the hash is an empty object with no prototype chain, therefore\ncommon methods like toString are not available in the resulting hash.\nIf you need to use such a method, you can use the call or apply\napproach:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
function toString(obj) {\n  return Object.prototype.toString.apply(obj);\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "Hash", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/helper.ts", + "line": 5, + "description": "

Use the {{helper}} helper to create contextual helper so\nthat it can be passed around as first-class values in templates.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let (helper "join-words" "foo" "bar" separator=" ") as |foo-bar|}}\n\n  {{!-- this is equivalent to invoking `{{join-words "foo" "bar" separator=" "}}` --}}\n  {{foo-bar}}\n\n  {{!-- this will pass the helper itself into the component, instead of invoking it now --}}\n  <MyComponent @helper={{helper foo-bar "baz"}} />\n\n  {{!-- this will yield the helper itself ("contextual helper"), instead of invoking it now --}}\n  {{yield foo-bar}}\n{{/let}}
\n
\n
\n \n

Arguments

\n

The {{helper}} helper works similarly to the {{component}} and\n{{modifier}} helper:

\n
    \n
  • When passed a string (e.g. (helper "foo")) as the first argument,\nit will produce an opaque, internal "helper definition" object\nthat can be passed around and invoked elsewhere.

    \n
  • \n
  • Any additional positional and/or named arguments (a.k.a. params and hash)\nwill be stored ("curried") inside the definition object, such that, when invoked,\nthese arguments will be passed along to the referenced helper.

    \n
  • \n
\n", + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "3.27.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 5, + "description": "

The if helper allows you to conditionally render one of two branches,\ndepending on the "truthiness" of a property.\nFor example the following values are all falsey: false, undefined, null, "", 0, NaN or an empty array.

\n

This helper has two forms, block and inline.

\n

Block form

\n

You can use the block form of if to conditionally render a section of the template.

\n

To use it, pass the conditional value to the if helper,\nusing the block form to wrap the section of template you want to conditionally render.\nLike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n
{{! will not render because greeting is undefined}}\n{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{/if}}
\n
\n
\n \n

You can also define what to show if the property is falsey by using\nthe else helper.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n
{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{else}}\n  No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

You are also able to combine else and if helpers to create more complex\nconditional logic.

\n

For the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if @isRaining}}\n Yes, grab an umbrella!\n{{else if @isCold}}\n Grab a coat, it's chilly!\n{{else}}\n No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

If you call it by saying isCold is true:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather @isCold={{true}} />
\n
\n
\n \n

Then Grab a coat, it's chilly! will be rendered.

\n

Inline form

\n

The inline if helper conditionally renders a single property or string.

\n

In this form, the if helper receives three arguments, the conditional value,\nthe value to render when truthy, and the value to render when falsey.

\n

For example, if useLongGreeting is truthy, the following:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{true}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{if @useLongGreeting "Hello" "Hi"}} Alex
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hello Alex
\n
\n
\n \n

One detail to keep in mind is that both branches of the if helper will be evaluated,\nso if you have {{if condition "foo" (expensive-operation "bar"),\nexpensive-operation will always calculate.

\n", + "itemtype": "method", + "name": "if", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 97, + "description": "

The unless helper is the inverse of the if helper. It displays if a value\nis falsey ("not true" or "is false"). Example values that will display with\nunless: false, undefined, null, "", 0, NaN or an empty array.

\n

Inline form

\n

The inline unless helper conditionally renders a single property or string.\nThis helper acts like a ternary operator. If the first property is falsy,\nthe second argument will be displayed, otherwise, the third argument will be\ndisplayed

\n

For example, if you pass a falsey useLongGreeting to the Greeting component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{false}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{unless @useLongGreeting "Hi" "Hello"}} Ben
\n
\n
\n \n

Then it will display:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hi Ben
\n
\n
\n \n

Block form

\n

Like the if helper, the unless helper also has a block form.

\n

The following will not render anything:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n2\n3\n
{{#unless @greeting}}\n  No greeting was found. Why not set one?\n{{/unless}}
\n
\n
\n \n

You can also use an else helper with the unless block. The\nelse will display if the value is truthy.

\n

If you have the following component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
in.hbs
1\n2\n3\n4\n5\n
{{#unless @userData}}\n  Please login.\n{{else}}\n  Welcome back!\n{{/unless}}
\n
\n
\n \n

Calling it with a truthy userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{hash username="Zoey"}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Welcome back!
\n
\n
\n \n

and calling it with a falsey userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{false}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Please login.
\n
\n
\n \n", + "itemtype": "method", + "name": "unless", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/log.ts", + "line": 5, + "description": "

log allows you to output the value of variables in the current rendering\ncontext. log also accepts primitive types such as strings or numbers.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{log "myVariable:" myVariable }}
\n
\n
\n \n", + "itemtype": "method", + "name": "log", + "params": [ + { + "name": "params", + "description": "", + "type": "Array" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/modifier.ts", + "line": 5, + "description": "

Use the {{modifier}} helper to create contextual modifier so\nthat it can be passed around as first-class values in templates.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let (modifier "click-outside" click=this.submit) as |on-click-outside|}}\n\n  {{!-- this is equivalent to `<MyComponent {{click-outside click=this.submit}} />` --}}\n  <MyComponent {{on-click-outside}} />\n\n  {{!-- this will pass the modifier itself into the component, instead of invoking it now --}}\n  <MyComponent @modifier={{modifier on-click-outside "extra" "args"}} />\n\n  {{!-- this will yield the modifier itself ("contextual modifier"), instead of invoking it now --}}\n  {{yield on-click-outside}}\n{{/let}}
\n
\n
\n \n

Arguments

\n

The {{modifier}} helper works similarly to the {{component}} and\n{{helper}} helper:

\n
    \n
  • When passed a string (e.g. (modifier "foo")) as the first argument,\nit will produce an opaque, internal "modifier definition" object\nthat can be passed around and invoked elsewhere.

    \n
  • \n
  • Any additional positional and/or named arguments (a.k.a. params and hash)\nwill be stored ("curried") inside the definition object, such that, when invoked,\nthese arguments will be passed along to the referenced modifier.

    \n
  • \n
\n", + "itemtype": "method", + "name": "modifier", + "access": "public", + "tagname": "", + "since": "3.27.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/mut.ts", + "line": 9, + "description": "

The mut helper lets you clearly specify that a child Component can update the\n(mutable) value passed to it, which will change the value of the parent component.

\n

To specify that a parameter is mutable, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{fn (mut totalClicks)}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(mut totalClicks)}}
\n
\n
\n \n

The child Component can then modify the parent's value just by modifying its own\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

Note that for curly components ({{my-component}}) the bindings are already mutable,\nmaking the mut unnecessary.

\n

Additionally, the mut helper can be combined with the fn helper to\nmutate a value. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=totalClicks click-count-change=(fn (mut totalClicks))}}
\n
\n
\n \n

The child Component would invoke the function with the new click value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.get('click-count-change')(this.get('childClickCount') + 1);\n  }\n});
\n
\n
\n \n

The mut helper changes the totalClicks value to what was provided as the fn argument.

\n

The mut helper, when used with fn, will return a function that\nsets the value passed to mut to its first argument. As an example, we can create a\nbutton that increments a value passing the value directly to the fn:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{! inc helper is not provided by Ember }}\n<button onclick={{fn (mut count) (inc count)}}>\n  Increment count\n</button>
\n
\n
\n \n", + "itemtype": "method", + "name": "mut", + "params": [ + { + "name": "attr", + "description": "the \"two-way\" attribute that can be modified.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/page-title.ts", + "line": 5, + "description": "

page-title allows you to set the title of any page in your application and\nappend additional titles for each route. For complete documentation, see\nhttps://github.com/ember-cli/ember-page-title.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{page-title "My Page Title" }}
\n
\n
\n \n", + "itemtype": "method", + "name": "page-title", + "params": [ + { + "name": "param", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/readonly.ts", + "line": 9, + "description": "

The readonly helper let's you specify that a binding is one-way only,\ninstead of two-way.\nWhen you pass a readonly binding from an outer context (e.g. parent component),\nto to an inner context (e.g. child component), you are saying that changing that\nproperty in the inner context does not change the value in the outer context.

\n

To specify that a binding is read-only, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n
export default Component.extend({\n  totalClicks: 3\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} // -> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Now, when you update childClickCount:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n
export default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

The value updates in the child component, but not the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClickCount}} //-> 4
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Objects and Arrays

\n

When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string),\nonly the reference to the object is protected using the readonly helper.\nThis means that you can change properties of the object both on the parent component, as well as the child component.\nThe readonly binding behaves similar to the const keyword in JavaScript.

\n

Let's look at an example:

\n

First let's set up the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  clicks: null,\n\n  init() {\n    this._super(...arguments);\n    this.set('clicks', { total: 3 });\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n

Now, if you update the total property of childClicks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    this.get('clicks').incrementProperty('total');\n  }\n});
\n
\n
\n \n

You will see the following happen:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClicks.total}} //-> 4
\n
\n
\n \n", + "itemtype": "method", + "name": "readonly", + "params": [ + { + "name": "attr", + "description": "the read-only attribute.", + "type": "Object", + "optional": true + } + ], + "access": "private", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unbound.ts", + "line": 10, + "description": "

The {{unbound}} helper disconnects the one-way binding of a property,\nessentially freezing its value at the moment of rendering. For example,\nin this example the display of the variable name will not change even\nif it is set with a new value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{unbound this.name}}
\n
\n
\n \n

Like any helper, the unbound helper can accept a nested helper expression.\nThis allows for custom helpers to be rendered unbound:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{unbound (some-custom-helper)}}\n{{unbound (capitalize this.name)}}\n{{! You can use any helper, including unbound, in a nested expression }}\n{{capitalize (unbound this.name)}}
\n
\n
\n \n

The unbound helper only accepts a single argument, and it return an\nunbound value.

\n", + "itemtype": "method", + "name": "unbound", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts", + "line": 5, + "description": "

Use the {{unique-id}} helper to generate a unique ID string suitable for use as\nan ID attribute in the DOM.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id={{unique-id}} type="email" />
\n
\n
\n \n

Each 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#let (unique-id) as |emailId|}}\n  <label for={{emailId}}>Email address</label>\n  <input id={{emailId}} type="email" />\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "unique-id", + "since": "4.4.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/modifiers/on.ts", + "line": 5, + "description": "

The {{on}} modifier lets you easily add event listeners (it uses\nEventTarget.addEventListener\ninternally).

\n

For example, if you'd like to run a function on your component when a <button>\nin the components template is clicked you might do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' this.saveLike}}>Like this post!</button>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class LikePostComponent extends Component {\n  @action\n  saveLike() {\n    // someone likes your post!\n    // better send a request off to your server...\n  }\n}
\n
\n
\n \n

Arguments

\n

{{on}} accepts two positional arguments, and a few named arguments.

\n

The positional arguments are:

\n
    \n
  • event -- the name to use when calling addEventListener
  • \n
  • callback -- the function to be passed to addEventListener
  • \n
\n

The named arguments are:

\n
    \n
  • capture -- a true value indicates that events of this type will be dispatched\nto the registered listener before being dispatched to any EventTarget beneath it\nin the DOM tree.
  • \n
  • once -- indicates that the listener should be invoked at most once after being\nadded. If true, the listener would be automatically removed when invoked.
  • \n
  • passive -- if true, indicates that the function specified by listener will never\ncall preventDefault(). If a passive listener does call preventDefault(), the user\nagent will do nothing other than generate a console warning. See\nImproving scrolling performance with passive listeners\nto learn more.
  • \n
\n

The callback function passed to {{on}} will receive any arguments that are passed\nto the event handler. Most commonly this would be the event itself.

\n

If you would like to pass additional arguments to the function you should use\nthe {{fn}} helper.

\n

For example, in our example case above if you'd like to pass in the post that\nwas being liked when the button is clicked you could do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' (fn this.saveLike @post)}}>Like this post!</button>
\n
\n
\n \n

In this case, the saveLike function will receive two arguments: the click event\nand the value of @post.

\n

Function Context

\n

In the example above, we used @action to ensure that likePost is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class LikePostComponent extends Component {\n  saveLike() {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when the button is clicked saveLike will be invoked,\nit will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into on!

\n", + "itemtype": "method", + "name": "on", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/in-element.ts", + "line": 5, + "description": "

The in-element helper renders its block content outside of the regular flow,\ninto a DOM element given by its destinationElement positional argument.

\n

Common use cases - often referred to as "portals" or "wormholes" - are rendering\ndropdowns, modals or tooltips close to the root of the page to bypass CSS overflow\nrules, or to render content to parts of the page that are outside of the control\nof the Ember app itself (e.g. embedded into a static or server rendered HTML page).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#in-element this.destinationElement}}\n  <div>Some content</div>\n{{/in-element}}
\n
\n
\n \n

Arguments

\n

{{in-element}} requires a single positional argument:

\n
    \n
  • destinationElement -- the DOM element to render into. It must exist at the time\nof rendering.
  • \n
\n

It also supports an optional named argument:

\n
    \n
  • insertBefore -- by default the DOM element's content is replaced when used as\ndestinationElement. Passing null to insertBefore changes the behaviour to\nappend the block content to the end of any existing content. Any other value than\nnull is currently not supported.

    \n

    For example:

    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    1\n2\n3\n
    {{#in-element this.destinationElement insertBefore=null}}\n  <div>Some content</div>\n{{/in-element}}
    \n
    \n
    \n \n
  • \n
\n", + "itemtype": "method", + "name": "in-element", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/let.ts", + "line": 5, + "description": "

The let helper receives one or more positional arguments and yields\nthem out as block params.

\n

This allows the developer to introduce shorter names for certain computations\nin the template.

\n

This is especially useful if you are passing properties to a component\nthat receives a lot of options and you want to clean up the invocation.

\n

For the following example, the template receives a post object with\ncontent and title properties.

\n

We are going to call the my-post component, passing a title which is\nthe title of the post suffixed with the name of the blog, the content\nof the post, and a series of options defined in-place.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n    (concat post.title ' | The Ember.js Blog')\n    post.content\n    (hash\n      theme="high-contrast"\n      enableComments=true\n    )\n    as |title content options|\n}}\n  <MyPost @title={{title}} @content={{content}} @options={{options}} />\n{{/let}}
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n  (concat post.title ' | The Ember.js Blog')\n  post.content\n  (hash\n    theme="high-contrast"\n    enableComments=true\n  )\n  as |title content options|\n}}\n{{my-post title=title content=content options=options}}\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "let", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/mount.ts", + "line": 16, + "description": "

The {{mount}} helper lets you embed a routeless engine in a template.\nMounting an engine will cause an instance to be booted and its application\ntemplate to be rendered.

\n

For example, the following template mounts the ember-chat engine:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! application.hbs }}\n{{mount "ember-chat"}}
\n
\n
\n \n

Additionally, you can also pass in a model argument that will be\nset as the engines model. This can be an existing object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div>\n  {{mount 'admin' model=userSettings}}\n</div>
\n
\n
\n \n

Or an inline hash, and you can even pass components:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>\n  <h1>Application template!</h1>\n  {{mount 'admin' model=(hash\n      title='Secret Admin'\n      signInButton=(component 'sign-in-button')\n  )}}\n</div>
\n
\n
\n \n", + "itemtype": "method", + "name": "mount", + "params": [ + { + "name": "name", + "description": "Name of the engine to mount.", + "type": "String" + }, + { + "name": "model", + "description": "Object that will be set as\n the model of the engine.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/outlet.ts", + "line": 22, + "description": "

The {{outlet}} helper lets you specify where a child route will render in\nyour template. An important use of the {{outlet}} helper is in your\napplication's application.hbs file:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n7\n8\n
<MyHeader />\n\n<div class="my-dynamic-content">\n  <!-- this content will change based on the current route, which depends on the current URL -->\n  {{outlet}}\n</div>\n\n<MyFooter />
\n
\n
\n \n

See the routing guide for more\ninformation on how your route interacts with the {{outlet}} helper.\nNote: Your content will not render if there isn't an {{outlet}} for it.

\n", + "itemtype": "method", + "name": "outlet", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 91, + "description": "

{{yield}} denotes an area of a template that will be rendered inside\nof another template.

\n

Use with Component

\n

When designing components {{yield}} is used to denote where, inside the component's\ntemplate, an optional block passed to the component should render:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<LabeledTextfield @value={{@model.name}}>\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<label>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n

Additionally you can yield properties into the context for use by the consumer:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n
<LabeledTextfield @value={{@model.validation}} @validator={{this.firstNameValidator}} as |validationError|>\n  {{#if validationError}}\n    <p class="error">{{validationError}}</p>\n  {{/if}}\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield this.validationError}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<label>\n  <p class="error">First Name must be at least 3 characters long.</p>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n

yield can also be used with the hash helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n
<DateRanges @value={{@model.date}} as |range|>\n  Start date: {{range.start}}\n  End date: {{range.end}}\n</DateRanges>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
ranges.hbs
1\n2\n3\n
<div>\n  {{yield (hash start=@value.start end=@value.end)}}\n</div>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<div>\n  Start date: July 1st\n  End date: July 30th\n</div>
\n
\n
\n \n

Multiple values can be yielded as block params:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |title subtitle body|>\n  <h1>{{title}}</h1>\n  <h2>{{subtitle}}</h2>\n  {{body}}\n</Banner>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner.hbs
1\n2\n3\n
<div>\n  {{yield "Hello title" "hello subtitle" "body text"}}\n</div>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h1>Hello title</h1>\n  <h2>hello subtitle</h2>\n  body text\n</div>
\n
\n
\n \n

However, it is preferred to use the hash helper, as this can prevent breaking changes to your component and also simplify the api for the component.

\n

Multiple components can be yielded with the hash and component helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |banner|>\n  <banner.Title>Banner title</banner.Title>\n  <banner.Subtitle>Banner subtitle</banner.Subtitle>\n  <banner.Body>A load of body text</banner.Body>\n</Banner>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Title from './banner/title';\nimport Subtitle from './banner/subtitle';\nimport Body from './banner/body';\n\nexport default class Banner extends Component {\n  Title = Title;\n  Subtitle = Subtitle;\n  Body = Body;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner.hbs
1\n2\n3\n4\n5\n6\n7\n
<div>\n  {{yield (hash\n    Title=this.Title\n    Subtitle=this.Subtitle\n    Body=(component this.Body defaultArg="some value")\n  )}}\n</div>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h1>Banner title</h1>\n  <h2>Banner subtitle</h2>\n  A load of body text\n</div>
\n
\n
\n \n

A benefit of using this pattern is that the user of the component can change the order the components are displayed.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |banner|>\n  <banner.Subtitle>Banner subtitle</banner.Subtitle>\n  <banner.Title>Banner title</banner.Title>\n  <banner.Body>A load of body text</banner.Body>\n</Banner>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h2>Banner subtitle</h2>\n  <h1>Banner title</h1>\n  A load of body text\n</div>
\n
\n
\n \n

Another benefit to using yield with the hash and component helper\nis you can pass attributes and arguments to these components:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |banner|>\n  <banner.Subtitle class="mb-1">Banner subtitle</banner.Subtitle>\n  <banner.Title @variant="loud">Banner title</banner.Title>\n  <banner.Body>A load of body text</banner.Body>\n</Banner>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner/subtitle.hbs
1\n2\n3\n4\n
{{!-- note the use of ..attributes --}}\n<h2 ...attributes>\n  {{yield}}\n</h2>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner/title.hbs
1\n2\n3\n4\n5\n
{{#if (eq @variant "loud")}}\n    <h1 class="loud">{{yield}}</h1>\n{{else}}\n    <h1 class="quiet">{{yield}}</h1>\n{{/if}}
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h2 class="mb-1">Banner subtitle</h2>\n  <h1 class="loud">Banner title</h1>\n  A load of body text\n</div>
\n
\n
\n \n", + "itemtype": "method", + "name": "yield", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "return": { + "description": "HTML string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 303, + "description": "

{{(has-block)}} indicates if the component was invoked with a block.

\n

This component is invoked with a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component}}
\n
\n
\n \n

Using angle bracket invocation, this looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent>Hi Jen!</MyComponent> {{! with a block}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent/> {{! without a block}}
\n
\n
\n \n

This is useful when you want to create a component that can optionally take a block\nand then render a default template when it is not invoked with a block.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n
{{#if (has-block)}}\n  Welcome {{yield}}, we are happy you're here!\n{{else}}\n  Hey you! You're great!\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with a block", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 348, + "description": "

{{(has-block-params)}} indicates if the component was invoked with block params.

\n

This component is invoked with block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component as |favoriteFlavor|}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jenn!\n{{/my-component}}
\n
\n
\n \n

With angle bracket syntax, block params look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent as |favoriteFlavor|>\nHi Jen!\n</MyComponent>
\n
\n
\n \n

And without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent>\n  Hi Jen!\n</MyComponent>
\n
\n
\n \n

This is useful when you want to create a component that can render itself\ndifferently when it is not invoked with block params.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if (has-block-params)}}\n  Welcome {{yield this.favoriteFlavor}}, we're happy you're here and hope you\n  enjoy your favorite ice cream flavor.\n{{else}}\n  Welcome {{yield}}, we're happy you're here, but we're unsure what\n  flavor ice cream you would enjoy.\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block-params", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with block params", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 403, + "description": "

Execute the debugger statement in the current template's context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{debugger}}
\n
\n
\n \n

When using the debugger helper you will have access to a get function. This\nfunction retrieves values available in the context of the template.\nFor example, if you're wondering why a value {{foo}} isn't rendering as\nexpected within a template, you could place a {{debugger}} statement and,\nwhen the debugger; breakpoint is hit, you can attempt to retrieve this value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('foo')
\n
\n
\n \n

get is also aware of keywords. So in this situation

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#each this.items as |item|}}\n  {{debugger}}\n{{/each}}
\n
\n
\n \n

You'll be able to get values from the current item:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('item.name')
\n
\n
\n \n

You can also access the context of the view to make sure it is the object that\nyou expect:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> context
\n
\n
\n \n", + "itemtype": "method", + "name": "debugger", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Test-9796ffa389.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.Test-e48578b900.json similarity index 98% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Test-9796ffa389.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.Test-e48578b900.json index 7136efdb9..d4c8305a2 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Test-9796ffa389.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.Test-e48578b900.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.Test", + "id": "ember-4.10.0-Ember.Test", "type": "class", "attributes": { "name": "Ember.Test", @@ -132,13 +132,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.10.0-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ViewMixin-46fa3aa964.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.ViewMixin-38edee6c68.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ViewMixin-46fa3aa964.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.ViewMixin-38edee6c68.json index 378fc422a..f4d72e536 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ViewMixin-46fa3aa964.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Ember.ViewMixin-38edee6c68.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.ViewMixin", + "id": "ember-4.10.0-Ember.ViewMixin", "type": "class", "attributes": { "name": "Ember.ViewMixin", @@ -307,13 +307,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.10.0-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-EmberArray-d54fcc05af.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-EmberArray-ccf563848c.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-EmberArray-d54fcc05af.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-EmberArray-ccf563848c.json index 89570e4ad..258c7cd9b 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-EmberArray-d54fcc05af.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-EmberArray-ccf563848c.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-EmberArray", + "id": "ember-4.10.0-EmberArray", "type": "class", "attributes": { "name": "EmberArray", @@ -821,13 +821,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/array", + "id": "ember-4.10.0-@ember/array", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-EmberObject-ccd1a50e38.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-EmberObject-ccd1a50e38.json new file mode 100644 index 000000000..ce7e82841 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-EmberObject-ccd1a50e38.json @@ -0,0 +1,600 @@ +{ + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class", + "attributes": { + "name": "EmberObject", + "shortname": "EmberObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/object/index.ts", + "line": 30, + "description": "

EmberObject is the main base class for all Ember objects. It is a subclass\nof CoreObject with the Observable mixin applied. For details,\nsee the documentation for each of these.

\n", + "extends": "CoreObject", + "uses": [ + "Observable" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.10.0-Ember.EventDispatcher" + }, + { + "type": "class", + "id": "ember-4.10.0-Ember.CoreView" + }, + { + "type": "class", + "id": "ember-4.10.0-Namespace" + }, + { + "type": "class", + "id": "ember-4.10.0-ArrayProxy" + }, + { + "type": "class", + "id": "ember-4.10.0-Ember.Controller" + }, + { + "type": "class", + "id": "ember-4.10.0-ContainerDebugAdapter" + }, + { + "type": "class", + "id": "ember-4.10.0-DataAdapter" + }, + { + "type": "class", + "id": "ember-4.10.0-EngineInstance" + }, + { + "type": "class", + "id": "ember-4.10.0-ObjectProxy" + }, + { + "type": "class", + "id": "ember-4.10.0-HashLocation" + }, + { + "type": "class", + "id": "ember-4.10.0-HistoryLocation" + }, + { + "type": "class", + "id": "ember-4.10.0-NoneLocation" + }, + { + "type": "class", + "id": "ember-4.10.0-Route" + }, + { + "type": "class", + "id": "ember-4.10.0-EmberRouter" + }, + { + "type": "class", + "id": "ember-4.10.0-Service" + } + ] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-EmberRouter-912eb8fdde.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-EmberRouter-912eb8fdde.json new file mode 100644 index 000000000..021891638 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-EmberRouter-912eb8fdde.json @@ -0,0 +1,1192 @@ +{ + "data": { + "id": "ember-4.10.0-EmberRouter", + "type": "class", + "attributes": { + "name": "EmberRouter", + "shortname": "EmberRouter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/router", + "namespace": "", + "file": "packages/@ember/routing/router.ts", + "line": 145, + "description": "

The EmberRouter class manages the application state and URLs. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/router.ts", + "line": 224, + "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

The first parameter is the name of the route which is used by default as the\npath name as well.

\n

The 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\nsegments.
  • \n
  • resetNamespace: false by default; when nesting routes, ember will\ncombine the route names to form the fully-qualified route name, which is\nused with {{link-to}} or manually transitioning to routes. Setting\nresetNamespace: true will cause the route not to inherit from its\nparent route's names. This is handy for preventing extremely long route names.\nKeep in mind that the actual URL path behavior is still retained.
  • \n
\n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
Router.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
\n
\n \n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 559, + "description": "

Initializes the current router instance and sets up the change handling\nevent listeners used by the instances location implementation.

\n

A property named initialURL will be used to determine the initial URL.\nIf no value is found / will be used.

\n", + "itemtype": "method", + "name": "startRouting", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 705, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 750, + "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", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 777, + "description": "

Determines if the supplied route is currently active.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 789, + "description": "

An alternative form of isActive that doesn't require\nmanual concatenation of the arguments into a single\narray.

\n", + "itemtype": "method", + "name": "isActiveIntent", + "params": [ + { + "name": "routeName", + "description": "" + }, + { + "name": "models", + "description": "" + }, + { + "name": "queryParams", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 811, + "description": "

Does this router instance have the given route.

\n", + "itemtype": "method", + "name": "hasRoute", + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 822, + "description": "

Resets the state of the router by clearing the current route\nhandlers and deactivating them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 970, + "description": "

Serializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Arrray" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1000, + "description": "

Serializes the value of a query parameter based on a type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "type", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1018, + "description": "

Deserializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1046, + "description": "

Deserializes the value of a query parameter based on a default type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "defaultType", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1067, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_pruneDefaultQueryParamValues", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1148, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareQueryParams", + "params": [ + { + "name": "targetRouteName", + "description": "", + "type": "String" + }, + { + "name": "models", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + }, + { + "name": "keepDefaultQueryParamValues", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1175, + "description": "

Returns the meta information for the query params of a given route. This\nwill be overridden to allow support for lazy routes.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getQPMeta", + "params": [ + { + "name": "routeInfo", + "description": "", + "type": "RouteInfo" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1189, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_queryParamsFor", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1251, + "description": "

Maps all query param keys to their fully scoped property name of the form\ncontrollerName:propName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_fullyScopeQueryParams", + "params": [ + { + "name": "leafRouteName", + "description": "", + "type": "String" + }, + { + "name": "contexts", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1289, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_hydrateUnsuppliedQueryParams", + "params": [ + { + "name": "state", + "description": "", + "type": "TransitionState" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1460, + "description": "

Handles updating the paths and notifying any listeners of the URL\nchange.

\n

Triggers the router level didTransition hook.

\n

For example, to notify google analytics when the route changes,\nyou could use this hook. (Note: requires also including GA scripts, etc.)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "didTransition", + "access": "private", + "tagname": "", + "since": "1.2.0", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1497, + "description": "

Handles notifying any listeners of an impending URL\nchange.

\n

Triggers the router level willTransition hook.

\n", + "itemtype": "method", + "name": "willTransition", + "access": "private", + "tagname": "", + "since": "1.11.0", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/router.ts", + "line": 155, + "description": "

Represents the URL of the root of the application, often '/'. This prefix is\n assumed on all routes defined on this router.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 166, + "description": "

The location property determines the type of URL's that your\n application will use.

\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 history by the locationType setting of /config/environment.js

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1510, + "description": "

Represents the current URL.

\n", + "itemtype": "property", + "name": "url", + "type": "{String}", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/routing/router", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Engine-c383b2450f.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Engine-d74159665b.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Engine-c383b2450f.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-Engine-d74159665b.json index bed4f1de6..2a6ad266d 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Engine-c383b2450f.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Engine-d74159665b.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Engine", + "id": "ember-4.10.0-Engine", "type": "class", "attributes": { "name": "Engine", @@ -283,19 +283,19 @@ "data": [ { "type": "class", - "id": "ember-4.12.1-Application" + "id": "ember-4.10.0-Application" } ] }, "module": { "data": { - "id": "ember-4.12.1-@ember/engine", + "id": "ember-4.10.0-@ember/engine", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-EngineInstance-d1d79b0e13.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-EngineInstance-d1d79b0e13.json new file mode 100644 index 000000000..d2f4bfa6b --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-EngineInstance-d1d79b0e13.json @@ -0,0 +1,785 @@ +{ + "data": { + "id": "ember-4.10.0-EngineInstance", + "type": "class", + "attributes": { + "name": "EngineInstance", + "shortname": "EngineInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/instance.ts", + "line": 38, + "description": "

The EngineInstance encapsulates all of the stateful aspects of a\nrunning Engine.

\n", + "access": "public", + "tagname": "", + "extends": "EmberObject", + "uses": [ + "RegistryProxyMixin", + "ContainerProxyMixin" + ], + "methods": [ + { + "file": "packages/@ember/engine/instance.ts", + "line": 55, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 106, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 172, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 189, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 219, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 41, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 189, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "EngineInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 238, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "EngineInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/instance.ts", + "line": 67, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 25, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.10.0-ApplicationInstance" + } + ] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Evented-bcafa1960a.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Evented-e30a42ee50.json similarity index 98% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Evented-bcafa1960a.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-Evented-e30a42ee50.json index 5b58a4435..7e74f9abb 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Evented-bcafa1960a.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Evented-e30a42ee50.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Evented", + "id": "ember-4.10.0-Evented", "type": "class", "attributes": { "name": "Evented", @@ -175,13 +175,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/object/evented", + "id": "ember-4.10.0-@ember/object/evented", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-HashLocation-18265497c8.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-HashLocation-18265497c8.json new file mode 100644 index 000000000..b17681c15 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-HashLocation-18265497c8.json @@ -0,0 +1,641 @@ +{ + "data": { + "id": "ember-4.10.0-HashLocation", + "type": "class", + "attributes": { + "name": "HashLocation", + "shortname": "HashLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/hash-location", + "namespace": "", + "file": "packages/@ember/routing/hash-location.ts", + "line": 10, + "description": "

HashLocation implements the location API using the browser's\nhash. At present, it relies on a hashchange event existing in the\nbrowser.

\n

Using HashLocation results in URLs with a # (hash sign) separating the\nserver side URL portion of the URL from the portion that is used by Ember.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'hash'\n});
\n
\n
\n \n

This will result in a posts.new url of /#/posts/new.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 50, + "access": "private", + "tagname": "Returns normalized location.hash", + "since": "1.5.1", + "itemtype": "method", + "name": "getHash", + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 62, + "description": "

Returns the normalized URL, constructed from location.hash.

\n

e.g. #/foo => /foo as well as #/foo#bar => /foo#bar.

\n

By convention, hashed paths must begin with a forward slash, otherwise they\nare not treated as a path so we can distinguish intent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 92, + "description": "

Set the location.hash and remembers what was set. This prevents\nonUpdateURL callbacks from triggering when the hash was set by\nHashLocation.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 106, + "description": "

Uses location.replace to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 121, + "description": "

Register a callback to be invoked when the hash changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 146, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 161, + "description": "

Cleans up the HashLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/routing/hash-location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-Helper-da52c58f14.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Helper-da52c58f14.json new file mode 100644 index 000000000..6520df4c1 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Helper-da52c58f14.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.10.0-Helper", + "type": "class", + "attributes": { + "name": "Helper", + "shortname": "Helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 73, + "description": "

Ember Helpers are functions that can compute values, and are used in templates.\nFor example, this code calls a helper named format-currency:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Cost @cents={{230}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/cost.hbs
1\n
<div>{{format-currency @cents currency="$"}}</div>
\n
\n
\n \n

Additionally a helper can be called as a nested helper.\nIn this example, we show the formatted currency value if the showMoney\nnamed argument is truthy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{if @showMoney (format-currency @cents currency="$")}}
\n
\n
\n \n

Helpers defined using a class must provide a compute function. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n6\n7\n
import Helper from '@ember/component/helper';\n\nexport default class extends Helper {\n  compute([cents], { currency }) {\n    return `${currency}${cents * 0.01}`;\n  }\n}
\n
\n
\n \n

Each time the input to a helper changes, the compute function will be\ncalled again.

\n

As instances, these helpers also have access to the container and will accept\ninjected dependencies.

\n

Additionally, class helpers can call recompute to force a new computation.

\n", + "extends": "CoreObject", + "access": "public", + "tagname": "", + "since": "1.13.0", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 119, + "description": "

Override this function when writing a class-based helper.

\n", + "itemtype": "method", + "name": "compute", + "params": [ + { + "name": "params", + "description": "The positional arguments to the helper", + "type": "Array" + }, + { + "name": "hash", + "description": "The named arguments to the helper", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 152, + "description": "

On a class-based helper, it may be useful to force a recomputation of that\nhelpers value. This is akin to rerender on a component.

\n

For example, this component will rerender when the currentUser on a\nsession service changes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
email.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Helper from '@ember/component/helper'\nimport { service } from '@ember/service'\nimport { observer } from '@ember/object'\n\nexport default Helper.extend({\n  session: service(),\n\n  onNewUser: observer('session.currentUser', function() {\n    this.recompute();\n  }),\n\n  compute() {\n    return this.get('session.currentUser.email');\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "recompute", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-HistoryLocation-06910f0bd3.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-HistoryLocation-06910f0bd3.json new file mode 100644 index 000000000..ea18af7ef --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-HistoryLocation-06910f0bd3.json @@ -0,0 +1,707 @@ +{ + "data": { + "id": "ember-4.10.0-HistoryLocation", + "type": "class", + "attributes": { + "name": "HistoryLocation", + "shortname": "HistoryLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/history-location", + "namespace": "", + "file": "packages/@ember/routing/history-location.ts", + "line": 20, + "description": "

HistoryLocation implements the location API using the browser's\nhistory.pushState API.

\n

Using HistoryLocation results in URLs that are indistinguishable from a\nstandard URL. This relies upon the browser's history API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'history'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new.

\n

Keep in mind that your server must serve the Ember app at all the routes you\ndefine.

\n

Using HistoryLocation will also result in location states being recorded by\nthe browser history API with the following schema:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
window.history.state -> { path: '/', uuid: '3552e730-b4a6-46bd-b8bf-d8c3c1a97e0a' }
\n
\n
\n \n

This allows each in-app location state to be tracked uniquely across history\nstate changes via the uuid field.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/history-location.ts", + "line": 78, + "access": "private", + "tagname": "Returns normalized location.hash", + "itemtype": "method", + "name": "getHash", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 104, + "description": "

Used to set state on first call to setURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initState", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 125, + "description": "

Returns the current location.pathname without rootURL or baseURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 152, + "description": "

Uses history.pushState to update the url without a page reload.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 168, + "description": "

Uses history.replaceState to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 185, + "description": "

Pushes a new state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "pushState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 201, + "description": "

Replaces the current state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 217, + "description": "

Register a callback to be invoked whenever the browser\nhistory changes, including using forward and back buttons.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 242, + "description": "

Used when using {{action}} helper. The url is always appended to the rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "formatted url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 266, + "description": "

Cleans up the HistoryLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/history-location.ts", + "line": 70, + "description": "

Will be pre-pended to path upon state change

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/routing/history-location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Location-ede9e1e60f.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Location-b049a14fd1.json similarity index 98% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Location-ede9e1e60f.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-Location-b049a14fd1.json index 9289e6b45..06dbd518d 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Location-ede9e1e60f.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Location-b049a14fd1.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Location", + "id": "ember-4.10.0-Location", "type": "class", "attributes": { "name": "Location", @@ -55,13 +55,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/routing/location", + "id": "ember-4.10.0-@ember/routing/location", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-Mixin-6d9eda2d7b.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Mixin-6d9eda2d7b.json new file mode 100644 index 000000000..db8b4c4bf --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Mixin-6d9eda2d7b.json @@ -0,0 +1,75 @@ +{ + "data": { + "id": "ember-4.10.0-Mixin", + "type": "class", + "attributes": { + "name": "Mixin", + "shortname": "Mixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/mixin", + "namespace": "", + "file": "packages/@ember/object/mixin.ts", + "line": 439, + "description": "

The Mixin class allows you to create mixins, whose properties can be\nadded to other classes. For instance,

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nconst EditableMixin = Mixin.create({\n  edit() {\n    console.log('starting to edit');\n    this.set('isEditing', true);\n  },\n  isEditing: false\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import EmberObject from '@ember/object';\nimport EditableMixin from '../mixins/editable';\n\n// Mix mixins into classes by passing them as the first arguments to\n// `.extend.`\nconst Comment = EmberObject.extend(EditableMixin, {\n  post: null\n});\n\nlet comment = Comment.create({\n  post: somePost\n});\n\ncomment.edit(); // outputs 'starting to edit'
\n
\n
\n \n

Note that Mixins are created with Mixin.create, not\nMixin.extend.

\n

Note that mixins extend a constructor's prototype so arrays and object literals\ndefined as properties will be shared amongst objects that implement the mixin.\nIf you want to define a property in a mixin that is not shared, you can define\nit either as a computed property or have it be created on initialization of the object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
// filters array will be shared amongst any object implementing mixin\nimport Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\nconst FilterableMixin = Mixin.create({\n  filters: A()\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\nimport { computed } from '@ember/object';\n\n// filters will be a separate array for every object implementing the mixin\nconst FilterableMixin = Mixin.create({\n  filters: computed(function() {\n    return A();\n  })\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\n// filters will be created as a separate array during the object's initialization\nconst Filterable = Mixin.create({\n  filters: null,\n\n  init() {\n    this._super(...arguments);\n    this.set("filters", A());\n  }\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/mixin.ts", + "line": 425, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Mixin", + "module": "@ember/object/mixin" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.10.0-Ember.TargetActionSupport" + } + ] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/object/mixin", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-MutableArray-35f7406660.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-MutableArray-446a9ba959.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-MutableArray-35f7406660.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-MutableArray-446a9ba959.json index 0179f8d50..13c7febe7 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-MutableArray-35f7406660.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-MutableArray-446a9ba959.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-MutableArray", + "id": "ember-4.10.0-MutableArray", "type": "class", "attributes": { "name": "MutableArray", @@ -1225,13 +1225,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/array", + "id": "ember-4.10.0-@ember/array", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-Namespace-adc1549be4.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Namespace-adc1549be4.json new file mode 100644 index 000000000..9c66ebeb5 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Namespace-adc1549be4.json @@ -0,0 +1,536 @@ +{ + "data": { + "id": "ember-4.10.0-Namespace", + "type": "class", + "attributes": { + "name": "Namespace", + "shortname": "Namespace", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application/namespace", + "namespace": "", + "file": "packages/@ember/application/namespace.ts", + "line": 20, + "description": "

A Namespace is an object usually used to contain other objects or methods\nsuch as an application or framework. Create a namespace anytime you want\nto define one of these new containers.

\n

Example Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
MyFramework = Ember.Namespace.create({\n  VERSION: '1.0.0'\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/application/namespace", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-NoneLocation-4b9f0699ca.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-NoneLocation-4b9f0699ca.json new file mode 100644 index 000000000..a5f13212d --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-NoneLocation-4b9f0699ca.json @@ -0,0 +1,639 @@ +{ + "data": { + "id": "ember-4.10.0-NoneLocation", + "type": "class", + "attributes": { + "name": "NoneLocation", + "shortname": "NoneLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/none-location", + "namespace": "", + "file": "packages/@ember/routing/none-location.ts", + "line": 9, + "description": "

NoneLocation does not interact with the browser. It is useful for\ntesting, or when you need to manage state with your Router, but temporarily\ndon't want it to muck with the URL (for example when you embed your\napplication in a larger page).

\n

Using NoneLocation causes Ember to not store the applications URL state\nin the actual URL. This is generally used for testing purposes, and is one\nof the changes made when calling App.setupForTesting().

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/none-location.ts", + "line": 54, + "description": "

Returns the current path without rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "path", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 71, + "description": "

Set the path and remembers what was set. Using this method\nto change the path will not invoke the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 83, + "description": "

Register a callback to be invoked when the path changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 96, + "description": "

Sets the path and calls the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "handleURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 108, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/none-location.ts", + "line": 30, + "description": "

Will be pre-pended to path.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/routing/none-location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-ObjectProxy-6c083f7dd5.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-ObjectProxy-6c083f7dd5.json new file mode 100644 index 000000000..43473ccfd --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-ObjectProxy-6c083f7dd5.json @@ -0,0 +1,571 @@ +{ + "data": { + "id": "ember-4.10.0-ObjectProxy", + "type": "class", + "attributes": { + "name": "ObjectProxy", + "shortname": "ObjectProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/proxy", + "namespace": "", + "file": "packages/@ember/object/proxy.ts", + "line": 8, + "description": "

ObjectProxy forwards all properties not defined by the proxy itself\nto a proxied content object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nlet exampleObject = EmberObject.create({\n  name: 'Foo'\n});\n\nlet exampleProxy = ObjectProxy.create({\n  content: exampleObject\n});\n\n// Access and change existing properties\nexampleProxy.get('name');          // 'Foo'\nexampleProxy.set('name', 'Bar');\nexampleObject.get('name');         // 'Bar'\n\n// Create new 'description' property on `exampleObject`\nexampleProxy.set('description', 'Foo is a whizboo baz');\nexampleObject.get('description');  // 'Foo is a whizboo baz'
\n
\n
\n \n

While content is unset, setting a property to be delegated will throw an\nError.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import ObjectProxy from '@ember/object/proxy';\n\nlet exampleProxy = ObjectProxy.create({\n  content: null,\n  flag: null\n});\nexampleProxy.set('flag', true);\nexampleProxy.get('flag');         // true\nexampleProxy.get('foo');          // undefined\nexampleProxy.set('foo', 'data');  // throws Error
\n
\n
\n \n

Delegated properties can be bound to and will change when content is updated.

\n

Computed properties on the proxy itself can depend on delegated properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { computed } from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nProxyWithComputedProperty = ObjectProxy.extend({\n  fullName: computed('firstName', 'lastName', function() {\n    var firstName = this.get('firstName'),\n        lastName = this.get('lastName');\n    if (firstName && lastName) {\n      return firstName + ' ' + lastName;\n    }\n    return firstName || lastName;\n  })\n});\n\nlet exampleProxy = ProxyWithComputedProperty.create();\n\nexampleProxy.get('fullName');  // undefined\nexampleProxy.set('content', {\n  firstName: 'Tom', lastName: 'Dale'\n}); // triggers property change for fullName on proxy\n\nexampleProxy.get('fullName');  // 'Tom Dale'
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "Ember.ProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 72, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 94, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/object/proxy", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Observable-e947bd4474.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Observable-d3471bfba9.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Observable-e947bd4474.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-Observable-d3471bfba9.json index b4ebc94ae..07a0cc44a 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Observable-e947bd4474.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Observable-d3471bfba9.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Observable", + "id": "ember-4.10.0-Observable", "type": "class", "attributes": { "name": "Observable", @@ -373,13 +373,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/object/observable", + "id": "ember-4.10.0-@ember/object/observable", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Owner-aedacf9fef.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Owner-9238aa5575.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Owner-aedacf9fef.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-Owner-9238aa5575.json index 008fd587b..9d58c7fd8 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Owner-aedacf9fef.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Owner-9238aa5575.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Owner", + "id": "ember-4.10.0-Owner", "type": "class", "attributes": { "name": "Owner", @@ -119,13 +119,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.10.0-@ember/owner", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-Promise-b2366c3e42.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Promise-b2366c3e42.json new file mode 100644 index 000000000..48c8c5900 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Promise-b2366c3e42.json @@ -0,0 +1,246 @@ +{ + "data": { + "id": "ember-4.10.0-Promise", + "type": "class", + "attributes": { + "name": "Promise", + "shortname": "Promise", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 26, + "description": "

Promise objects represent the eventual result of an asynchronous operation. The\nprimary way of interacting with a promise is through its then method, which\nregisters callbacks to receive either a promise’s eventual value or the reason\nwhy the promise cannot be fulfilled.

\n

Terminology

\n
    \n
  • promise is an object or function with a then method whose behavior conforms to this specification.
  • \n
  • thenable is an object or function that defines a then method.
  • \n
  • value is any legal JavaScript value (including undefined, a thenable, or a promise).
  • \n
  • exception is a value that is thrown using the throw statement.
  • \n
  • reason is a value that indicates why a promise was rejected.
  • \n
  • settled the final resting state of a promise, fulfilled or rejected.
  • \n
\n

A promise can be in one of three states: pending, fulfilled, or rejected.

\n

Promises that are fulfilled have a fulfillment value and are in the fulfilled\nstate. Promises that are rejected have a rejection reason and are in the\nrejected state. A fulfillment value is never a thenable.

\n

Promises can also be said to resolve a value. If this value is also a\npromise, then the original promise's settled state will match the value's\nsettled state. So a promise that resolves a promise that rejects will\nitself reject, and a promise that resolves a promise that fulfills will\nitself fulfill.

\n

Basic Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
let promise = new Promise(function(resolve, reject) {\n  // on success\n  resolve(value);\n\n  // on failure\n  reject(reason);\n});\n\npromise.then(function(value) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Advanced Usage:

\n

Promises shine when abstracting away asynchronous interactions such as\nXMLHttpRequests.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
function getJSON(url) {\n  return new Promise(function(resolve, reject){\n    let xhr = new XMLHttpRequest();\n\n    xhr.open('GET', url);\n    xhr.onreadystatechange = handler;\n    xhr.responseType = 'json';\n    xhr.setRequestHeader('Accept', 'application/json');\n    xhr.send();\n\n    function handler() {\n      if (this.readyState === this.DONE) {\n        if (this.status === 200) {\n          resolve(this.response);\n        } else {\n          reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n        }\n      }\n    };\n  });\n}\n\ngetJSON('/posts.json').then(function(json) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Unlike callbacks, promises are great composable primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Promise.all([\n  getJSON('/posts'),\n  getJSON('/comments')\n]).then(function(values){\n  values[0] // => postsJSON\n  values[1] // => commentsJSON\n\n  return values;\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "params": [ + { + "name": "resolver", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "is_constructor": 1, + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/promise/all.js", + "line": 3, + "description": "

Promise.all accepts an array of promises, and returns a new promise which\nis fulfilled with an array of fulfillment values for the passed promises, or\nrejected with the reason of the first passed promise to be rejected. It casts all\nelements of the passed iterable to promises as it runs this algorithm.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Promise, { resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // The array here would be [ 1, 2, 3 ];\n});
\n
\n
\n \n

If any of the promises given to RSVP.all are rejected, the first promise\nthat is rejected will be given as an argument to the returned promises's\nrejection handler. For example:

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Promise, { resolve, reject } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error("2"));\nlet promise3 = reject(new Error("3"));\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(error) {\n  // error.message === "2"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "all", + "params": [ + { + "name": "entries", + "description": "array of promises", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all `promises` have been\nfulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "static": 1, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/race.js", + "line": 9, + "description": "

Promise.race returns a new promise which is settled in the same way as the\nfirst passed promise to settle.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 2');\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // result === 'promise 2' because it was resolved before promise1\n  // was resolved.\n});
\n
\n
\n \n

Promise.race is deterministic in that only the state of the first\nsettled promise matters. For example, even if other promises given to the\npromises array argument are resolved, but the first settled promise has\nbecome rejected before the other promises became fulfilled, the returned\npromise will become rejected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    reject(new Error('promise 2'));\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // Code here never runs\n}, function(reason){\n  // reason.message === 'promise 2' because promise 2 became rejected before\n  // promise 1 became fulfilled\n});
\n
\n
\n \n

An example real-world use case is implementing timeouts:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import Promise from 'rsvp';\n\nPromise.race([ajax('foo.json'), timeout(5000)])
\n
\n
\n \n", + "itemtype": "method", + "name": "race", + "static": 1, + "params": [ + { + "name": "entries", + "description": "array of promises to observe", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for describing the promise returned.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise which settles in the same way as the first passed\npromise to settle.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/reject.js", + "line": 6, + "description": "

Promise.reject returns a promise rejected with the passed reason.\nIt is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  reject(new Error('WHOOPS'));\n});\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = Promise.reject(new Error('WHOOPS'));\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/resolve.js", + "line": 6, + "description": "

Promise.resolve returns a promise that will become resolved with the\npassed value. It is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  resolve(1);\n});\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Promise from 'rsvp';\n\nlet promise = RSVP.Promise.resolve(1);\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "resolve", + "static": 1, + "params": [ + { + "name": "object", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 155, + "description": "

catch is simply sugar for then(undefined, onRejection) which makes it the same\nas the catch block of a try/catch statement.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
function findAuthor(){\n  throw new Error('couldn\\'t find that author');\n}\n\n// synchronous\ntry {\n  findAuthor();\n} catch(reason) {\n  // something went wrong\n}\n\n// async with promises\nfindAuthor().catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 187, + "description": "

finally will be invoked regardless of the promise's fate just as native\ntry/catch/finally behaves

\n

Synchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
findAuthor() {\n  if (Math.random() > 0.5) {\n    throw new Error();\n  }\n  return new Author();\n}\n\ntry {\n  return findAuthor(); // succeed or fail\n} catch(error) {\n  return findOtherAuthor();\n} finally {\n  // always runs\n  // doesn't affect the return value\n}
\n
\n
\n \n

Asynchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findAuthor().catch(function(reason){\n  return findOtherAuthor();\n}).finally(function(){\n  // author was either found, or not\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 248, + "description": "

The primary way of interacting with a promise is through its then method,\nwhich registers callbacks to receive either a promise's eventual value or the\nreason why the promise cannot be fulfilled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function(user){\n  // user is available\n}, function(reason){\n  // user is unavailable, and you are given the reason why\n});
\n
\n
\n \n

Chaining

\n

The return value of then is itself a promise. This second, 'downstream'\npromise is resolved with the return value of the first promise's fulfillment\nor rejection handler, or rejected if the handler throws an exception.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
findUser().then(function (user) {\n  return user.name;\n}, function (reason) {\n  return 'default name';\n}).then(function (userName) {\n  // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n  // will be `'default name'`\n});\n\nfindUser().then(function (user) {\n  throw new Error('Found user, but still unhappy');\n}, function (reason) {\n  throw new Error('`findUser` rejected and we\\'re unhappy');\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n  // If `findUser` rejected, `reason` will be '`findUser` rejected and we\\'re unhappy'.\n});
\n
\n
\n \n

If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
findUser().then(function (user) {\n  throw new PedagogicalException('Upstream error');\n}).then(function (value) {\n  // never reached\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // The `PedgagocialException` is propagated all the way down to here\n});
\n
\n
\n \n

Assimilation

\n

Sometimes the value you want to propagate to a downstream promise can only be\nretrieved asynchronously. This can be achieved by returning a promise in the\nfulfillment or rejection handler. The downstream promise will then be pending\nuntil the returned promise is settled. This is called assimilation.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // The user's comments are now available\n});
\n
\n
\n \n

If the assimliated promise rejects, then the downstream promise will also reject.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // If `findCommentsByAuthor` fulfills, we'll have the value here\n}, function (reason) {\n  // If `findCommentsByAuthor` rejects, we'll have the reason here\n});
\n
\n
\n \n

Simple Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let result;\n\ntry {\n  result = findResult();\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findResult(function(result, err){\n  if (err) {\n    // failure\n  } else {\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findResult().then(function(result){\n  // success\n}, function(reason){\n  // failure\n});
\n
\n
\n \n

Advanced Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let author, books;\n\ntry {\n  author = findAuthor();\n  books  = findBooksByAuthor(author);\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
function foundBooks(books) {\n\n}\n\nfunction failure(reason) {\n\n}\n\nfindAuthor(function(author, err){\n  if (err) {\n    failure(err);\n    // failure\n  } else {\n    try {\n      findBoooksByAuthor(author, function(books, err) {\n        if (err) {\n          failure(err);\n        } else {\n          try {\n            foundBooks(books);\n          } catch(reason) {\n            failure(reason);\n          }\n        }\n      });\n    } catch(error) {\n      failure(err);\n    }\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findAuthor().\n  then(findBooksByAuthor).\n  then(function(books){\n    // found books\n}).catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "onFulfillment", + "description": "", + "type": "Function" + }, + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-PromiseProxyMixin-ff42e92ffd.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-PromiseProxyMixin-598167963d.json similarity index 98% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-PromiseProxyMixin-ff42e92ffd.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-PromiseProxyMixin-598167963d.json index 75aa969a9..d054987a5 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-PromiseProxyMixin-ff42e92ffd.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-PromiseProxyMixin-598167963d.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-PromiseProxyMixin", + "id": "ember-4.10.0-PromiseProxyMixin", "type": "class", "attributes": { "name": "PromiseProxyMixin", @@ -171,13 +171,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/object/promise-proxy-mixin", + "id": "ember-4.10.0-@ember/object/promise-proxy-mixin", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Registry-5bfb097b19.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Registry-c0b8fca45b.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Registry-5bfb097b19.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-Registry-c0b8fca45b.json index b8b75754f..a99a0fc57 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Registry-5bfb097b19.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Registry-c0b8fca45b.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Registry", + "id": "ember-4.10.0-Registry", "type": "class", "attributes": { "name": "Registry", @@ -392,13 +392,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-rsvp", + "id": "ember-4.10.0-rsvp", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-RegistryProxy-b2dd073871.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-RegistryProxy-f3952188ed.json similarity index 96% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-RegistryProxy-b2dd073871.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-RegistryProxy-f3952188ed.json index ff6bc6181..86d2695c2 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-RegistryProxy-b2dd073871.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-RegistryProxy-f3952188ed.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-RegistryProxy", + "id": "ember-4.10.0-RegistryProxy", "type": "class", "attributes": { "name": "RegistryProxy", @@ -55,7 +55,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-BasicRegistry", + "id": "ember-4.10.0-BasicRegistry", "type": "class" } }, @@ -63,19 +63,19 @@ "data": [ { "type": "class", - "id": "ember-4.12.1-RegistryProxyMixin" + "id": "ember-4.10.0-RegistryProxyMixin" } ] }, "module": { "data": { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.10.0-@ember/owner", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-RegistryProxyMixin-868d2e7b30.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-RegistryProxyMixin-f4eae3a135.json similarity index 98% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-RegistryProxyMixin-868d2e7b30.json rename to json-docs/ember/4.10.0/classes/ember-4.10.0-RegistryProxyMixin-f4eae3a135.json index 325cf3d52..169d0319b 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-RegistryProxyMixin-868d2e7b30.json +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-RegistryProxyMixin-f4eae3a135.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-RegistryProxyMixin", + "id": "ember-4.10.0-RegistryProxyMixin", "type": "class", "attributes": { "name": "RegistryProxyMixin", @@ -88,7 +88,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-RegistryProxy", + "id": "ember-4.10.0-RegistryProxy", "type": "class" } }, @@ -97,13 +97,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.10.0-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-Route-a995ff4d7c.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Route-a995ff4d7c.json new file mode 100644 index 000000000..a89e5cc58 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Route-a995ff4d7c.json @@ -0,0 +1,1706 @@ +{ + "data": { + "id": "ember-4.10.0-Route", + "type": "class", + "attributes": { + "name": "Route", + "shortname": "Route", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/route", + "namespace": "", + "file": "packages/@ember/routing/route.ts", + "line": 76, + "description": "

The Route class is used to define individual routes. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented", + "ActionHandler" + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/route.ts", + "line": 302, + "description": "

A hook you can implement to convert the route's model into parameters\nfor the URL.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model({ post_id }) {\n    // the server returns `{ id: 12 }`\n    return fetch(`/posts/${post_id}`;\n  }\n\n  serialize(model) {\n    // this will make the URL `/posts/12`\n    return { post_id: model.id };\n  }\n}
\n
\n
\n \n

The default serialize method will insert the model's id into the\nroute's dynamic segment (in this case, :post_id) if the segment contains '_id'.\nIf the route has multiple dynamic segments or does not contain '_id', serialize\nwill return getProperties(model, params)

\n

This method is called when transitionTo is called with a context\nin order to populate the URL.

\n", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "model", + "description": "the routes model", + "type": "Object" + }, + { + "name": "params", + "description": "an Array of parameter names for the current\n route (in the example, `['post_id']`.", + "type": "Array" + } + ], + "return": { + "description": "the serialized parameters", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 539, + "description": "

Sets the name for this route, including a fully resolved name for routes\ninside engines.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_setRouteName", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 554, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_stashNames", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 597, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_updatingQPChanged", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 605, + "description": "

Returns a hash containing the parameters of an ancestor route.

\n

You may notice that this.paramsFor sometimes works when referring to a\nchild route, but this behavior should not be relied upon as only ancestor\nroutes are certain to be loaded in time.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('member', { path: ':name' }, function() {\n    this.route('interest', { path: ':interest' });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class MemberRoute extends Route {\n  queryParams = {\n    memberQp: { refreshModel: true }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member/interest.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default class MemberInterestRoute extends Route {\n  queryParams = {\n    interestQp: { refreshModel: true }\n  }\n\n  model() {\n    return this.paramsFor('member');\n  }\n}
\n
\n
\n \n

If we visit /turing/maths?memberQp=member&interestQp=interest the model for\nthe member.interest route is a hash with:

\n
    \n
  • name: turing
  • \n
  • memberQp: member
  • \n
\n", + "itemtype": "method", + "name": "paramsFor", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "return": { + "description": "hash containing the parameters of the route `name`", + "type": "Object" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 686, + "description": "

Serializes the query parameter key

\n", + "itemtype": "method", + "name": "serializeQueryParamKey", + "params": [ + { + "name": "controllerPropertyName", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 697, + "description": "

Serializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 713, + "description": "

Deserializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 745, + "description": "

A hook you can use to reset controller values either when the model\nchanges or the route is exiting.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/articles.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class ArticlesRoute extends Route {\n  resetController(controller, isExiting, transition) {\n    if (isExiting && transition.targetName !== 'error') {\n      controller.set('page', 1);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "resetController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "isExiting", + "description": "", + "type": "Boolean" + }, + { + "name": "transition", + "description": "", + "type": "Object" + } + ], + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 772, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "exit", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 783, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_internalReset", + "since": "3.6.0", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 797, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "enter", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 848, + "description": "

This hook is executed when the router completely exits this route. It is\nnot executed when the model for the route changes.

\n", + "itemtype": "method", + "name": "deactivate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 859, + "description": "

This hook is executed when the router enters the route. It is not executed\nwhen the model for the route changes.

\n", + "itemtype": "method", + "name": "activate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 870, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogPosts');\nthis.transitionTo('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('blogPost', { path:':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogComment', aPost, aComment);\nthis.transitionTo('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
this.transitionTo('/');\nthis.transitionTo('/blog/post/1/comment/13');\nthis.transitionTo('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
this.transitionTo('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\nthis.transitionTo({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceWith.

\n

Simple Transition Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n  this.route('fourOhFour', { path: '*:' });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToSecret(context) {\n    if (authorized()) {\n      this.transitionTo('secret', context);\n    } else {\n      this.transitionTo('fourOhFour');\n    }\n  }\n}
\n
\n
\n \n

Transition to a nested route

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('articles', { path: '/articles' }, function() {\n    this.route('new');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToNewArticle() {\n    this.transitionTo('articles.new');\n  }\n}
\n
\n
\n \n

Multiple Models Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n\n  this.route('breakfast', { path: ':breakfastId' }, function() {\n    this.route('cereal', { path: ':cerealId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToChocolateCereal() {\n    let cereal = { cerealId: 'ChocolateYumminess' };\n    let breakfast = { breakfastId: 'CerealAndMilk' };\n\n    this.transitionTo('breakfast.cereal', breakfast, cereal);\n  }\n}
\n
\n
\n \n

Nested Route with Query String Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('fruits', function() {\n    this.route('apples');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToApples() {\n    this.transitionTo('fruits.apples', { queryParams: { color: 'red' } });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL.", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1068, + "description": "

Perform a synchronous transition into another route without attempting\nto resolve promises, update the URL, or abort any currently active\nasynchronous transitions (i.e. regular transitions caused by\ntransitionTo or URL changes).

\n

This method is handy for performing intermediate transitions on the\nway to a final destination route, and is called internally by the\ndefault implementations of the error and loading handlers.

\n", + "itemtype": "method", + "name": "intermediateTransitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) to be used while transitioning\nto the route.", + "type": "...Object" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1090, + "description": "

Refresh the model on this route and any child routes, firing the\nbeforeModel, model, and afterModel hooks in a similar fashion\nto how routes are entered when transitioning in from other route.\nThe current route params (e.g. article_id) will be passed in\nto the respective model hooks, and if a different model is returned,\nsetupController and associated route hooks will re-fire as well.

\n

An example usage of this method is re-querying the server for the\nlatest information using the same parameters as when the route\nwas first entered.

\n

Note that this will cause model hooks to fire even on routes\nthat were provided a model object when the route was initially\nentered.

\n", + "itemtype": "method", + "name": "refresh", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1116, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionTo in all other respects. See\n'transitionTo' for additional information regarding multiple models.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/secret.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class SecretRoute Route {\n  afterModel() {\n    if (!authorized()){\n      this.replaceWith('index');\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1164, + "description": "

This hook is the entry point for router.js

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1239, + "description": "

This hook is the first of the route entry validation hooks\ncalled when an attempt is made to transition into a route\nor one of its children. It is called before model and\nafterModel, and is appropriate for cases when:

\n
    \n
  1. A decision can be made to redirect elsewhere without\nneeding to resolve the model first.
  2. \n
  3. Any async operations need to occur first before the\nmodel is attempted to be resolved.
  4. \n
\n

This hook is provided the current transition attempt\nas a parameter, which can be used to .abort() the transition,\nsave it for a later .retry(), or retrieve values set\non it from a previous hook. You can also just call\nthis.transitionTo to another route to implicitly\nabort the transition.

\n

You can return a promise from this hook to pause the\ntransition until the promise resolves (or rejects). This could\nbe useful, for instance, for retrieving async code from\nthe server that is required to enter a route.

\n", + "itemtype": "method", + "name": "beforeModel", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1274, + "description": "

This hook is called after this route's model has resolved.\nIt follows identical async/promise semantics to beforeModel\nbut is provided the route's resolved model in addition to\nthe transition, and is therefore suited to performing\nlogic that can only take place after the model has already\nresolved.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n  afterModel(posts, transition) {\n    if (posts.get('length') === 1) {\n      this.transitionTo('post.show', posts.get('firstObject'));\n    }\n  }\n}
\n
\n
\n \n

Refer to documentation for beforeModel for a description\nof transition-pausing semantics when a promise is returned\nfrom this hook.

\n", + "itemtype": "method", + "name": "afterModel", + "params": [ + { + "name": "resolvedModel", + "description": "the value returned from `model`,\n or its resolved value if it was a promise", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1312, + "description": "

A hook you can implement to optionally redirect to another route.

\n

Calling this.transitionTo from inside of the redirect hook will\nabort the current transition (into the route that has implemented redirect).

\n

redirect and afterModel behave very similarly and are\ncalled almost at the same time, but they have an important\ndistinction when calling this.transitionTo to a child route\nof the current route. From afterModel, this new transition\ninvalidates the current transition, causing beforeModel,\nmodel, and afterModel hooks to be called again. But the\nsame transition started from redirect does not invalidate\nthe current transition. In other words, by the time the redirect\nhook has been called, both the resolved model and the attempted\nentry into this route are considered fully validated.

\n", + "itemtype": "method", + "name": "redirect", + "params": [ + { + "name": "model", + "description": "the model for this route", + "type": "Object" + }, + { + "name": "transition", + "description": "the transition object associated with the current transition", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1337, + "description": "

Called when the context is changed by router.js.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "contextDidChange", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1347, + "description": "

A hook you can implement to convert the URL into the model for\nthis route.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

The model for the post route is store.findRecord('post', params.post_id).

\n

By default, if your route has a dynamic segment ending in _id:

\n
    \n
  • The model class is determined from the segment (post_id's\nclass is App.Post)
  • \n
  • The find method is called on the model class with the value of\nthe dynamic segment.
  • \n
\n

Note that for routes with dynamic segments, this hook is not always\nexecuted. If the route is entered through a transition (e.g. when\nusing the link-to Handlebars helper or the transitionTo method\nof routes), and a model context is already provided this hook\nis not called.

\n

A model context does not include a primitive string or number,\nwhich does cause the model hook to be called.

\n

Routes without dynamic segments will always execute the model hook.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
// no dynamic segment, model hook always called\nthis.transitionTo('posts');\n\n// model passed in, so model hook not called\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost);\n\n// integer passed in, model hook is called\nthis.transitionTo('post', 1);\n\n// model id passed in, model hook is called\n// useful for forcing the hook to execute\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost.id);
\n
\n
\n \n

This hook follows the asynchronous/promise semantics\ndescribed in the documentation for beforeModel. In particular,\nif a promise returned from model fails, the error will be\nhandled by the error hook on Route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model(params) {\n    return this.store.findRecord('post', params.post_id);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "model", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route. If\n a promise is returned, the transition will pause until\n the promise resolves, and the resolved value of the promise\n will be used as the model for this route.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1462, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "deserialize", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route.\n\nRouter.js hook.", + "type": "Any | Promise" + }, + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1475, + "itemtype": "method", + "name": "findModel", + "params": [ + { + "name": "type", + "description": "the model type", + "type": "String" + }, + { + "name": "value", + "description": "the value passed to find", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1486, + "description": "

A hook you can use to setup the controller for the current route.

\n

This method is called with the controller for the current route and the\nmodel supplied by the model hook.

\n

By default, the setupController hook sets the model property of\nthe controller to the specified model when it is not undefined.

\n

If you implement the setupController hook in your Route, it will\nprevent this default behavior. If you want to preserve that behavior\nwhen implementing your setupController function, make sure to call\nsuper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/photos.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PhotosRoute extends Route {\n  model() {\n    return this.store.findAll('photo');\n  }\n\n  setupController(controller, model) {\n    super.setupController(controller, model);\n\n    this.controllerFor('application').set('showingPhotos', true);\n  }\n}
\n
\n
\n \n

The provided controller will be one resolved based on the name\nof this route.

\n

If no explicit controller is defined, Ember will automatically create one.

\n

As an example, consider the router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

If you have defined a file for the post controller,\nthe framework will use it.\nIf it is not defined, a basic Controller instance would be used.

\n", + "example": [ + " Behavior of a basic Controller\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, model) {\n controller.set('model', model);\n }\n});\n```" + ], + "itemtype": "method", + "name": "setupController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "model", + "description": "", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition", + "optional": true + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1562, + "description": "

Returns the controller of the current route, or a parent (or any ancestor)\nroute in a route hierarchy.

\n

The controller instance must already have been created, either through entering the\nassociated route or using generateController.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.controllerFor('posts').set('currentPost', post);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "controllerFor", + "params": [ + { + "name": "name", + "description": "the name of the route or controller", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Controller | undefined" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1616, + "description": "

Generates a controller for a route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class Post extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.generateController('posts');\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "generateController", + "params": [ + { + "name": "name", + "description": "the name of the controller", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1644, + "description": "

Returns the resolved model of a parent (or any ancestor) route\nin a route hierarchy. During a transition, all routes\nmust resolve a model object, and if a route\nneeds access to a parent route's model in order to\nresolve a model (or just reuse the model from a parent),\nit can call this.modelFor(theNameOfParentRoute) to\nretrieve it. If the ancestor route's model was a promise,\nits resolved result is returned.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' }, function() {\n    this.route('comments');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post/comments.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostCommentsRoute extends Route {\n  model() {\n    let post = this.modelFor('post');\n\n    return post.comments;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "modelFor", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "the model object", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1716, + "description": "

this[RENDER] is used to render a template into a region of another template\n(indicated by an {{outlet}}).

\n", + "itemtype": "method", + "name": "this[RENDER]", + "params": [ + { + "name": "name", + "description": "the name of the template to render", + "type": "String" + }, + { + "name": "options", + "description": "the options", + "type": "Object", + "optional": true, + "props": [ + { + "name": "into", + "description": "the template to render into,\n referenced by name. Defaults to the parent template", + "type": "String", + "optional": true + }, + { + "name": "outlet", + "description": "the outlet inside `options.into` to render into.\n Defaults to 'main'", + "type": "String", + "optional": true + }, + { + "name": "controller", + "description": "the controller to use for this template,\n referenced by name or as a controller instance. Defaults to the Route's paired controller", + "type": "String|Object", + "optional": true + }, + { + "name": "model", + "description": "the model object to set on `options.controller`.\n Defaults to the return value of the Route's model hook", + "type": "Object", + "optional": true + } + ] + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1743, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "teardownViews", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1756, + "description": "

Allows you to produce custom metadata for the route.\nThe return value of this method will be attached to\nits corresponding RouteInfoWithAttributes object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostsIndexRoute extends Route {\n  buildRouteInfoMetadata() {\n    return { title: 'Posts Page' }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service router\n\n  constructor() {\n    super(...arguments);\n\n    this.router.on('routeDidChange', transition => {\n      document.title = transition.to.metadata.title;\n      // would update document's title to "Posts Page"\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "buildRouteInfoMetadata", + "return": { + "description": "any" + }, + "since": "3.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 2012, + "description": "

Sends an action to the router, which will delegate it to the currently\nactive route hierarchy per the bubbling rules explained under actions.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  track(arg) {\n    console.log(arg, 'was clicked');\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  trackIfDebug(arg) {\n    if (debug) {\n      this.send('track', arg);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "name", + "description": "the name of the action to trigger", + "type": "String" + }, + { + "name": "args", + "description": "", + "type": "...*" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 2428, + "description": "

This action is called when one or more query params have changed. Bubbles.

\n", + "itemtype": "method", + "name": "queryParamsDidChange", + "params": [ + { + "name": "changed", + "description": "Keys are names of query params that have changed.", + "type": "Object" + }, + { + "name": "totalPresent", + "description": "Keys are names of query params that are currently set.", + "type": "Object" + }, + { + "name": "removed", + "description": "Keys are names of query params that have been removed.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/routing/route.ts", + "line": 88, + "description": "

The willTransition action 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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ContactFormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData')) {\n      this.controller.displayNavigationConfirm();\n      transition.abort();\n    }\n  }\n}
\n
\n
\n \n

You can also redirect elsewhere by calling\nthis.transitionTo('elsewhere') from within willTransition.\nNote that willTransition will not be fired for the\nredirecting transitionTo, since willTransition doesn't\nfire when there is already a transition underway. If you want\nsubsequent willTransition actions to fire for the redirecting\ntransition, you must first explicitly call\ntransition.abort().

\n

To allow the willTransition event to continue bubbling to the parent\nroute, use return true;. When the willTransition method has a\nreturn value of true then the parent route's willTransition method\nwill be fired, enabling "bubbling" behavior for the event.

\n", + "itemtype": "event", + "name": "willTransition", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 133, + "description": "

The didTransition action is fired after a transition has\nsuccessfully been completed. This occurs after the normal model\nhooks (beforeModel, model, afterModel, setupController)\nhave resolved. The didTransition action has no arguments,\nhowever, it can be useful for tracking page views or resetting\nstate on the controller.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/login.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class LoginRoute extends Route {\n  @action\n  didTransition() {\n    this.controller.get('errors.base').clear();\n    return true; // Bubble the didTransition event\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "didTransition", + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 160, + "description": "

The loading action is fired on the route when a route's model\nhook returns a promise that is not already resolved. The current\nTransition object is the first parameter and the route that\ntriggered the loading event is the second parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  loading(transition, route) {\n    let controller = this.controllerFor('foo');\n\n    // The controller may not be instantiated when initially loading\n    if (controller) {\n      controller.currentlyLoading = true;\n\n      transition.finally(function() {\n        controller.currentlyLoading = false;\n      });\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "loading", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + }, + { + "name": "route", + "description": "The route that triggered the loading event", + "type": "Route" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 195, + "description": "

When attempting to transition into a route, any of the hooks\nmay return a promise that rejects, at which point an error\naction will be fired on the partially-entered routes, allowing\nfor per-route error handling logic, or shared error handling\nlogic defined on a parent route.

\n

Here is an example of an error handler that will be invoked\nfor rejected promises from the various hooks on the route,\nas well as any unhandled errors from child routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/admin.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { reject } from 'rsvp';\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class AdminRoute extends Route {\n  beforeModel() {\n    return reject('bad things!');\n  }\n\n  @action\n  error(error, transition) {\n    // Assuming we got here due to the error in `beforeModel`,\n    // we can expect that error === "bad things!",\n    // but a promise model rejecting would also\n    // call this hook, as would any errors encountered\n    // in `afterModel`.\n\n    // The `error` hook is also provided the failed\n    // `transition`, which can be stored and later\n    // `.retry()`d if desired.\n\n    this.transitionTo('login');\n  }\n}
\n
\n
\n \n

error actions that bubble up all the way to ApplicationRoute\nwill fire a default error handler that logs the error. You can\nspecify your own global default error handler by overriding the\nerror handler on ApplicationRoute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  error(error, transition) {\n    this.controllerFor('banner').displayError(error.message);\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "error", + "params": [ + { + "name": "error", + "description": "", + "type": "Error" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 808, + "description": "

This event is triggered when the router enters the route. It is\nnot executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  collectAnalytics: on('activate', function(){\n    collectAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "activate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 828, + "description": "

This event is triggered when the router completely exits this\nroute. It is not executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  trackPageLeaveAnalytics: on('deactivate', function(){\n    trackPageLeaveAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "deactivate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + } + ], + "properties": [ + { + "file": "packages/@ember/routing/route.ts", + "line": 370, + "description": "

Configuration hash for this route's queryParams. The possible\nconfiguration options and their defaults are as follows\n(assuming a query param whose controller property is page):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
queryParams = {\n  page: {\n    // By default, controller query param properties don't\n    // cause a full transition when they are changed, but\n    // rather only cause the URL to update. Setting\n    // `refreshModel` to true will cause an "in-place"\n    // transition to occur, whereby the model hooks for\n    // this route (and any child routes) will re-fire, allowing\n    // you to reload models (e.g., from the server) using the\n    // updated query param values.\n    refreshModel: false,\n\n    // By default, changes to controller query param properties\n    // cause the URL to update via `pushState`, which means an\n    // item will be added to the browser's history, allowing\n    // you to use the back button to restore the app to the\n    // previous state before the query param property was changed.\n    // Setting `replace` to true will use `replaceState` (or its\n    // hash location equivalent), which causes no browser history\n    // item to be added. This options name and default value are\n    // the same as the `link-to` helper's `replace` option.\n    replace: false,\n\n    // By default, the query param URL key is the same name as\n    // the controller property name. Use `as` to specify a\n    // different URL key.\n    as: 'page'\n  }\n};
\n
\n
\n \n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 423, + "description": "

The name of the template to use by default when rendering this route's\ntemplate.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/list.js
1\n2\n3\n4\n5\n
import Route from '@ember/routing/route';\n\nexport default class PostsListRoute extends Route {\n  templateName = 'posts/list';\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n
import PostsListRoute from '../posts/list';\n\nexport default class PostsIndexRoute extends PostsListRoute {};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/archived.js
1\n2\n3\n
import PostsListRoute from '../posts/list';\n\nexport default class PostsArchivedRoute extends PostsListRoute {};
\n
\n
\n \n", + "itemtype": "property", + "name": "templateName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 456, + "description": "

The name of the controller to associate with this route.

\n

By default, Ember will lookup a route's controller that matches the name\nof the route (i.e. posts.new). However,\nif you would like to define a specific controller to use, you can do so\nusing this property.

\n

This is useful in many ways, as the controller specified will be:

\n
    \n
  • passed to the setupController method.
  • \n
  • used as the controller for the template being rendered by the route.
  • \n
  • returned from a call to controllerFor for the route.
  • \n
\n", + "itemtype": "property", + "name": "controllerName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 479, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 510, + "description": "

The name of the route, dot-delimited.

\n

For example, a route found at app/routes/posts/post.js will have\na routeName of posts.post.

\n", + "itemtype": "property", + "name": "routeName", + "type": "String", + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 524, + "description": "

The name of the route, dot-delimited, including the engine prefix\nif applicable.

\n

For example, a route found at addon/routes/posts/post.js within an\nengine named admin will have a fullRouteName of admin.posts.post.

\n", + "itemtype": "property", + "name": "fullRouteName", + "type": "String", + "since": "2.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 588, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_activeQPChanged", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 729, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_optionsForQueryParam", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1807, + "description": "

Store property provides a hook for data persistence libraries to inject themselves.

\n

By default, this store property provides the exact same functionality previously\nin the model hook.

\n

Currently, the required interface is:

\n

store.find(modelName, findArguments)

\n", + "itemtype": "property", + "name": "store", + "type": "{Object}", + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1873, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_qp", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 2397, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/routing/route", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-RouterService-76da358f2d.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-RouterService-76da358f2d.json new file mode 100644 index 000000000..3a3abd729 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-RouterService-76da358f2d.json @@ -0,0 +1,882 @@ +{ + "data": { + "id": "ember-4.10.0-RouterService", + "type": "class", + "attributes": { + "name": "RouterService", + "shortname": "RouterService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/router-service", + "namespace": "", + "file": "packages/@ember/routing/router-service.ts", + "line": 27, + "description": "

The Router service is the public API that provides access to the router.

\n

The immediate benefit of the Router service is that you can inject it into components,\ngiving them a friendly way to initiate transitions and ask questions about the current\nglobal router state.

\n

In this example, the Router service is injected into a component to initiate a transition\nto a dedicated route:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class ExampleComponent extends Component {\n  @service router;\n\n  @action\n  next() {\n    this.router.transitionTo('other.route');\n  }\n}
\n
\n
\n \n

Like any service, it can also be injected into helpers, routes, etc.

\n", + "access": "public", + "tagname": "", + "extends": "Service", + "methods": [ + { + "file": "packages/@ember/routing/router-service.ts", + "line": 85, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n

Calling transitionTo from the Router service will cause default query parameter values to be included in the URL.\nThis behavior is different from calling transitionTo on a route or transitionToRoute on a controller.\nSee the Router Service RFC for more info.

\n

In the following example we use the Router service to navigate to a route with a\nspecific model from a Component in the first action, and in the second we trigger\na query-params only transition.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n  @service router;\n\n  @action\n  goToComments(post) {\n    this.router.transitionTo('comments', post);\n  }\n\n  @action\n  fetchMoreComments(latestComment) {\n    this.router.transitionTo({\n      queryParams: { commentsAfter: latestComment }\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 144, + "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

Calling 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 for more info.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class extends Route {\n  beforeModel() {\n    if (!authorized()){\n      this.replaceWith('unauthorized');\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL of the desired destination", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route i.e. an object of params to pass to the destination route", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 183, + "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

In this example, the URL for the author.books route for a given author\nis copied to the clipboard.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

Just like with transitionTo and replaceWith, urlFor can also handle\nquery parameters.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "urlFor", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) for the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the string representing the generated URL", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 256, + "description": "

Returns true if routeName/models/queryParams is the active route, where models and queryParams are optional.\nSee model and\nqueryParams for more information about these arguments.

\n

In the following example, isActive will return true if the current route is /posts.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

Where 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.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used when determining the active route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "true if the provided routeName/models/queryParams are active", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 360, + "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

See RouteInfo for more info.

\n

In the following example recognize is used to verify if a path belongs to our\napplication before transitioning to it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "recognize", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo | null" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 401, + "description": "

Takes a string URL and returns a promise that resolves to a\nRouteInfoWithAttributes 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.

\n", + "itemtype": "method", + "name": "recognizeAndLoad", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 423, + "description": "

You can register a listener for events emitted by this service with .on():

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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
\n \n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 450, + "description": "

You can unregister a listener for events emitted by this service with .off():

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Route from '@ember/routing';\nimport { service } from '@ember/service';\n\nexport default class ContactFormRoute extends Route {\n  @service router;\n\n  callback = (transition) => {\n    if (!transition.to.find(route => route.name === this.routeName)) {\n      alert('Please save or cancel your changes.');\n      transition.abort();\n    }\n  };\n\n  activate() {\n    this.router.on('routeWillChange', this.callback);\n  }\n\n  deactivate() {\n    this.router.off('routeWillChange', this.callback);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 557, + "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.

\n", + "itemtype": "method", + "name": "refresh", + "params": [ + { + "name": "routeName", + "description": "the route to refresh (along with all child routes)", + "type": "String", + "optional": true + } + ], + "return": { + "description": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/routing/router-service.ts", + "line": 483, + "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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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
\n \n

The 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.

\n", + "itemtype": "event", + "name": "routeWillChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 517, + "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

A good example is sending some analytics when the route has transitioned:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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 \n

routeDidChange will be called after any Route's\ndidTransition\naction has been fired.\nThe updates of properties\ncurrentURL,\ncurrentRouteName\nand\ncurrentRoute\nare completed at the time routeDidChange is called.

\n", + "itemtype": "event", + "name": "routeDidChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + } + ], + "properties": [ + { + "file": "packages/@ember/routing/router-service.ts", + "line": 587, + "description": "

Name of the current route.

\n

This property represents the logical name of the route,\n which is dot separated.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentRouteName", + "type": "{String | null}", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 617, + "description": "

Current URL for the application.

\n

This property represents the URL path for this route.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentURL", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 646, + "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

See Location for more information.

\n

To 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\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
\n \n

The following location types are available by default:\nauto, hash, history, none.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 686, + "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

If you change the rootURL in your environment configuration\nlike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\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
\n \n

This property will return /my-root.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 716, + "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

See RouteInfo for more info.

\n

This 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

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/header.js
1\n2\n3\n4\n5\n6\n7\n8\n9\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
\n
\n \n", + "itemtype": "property", + "name": "currentRoute", + "type": "RouteInfo", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-Service", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/routing/router-service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-Service-d837a09d6d.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-Service-d837a09d6d.json new file mode 100644 index 000000000..6411ca8b3 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-Service-d837a09d6d.json @@ -0,0 +1,541 @@ +{ + "data": { + "id": "ember-4.10.0-Service", + "type": "class", + "attributes": { + "name": "Service", + "shortname": "Service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "file": "packages/@ember/service/index.ts", + "line": 87, + "extends": "EmberObject", + "since": "1.10.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.10.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.10.0-RouterService" + } + ] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-String-9f2d0a448f.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-String-9f2d0a448f.json new file mode 100644 index 000000000..49e3f3e6a --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-String-9f2d0a448f.json @@ -0,0 +1,216 @@ +{ + "data": { + "id": "ember-4.10.0-String", + "type": "class", + "attributes": { + "name": "String", + "shortname": "String", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/string", + "namespace": "", + "file": "packages/@ember/string/index.ts", + "line": 74, + "description": "

Defines string helper methods including string formatting and localization.

\n", + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add the package `@ember/string` to your project to use in place of this module.", + "methods": [ + { + "file": "packages/@ember/string/index.ts", + "line": 82, + "description": "

Splits a string into separate units separated by spaces, eliminating any\nempty strings in the process.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { w } from '@ember/string';\n\nw("alpha beta gamma").forEach(function(key) {\n  console.log(key);\n});\n\n// > alpha\n// > beta\n// > gamma
\n
\n
\n \n", + "itemtype": "method", + "name": "w", + "params": [ + { + "name": "str", + "description": "The string to split", + "type": "String" + } + ], + "return": { + "description": "array containing the split strings", + "type": "Array" + }, + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add `@ember/string` to your package.json", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 109, + "description": "

Converts a camelized string into all lower case separated by underscores.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { decamelize } from '@ember/string';\n\ndecamelize('innerHTML');          // 'inner_html'\ndecamelize('action_name');        // 'action_name'\ndecamelize('css-class-name');     // 'css-class-name'\ndecamelize('my favorite items');  // 'my favorite items'
\n
\n
\n \n", + "itemtype": "method", + "name": "decamelize", + "params": [ + { + "name": "str", + "description": "The string to decamelize.", + "type": "String" + } + ], + "return": { + "description": "the decamelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add `@ember/string` to your package.json", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 132, + "description": "

Replaces underscores, spaces, or camelCase with dashes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { dasherize } from '@ember/string';\n\ndasherize('innerHTML');                // 'inner-html'\ndasherize('action_name');              // 'action-name'\ndasherize('css-class-name');           // 'css-class-name'\ndasherize('my favorite items');        // 'my-favorite-items'\ndasherize('privateDocs/ownerInvoice';  // 'private-docs/owner-invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "dasherize", + "params": [ + { + "name": "str", + "description": "The string to dasherize.", + "type": "String" + } + ], + "return": { + "description": "the dasherized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add `@ember/string` to your package.json", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 156, + "description": "

Returns the lowerCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { camelize } from '@ember/string';\n\ncamelize('innerHTML');                   // 'innerHTML'\ncamelize('action_name');                 // 'actionName'\ncamelize('css-class-name');              // 'cssClassName'\ncamelize('my favorite items');           // 'myFavoriteItems'\ncamelize('My Favorite Items');           // 'myFavoriteItems'\ncamelize('private-docs/owner-invoice');  // 'privateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "camelize", + "params": [ + { + "name": "str", + "description": "The string to camelize.", + "type": "String" + } + ], + "return": { + "description": "the camelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add `@ember/string` to your package.json", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 181, + "description": "

Returns the UpperCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { classify } from '@ember/string';\n\nclassify('innerHTML');                   // 'InnerHTML'\nclassify('action_name');                 // 'ActionName'\nclassify('css-class-name');              // 'CssClassName'\nclassify('my favorite items');           // 'MyFavoriteItems'\nclassify('private-docs/owner-invoice');  // 'PrivateDocs/OwnerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "classify", + "params": [ + { + "name": "str", + "description": "the string to classify", + "type": "String" + } + ], + "return": { + "description": "the classified string", + "type": "String" + }, + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add `@ember/string` to your package.json", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 205, + "description": "

More general than decamelize. Returns the lower_case_and_underscored\nform of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { underscore } from '@ember/string';\n\nunderscore('innerHTML');                 // 'inner_html'\nunderscore('action_name');               // 'action_name'\nunderscore('css-class-name');            // 'css_class_name'\nunderscore('my favorite items');         // 'my_favorite_items'\nunderscore('privateDocs/ownerInvoice');  // 'private_docs/owner_invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "underscore", + "params": [ + { + "name": "str", + "description": "The string to underscore.", + "type": "String" + } + ], + "return": { + "description": "the underscored string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add `@ember/string` to your package.json", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 230, + "description": "

Returns the Capitalized form of a string

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capitalize } from '@ember/string';\n\ncapitalize('innerHTML')                 // 'InnerHTML'\ncapitalize('action_name')               // 'Action_name'\ncapitalize('css-class-name')            // 'Css-class-name'\ncapitalize('my favorite items')         // 'My favorite items'\ncapitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "capitalize", + "params": [ + { + "name": "str", + "description": "The string to capitalize.", + "type": "String" + } + ], + "return": { + "description": "The capitalized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add `@ember/string` to your package.json", + "class": "String", + "module": "@ember/string" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/string", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.10.0/classes/ember-4.10.0-rsvp-c50ff6d08e.json b/json-docs/ember/4.10.0/classes/ember-4.10.0-rsvp-c50ff6d08e.json new file mode 100644 index 000000000..e24bcd930 --- /dev/null +++ b/json-docs/ember/4.10.0/classes/ember-4.10.0-rsvp-c50ff6d08e.json @@ -0,0 +1,445 @@ +{ + "data": { + "id": "ember-4.10.0-rsvp", + "type": "class", + "attributes": { + "name": "rsvp", + "shortname": "rsvp", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/all-settled.js", + "line": 20, + "description": "

RSVP.allSettled is similar to RSVP.all, but instead of implementing\na fail-fast method, it waits until all the promises have returned and\nshows you all the results. This is useful if you want to handle multiple\npromises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled. The return promise is fulfilled with an array of the states of\nthe promises passed into the promises array argument.

\n

Each state object will either indicate fulfillment or rejection, and\nprovide the corresponding value or reason. The states will take one of\nthe following formats:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{ state: 'fulfilled', value: value }\n  or\n{ state: 'rejected', reason: reason }
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
let promise1 = RSVP.Promise.resolve(1);\nlet promise2 = RSVP.Promise.reject(new Error('2'));\nlet promise3 = RSVP.Promise.reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nRSVP.allSettled(promises).then(function(array){\n  // array == [\n  //   { state: 'fulfilled', value: 1 },\n  //   { state: 'rejected', reason: Error },\n  //   { state: 'rejected', reason: Error }\n  // ]\n  // Note that for the second item, reason.message will be '2', and for the\n  // third item, reason.message will be '3'.\n}, function(error) {\n  // Not run. (This block would only be called if allSettled had failed,\n  // for instance if passed an incorrect argument type.)\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "allSettled", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "entries", + "description": "", + "type": "Array" + }, + { + "name": "label", + "description": "- optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with an array of the settled\nstates of the constituent promises.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/all.js", + "line": 3, + "description": "

This is a convenient alias for Promise.all.

\n", + "itemtype": "method", + "name": "all", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/defer.js", + "line": 3, + "description": "

defer returns an object similar to jQuery's $.Deferred.\ndefer should be used when porting over code reliant on $.Deferred's\ninterface. New code should use the Promise constructor instead.

\n

The object returned from defer is a plain object with three properties:

\n
    \n
  • promise - an Promise.
  • \n
  • reject - a function that causes the promise property on this object to\nbecome rejected
  • \n
  • resolve - a function that causes the promise property on this object to\nbecome fulfilled.
  • \n
\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let deferred = defer();\n\ndeferred.resolve("Success!");\n\ndeferred.promise.then(function(value){\n  // value here is "Success!"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "defer", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 19, + "description": "

EventTarget.mixin extends an object with EventTarget methods. For\nExample:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import EventTarget from 'rsvp';\n\nlet object = {};\n\nEventTarget.mixin(object);\n\nobject.on('finished', function(event) {\n  // handle event\n});\n\nobject.trigger('finished', { detail: value });
\n
\n
\n \n

EventTarget.mixin also works with prototypes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EventTarget from 'rsvp';\n\nlet Person = function() {};\nEventTarget.mixin(Person.prototype);\n\nlet yehuda = new Person();\nlet tom = new Person();\n\nyehuda.on('poke', function(event) {\n  console.log('Yehuda says OW');\n});\n\ntom.on('poke', function(event) {\n  console.log('Tom says OW');\n});\n\nyehuda.trigger('poke');\ntom.trigger('poke');
\n
\n
\n \n", + "itemtype": "method", + "name": "mixin", + "access": "private", + "tagname": "", + "params": [ + { + "name": "object", + "description": "object to extend with EventTarget methods", + "type": "Object" + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 107, + "description": "

You can use off to stop firing a particular callback for an event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function doStuff() { // do stuff! }\nobject.on('stuff', doStuff);\n\nobject.trigger('stuff'); // doStuff will be called\n\n// Unregister ONLY the doStuff callback\nobject.off('stuff', doStuff);\nobject.trigger('stuff'); // doStuff will NOT be called
\n
\n
\n \n

If you don't pass a callback argument to off, ALL callbacks for the\nevent will not be executed when the event fires. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let callback1 = function(){};\nlet callback2 = function(){};\n\nobject.on('stuff', callback1);\nobject.on('stuff', callback2);\n\nobject.trigger('stuff'); // callback1 and callback2 will be executed.\n\nobject.off('stuff');\nobject.trigger('stuff'); // callback1 and callback2 will not be executed!
\n
\n
\n \n", + "itemtype": "method", + "name": "off", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "event to stop listening to", + "type": "String" + }, + { + "name": "callback", + "description": "optional argument. If given, only the function\ngiven will be removed from the event's callback queue. If no `callback`\nargument is given, all callbacks will be removed from the event's callback\nqueue.", + "type": "Function", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 162, + "description": "

Use trigger to fire custom events. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
object.on('foo', function(){\n  console.log('foo event happened!');\n});\nobject.trigger('foo');\n// 'foo event happened!' logged to the console
\n
\n
\n \n

You can also pass a value as a second argument to trigger that will be\npassed as an argument to all event listeners for the event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
object.on('foo', function(value){\n  console.log(value.name);\n});\n\nobject.trigger('foo', { name: 'bar' });\n// 'bar' logged to the console
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "name of the event to be triggered", + "type": "String" + }, + { + "name": "options", + "description": "optional value to be passed to any event handlers for\nthe given `eventName`", + "type": "*", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/filter.js", + "line": 42, + "description": "

filter is similar to JavaScript's native filter method.\nfilterFn is eagerly called meaning that as soon as any promise\n resolves its value will be passed to filterFn. filter returns\n a promise that will become fulfilled with the result of running\n filterFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { filter, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\n\nlet promises = [promise1, promise2, promise3];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(result){\n  // result is [ 2, 3 ]\n});
\n
\n
\n \n

If any of the promises given to filter are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { filter, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

filter will also wait for any promises returned from filterFn.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter, resolve } from 'rsvp';\n\nlet alice = { name: 'alice' };\nlet bob   = { name: 'bob' };\nlet users = [ alice, bob ];\n\nlet promises = users.map(function(user){\n  return resolve(user);\n});\n\nlet filterFn = function(user){\n  // Here, Alice has permissions to create a blog post, but Bob does not.\n  return getPrivilegesForUser(user).then(function(privs){\n    return privs.can_create_blog_post === true;\n  });\n};\nfilter(promises, filterFn).then(function(users){\n  // true, because the server told us only Alice can create a blog post.\n  users.length === 1;\n  // false, because Alice is the only user present in `users`\n  users[0] === bob;\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "filterFn", + "description": "- function to be called on each resolved value to\n filter the final results.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string describing the promise. Useful for\n tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash-settled.js", + "line": 16, + "description": "

hashSettled is similar to allSettled, but takes an object\ninstead of an array for its promises argument.

\n

Unlike all or hash, which implement a fail-fast method,\nbut like allSettled, hashSettled waits until all the\nconstituent promises have returned and then shows you all the results\nwith their states and values/reasons. This is useful if you want to\nhandle multiple promises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled, or rejected if the passed parameters are invalid.

\n

The returned promise is fulfilled with a hash that has the same key names as\nthe promises object argument. If any of the values in the object are not\npromises, they will be copied over to the fulfilled object and marked with state\n'fulfilled'.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: { state: 'fulfilled', value: 1 },\n  //   yourPromise: { state: 'fulfilled', value: 2 },\n  //   theirPromise: { state: 'fulfilled', value: 3 },\n  //   notAPromise: { state: 'fulfilled', value: 4 }\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the state will\nbe set to 'rejected' and the reason for rejection provided.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, reject, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejection')),\n  anotherRejectedPromise: reject(new Error('more rejection')),\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise:              { state: 'fulfilled', value: 1 },\n  //   rejectedPromise:        { state: 'rejected', reason: Error },\n  //   anotherRejectedPromise: { state: 'rejected', reason: Error },\n  // }\n  // Note that for rejectedPromise, reason.message == 'rejection',\n  // and for anotherRejectedPromise, reason.message == 'more rejection'.\n});
\n
\n
\n \n

An important note: hashSettled is intended for plain JavaScript objects that\nare just a set of keys and values. hashSettled will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import Promise, { hashSettled, resolve } from 'rsvp';\n\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: Promise.resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhashSettled(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: { state: 'fulfilled', value: 'Example' }\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hashSettled", + "access": "public", + "tagname": "", + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when when all properties of `promises`\nhave been settled.", + "type": "Promise" + }, + "static": 1, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash.js", + "line": 4, + "description": "

hash is similar to all, but takes an object instead of an array\nfor its promises argument.

\n

Returns a promise that is fulfilled when all the given promises have been\nfulfilled, or rejected if any of them become rejected. The returned promise\nis fulfilled with a hash that has the same key names as the promises object\nargument. If any of the values in the object are not promises, they will\nsimply be copied over to the fulfilled object.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhash(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: 1,\n  //   yourPromise: 2,\n  //   theirPromise: 3,\n  //   notAPromise: 4\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the first promise\nthat is rejected will be given as the reason to the rejection handler.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejectedPromise')),\n  anotherRejectedPromise: reject(new Error('anotherRejectedPromise')),\n};\n\nhash(promises).then(function(hash){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === 'rejectedPromise'\n});
\n
\n
\n \n

An important note: hash is intended for plain JavaScript objects that\nare just a set of keys and values. hash will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { hash, resolve } from 'rsvp';\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhash(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: 'Example'\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all properties of `promises`\nhave been fulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/map.js", + "line": 39, + "description": "

map is similar to JavaScript's native map method. mapFn is eagerly called\n meaning that as soon as any promise resolves its value will be passed to mapFn.\n map returns a promise that will become fulfilled with the result of running\n mapFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(result){\n  // result is [ 2, 3, 4 ]\n});
\n
\n
\n \n

If any of the promises given to map are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { map, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

map will also wait if a promise is returned from mapFn. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first because they contain a url to those comments.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map } from 'rsvp';\n\nlet mapFn = function(blogPost){\n  // getComments does some ajax and returns an Promise that is fulfilled\n  // with some comments data\n  return getComments(blogPost.comments_url);\n};\n\n// getBlogPosts does some ajax and returns an Promise that is fulfilled\n// with some blog post data\nmap(getBlogPosts(), mapFn).then(function(comments){\n  // comments is the result of asking the server for the comments\n  // of all blog posts returned from getBlogPosts()\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "mapFn", + "description": "function to be called on each fulfilled promise.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\n Useful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/node.js", + "line": 44, + "description": "

denodeify takes a 'node-style' function and returns a function that\nwill return an Promise. You can use denodeify in Node.js or the\nbrowser when you'd prefer to use promises over using callbacks. For example,\ndenodeify transforms the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) return handleError(err);\n  handleData(data);\n});
\n
\n
\n \n

into:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\n\nreadFile('myfile.txt').then(handleData, handleError);
\n
\n
\n \n

If the node function has multiple success parameters, then denodeify\njust returns the first one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let request = denodeify(require('request'));\n\nrequest('http://example.com').then(function(res) {\n  // ...\n});
\n
\n
\n \n

However, if you need all success parameters, setting denodeify's\nsecond parameter to true causes it to return all success parameters\nas an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), true);\n\nrequest('http://example.com').then(function(result) {\n  // result[0] -> res\n  // result[1] -> body\n});
\n
\n
\n \n

Or if you pass it an array with names it returns the parameters as a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), ['res', 'body']);\n\nrequest('http://example.com').then(function(result) {\n  // result.res\n  // result.body\n});
\n
\n
\n \n

Sometimes you need to retain the this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let app = require('express')();\nlet render = denodeify(app.render.bind(app));
\n
\n
\n \n

The denodified function inherits from the original function. It works in all\nenvironments, except IE 10 and below. Consequently all properties of the original\nfunction are available to you. However, any properties you change on the\ndenodeified function won't be changed on the original function. Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request')),\n    cookieJar = request.jar(); // <- Inheritance is used here\n\nrequest('http://example.com', {jar: cookieJar}).then(function(res) {\n  // cookieJar.cookies holds now the cookies returned by example.com\n});
\n
\n
\n \n

Using denodeify makes it easier to compose asynchronous operations instead\nof using callbacks. For example, instead of:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) { ... } // Handle error\n  fs.writeFile('myfile2.txt', data, function(err){\n    if (err) { ... } // Handle error\n    console.log('done')\n  });\n});
\n
\n
\n \n

you can chain the operations together using then from the returned promise:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\nlet writeFile = denodeify(fs.writeFile);\n\nreadFile('myfile.txt').then(function(data){\n  return writeFile('myfile2.txt', data);\n}).then(function(){\n  console.log('done')\n}).catch(function(error){\n  // Handle error\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "denodeify", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "nodeFunc", + "description": "a 'node-style' function that takes a callback as\nits last argument. The callback expects an error to be passed as its first\nargument (if an error occurred, otherwise null), and the value from the\noperation as its second argument ('function(err, value){ }').", + "type": "Function" + }, + { + "name": "options", + "description": "An optional paramter that if set\nto `true` causes the promise to fulfill with the callback's success arguments\nas an array. This is useful if the node function has multiple success\nparamters. If you set this paramter to an array with names, the promise will\nfulfill with a hash with these names as keys and the success parameters as\nvalues.", + "type": "Boolean|Array", + "optional": true + } + ], + "return": { + "description": "a function that wraps `nodeFunc` to return a `Promise`", + "type": "Function" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/race.js", + "line": 3, + "description": "

This is a convenient alias for Promise.race.

\n", + "itemtype": "method", + "name": "race", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/reject.js", + "line": 3, + "description": "

This is a convenient alias for Promise.reject.

\n", + "itemtype": "method", + "name": "reject", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/resolve.js", + "line": 3, + "description": "

This is a convenient alias for Promise.resolve.

\n", + "itemtype": "method", + "name": "resolve", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "value", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/rethrow.js", + "line": 1, + "description": "

rethrow will rethrow an error on the next turn of the JavaScript event\nloop in order to aid debugging.

\n

Promises A+ specifies that any exceptions that occur with a promise must be\ncaught by the promises implementation and bubbled to the last handler. For\nthis reason, it is recommended that you always specify a second rejection\nhandler function to then. However, rethrow will throw the exception\noutside of the promise, so it bubbles up to your console if in the browser,\nor domain/cause uncaught exception in Node. rethrow will also throw the\nerror again so the error can be handled by the promise per the spec.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { rethrow } from 'rsvp';\n\nfunction throws(){\n  throw new Error('Whoops!');\n}\n\nlet promise = new Promise(function(resolve, reject){\n  throws();\n});\n\npromise.catch(rethrow).then(function(){\n  // Code here doesn't run because the promise became rejected due to an\n  // error!\n}, function (err){\n  // handle the error here\n});
\n
\n
\n \n

The 'Whoops' error will be thrown on the next turn of the event loop\nand you can watch for it in your console. You can also handle it using a\nrejection handler given to .then or .catch on the returned promise.

\n", + "itemtype": "method", + "name": "rethrow", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "reason the promise became rejected.", + "type": "Error" + } + ], + "throws": { + "description": "Error" + }, + "class": "rsvp", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/component-e42655d49a.json b/json-docs/ember/4.10.0/modules/ember-4.10.0-@ember/component-f1f08dc9bd.json similarity index 99% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/component-e42655d49a.json rename to json-docs/ember/4.10.0/modules/ember-4.10.0-@ember/component-f1f08dc9bd.json index 8a8d1326f..76f639a8d 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/component-e42655d49a.json +++ b/json-docs/ember/4.10.0/modules/ember-4.10.0-@ember/component-f1f08dc9bd.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/component", + "id": "ember-4.10.0-@ember/component", "type": "module", "attributes": { "name": "@ember/component", @@ -72,7 +72,7 @@ } ] }, - "version": "4.12.1" + "version": "4.10.0" }, "relationships": { "classes": { @@ -80,7 +80,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@glimmer/component-9ec1618899.json b/json-docs/ember/4.10.0/modules/ember-4.10.0-@glimmer/component-3e7ab81f43.json similarity index 99% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@glimmer/component-9ec1618899.json rename to json-docs/ember/4.10.0/modules/ember-4.10.0-@glimmer/component-3e7ab81f43.json index d491c4858..d492eadb1 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@glimmer/component-9ec1618899.json +++ b/json-docs/ember/4.10.0/modules/ember-4.10.0-@glimmer/component-3e7ab81f43.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@glimmer/component", + "id": "ember-4.10.0-@glimmer/component", "type": "module", "attributes": { "name": "@glimmer/component", @@ -19,7 +19,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.10.0" }, "relationships": { "classes": { @@ -27,7 +27,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/namespaces/ember-4.12.1-AutoLocation-9b0646baf8.json b/json-docs/ember/4.10.0/namespaces/ember-4.10.0-AutoLocation-743811f64d.json similarity index 98% rename from json-docs/ember/4.12.1/namespaces/ember-4.12.1-AutoLocation-9b0646baf8.json rename to json-docs/ember/4.10.0/namespaces/ember-4.10.0-AutoLocation-743811f64d.json index 9dd475023..c361ff7c4 100644 --- a/json-docs/ember/4.12.1/namespaces/ember-4.12.1-AutoLocation-9b0646baf8.json +++ b/json-docs/ember/4.10.0/namespaces/ember-4.10.0-AutoLocation-743811f64d.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-AutoLocation", + "id": "ember-4.10.0-AutoLocation", "type": "namespace", "attributes": { "name": "AutoLocation", @@ -114,13 +114,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/routing/auto-location", + "id": "ember-4.10.0-@ember/routing/auto-location", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.10.0", "type": "project-version" } } diff --git a/json-docs/ember/4.10.0/namespaces/ember-4.10.0-Instrumentation-ff405043b4.json b/json-docs/ember/4.10.0/namespaces/ember-4.10.0-Instrumentation-ff405043b4.json new file mode 100644 index 000000000..6e392a878 --- /dev/null +++ b/json-docs/ember/4.10.0/namespaces/ember-4.10.0-Instrumentation-ff405043b4.json @@ -0,0 +1,46 @@ +{ + "data": { + "id": "ember-4.10.0-Instrumentation", + "type": "namespace", + "attributes": { + "name": "Instrumentation", + "shortname": "Instrumentation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/instrumentation", + "namespace": "", + "file": "packages/@ember/instrumentation/index.ts", + "line": 40, + "description": "

The purpose of the Ember Instrumentation module is\nto provide efficient, general-purpose instrumentation\nfor Ember.

\n

Subscribe to a listener by using subscribe:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { subscribe } from '@ember/instrumentation';\n\nsubscribe("render", {\n  before(name, timestamp, payload) {\n\n  },\n\n  after(name, timestamp, payload) {\n\n  }\n});
\n
\n
\n \n

If you return a value from the before callback, that same\nvalue will be passed as a fourth parameter to the after\ncallback.

\n

Instrument a block of code by using instrument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { instrument } from '@ember/instrumentation';\n\ninstrument("render.handlebars", payload, function() {\n  // rendering logic\n}, binding);
\n
\n
\n \n

Event names passed to instrument are namespaced\nby periods, from more general to more specific. Subscribers\ncan listen for events by whatever level of granularity they\nare interested in.

\n

In the above example, the event is render.handlebars,\nand the subscriber listened for all events beginning with\nrender. It would receive callbacks for events named\nrender, render.handlebars, render.container, or\neven render.handlebars.layout.

\n", + "static": 1, + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.10.0-@ember/instrumentation", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.10.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/application-51a520a6b0.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/application-51a520a6b0.json new file mode 100644 index 000000000..009a28355 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/application-51a520a6b0.json @@ -0,0 +1,89 @@ +{ + "data": { + "id": "ember-4.11.0-@ember/application", + "type": "class", + "attributes": { + "name": "@ember/application", + "shortname": "@ember/application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 14, + "description": "

Detects when a specific package of Ember (e.g. 'Application')\nhas fully loaded and is available for extension.

\n

The provided callback will be called with the name passed\nresolved from a string into the object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { onLoad } from '@ember/application';\n\nonLoad('Ember.Application' function(hbars) {\n  hbars.registerHelper(...);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "onLoad", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "callback", + "description": "callback to be called", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 47, + "description": "

Called when an Ember.js package (e.g Application) has finished\nloading. Triggers any callbacks registered for this event.

\n", + "itemtype": "method", + "name": "runLoadHooks", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "object", + "description": "object to pass to callbacks", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/component/helper-dfb6ff4f54.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/component/helper-dfb6ff4f54.json new file mode 100644 index 000000000..94b62c7f5 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/component/helper-dfb6ff4f54.json @@ -0,0 +1,61 @@ +{ + "data": { + "id": "ember-4.11.0-@ember/component/helper", + "type": "class", + "attributes": { + "name": "@ember/component/helper", + "shortname": "@ember/component/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 47, + "description": "

In many cases it is not necessary to use the full Helper class.\nThe helper method create pure-function helpers without instances.\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n
import { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n  return `${currency}${cents * 0.01}`;\n});
\n
\n
\n \n", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/debug-d4c8570053.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/debug-4aea88c042.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/debug-d4c8570053.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/debug-4aea88c042.json index 8691803a3..e2fa7d4a7 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/debug-d4c8570053.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/debug-4aea88c042.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/debug", + "id": "ember-4.11.0-@ember/debug", "type": "class", "attributes": { "name": "@ember/debug", @@ -319,13 +319,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/debug", + "id": "ember-4.11.0-@ember/debug", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/destroyable-de1a9a1c25.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/destroyable-de1a9a1c25.json new file mode 100644 index 000000000..d44ac9fc9 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/destroyable-de1a9a1c25.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.11.0-@ember/destroyable", + "type": "class", + "attributes": { + "name": "@ember/destroyable", + "shortname": "@ember/destroyable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/destroyable", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/destroyable/index.ts", + "line": 31, + "description": "

This function is used to associate a destroyable object with a parent. When the parent\nis destroyed, all registered children will also be destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
class CustomSelect extends Component {\n  constructor(...args) {\n    super(...args);\n\n    // obj is now a child of the component. When the component is destroyed,\n    // obj will also be destroyed, and have all of its destructors triggered.\n    this.obj = associateDestroyableChild(this, {});\n  }\n}
\n
\n
\n \n

Returns the associated child for convenience.

\n", + "itemtype": "method", + "name": "associateDestroyableChild", + "params": [ + { + "name": "parent", + "description": "the destroyable to entangle the child destroyables lifetime with", + "type": "Object|Function" + }, + { + "name": "child", + "description": "the destroyable to be entangled with the parents lifetime", + "type": "Object|Function" + } + ], + "return": { + "description": "the child argument", + "type": "Object|Function" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 58, + "description": "

Receives a destroyable, and returns true if the destroyable has begun destroying. Otherwise returns\nfalse.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let obj = {};\nisDestroying(obj); // false\ndestroy(obj);\nisDestroying(obj); // true\n// ...sometime later, after scheduled destruction\nisDestroyed(obj); // true\nisDestroying(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroying", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 80, + "description": "

Receives a destroyable, and returns true if the destroyable has finished destroying. Otherwise\nreturns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let obj = {};\n\nisDestroyed(obj); // false\ndestroy(obj);\n\n// ...sometime later, after scheduled destruction\n\nisDestroyed(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroyed", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 103, + "description": "

Initiates the destruction of a destroyable object. It runs all associated destructors, and then\ndestroys all children recursively.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let obj = {};\n\nregisterDestructor(obj, () => console.log('destroyed!'));\n\ndestroy(obj); // this will schedule the destructor to be called\n\n// ...some time later, during scheduled destruction\n\n// destroyed!
\n
\n
\n \n

Destruction via destroy() follows these steps:

\n

1, Mark the destroyable such that isDestroying(destroyable) returns true\n2, Call destroy() on each of the destroyable's associated children\n3, Schedule calling the destroyable's destructors\n4, Schedule setting destroyable such that isDestroyed(destroyable) returns true

\n

This results in the entire tree of destroyables being first marked as destroying,\nthen having all of their destructors called, and finally all being marked as isDestroyed.\nThere won't be any in between states where some items are marked as isDestroying while\ndestroying, while others are not.

\n", + "itemtype": "method", + "name": "destroy", + "params": [ + { + "name": "destroyable", + "description": "the object to destroy", + "type": "Object|Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 138, + "description": "

This function asserts that all objects which have associated destructors or associated children\nhave been destroyed at the time it is called. It is meant to be a low level hook that testing\nframeworks can use to hook into and validate that all destroyables have in fact been destroyed.

\n

This function requires that enableDestroyableTracking was called previously, and is only\navailable in non-production builds.

\n", + "itemtype": "method", + "name": "assertDestroyablesDestroyed", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 152, + "description": "

This function instructs the destroyable system to keep track of all destroyables (their\nchildren, destructors, etc). This enables a future usage of assertDestroyablesDestroyed\nto be used to ensure that all destroyable tasks (registered destructors and associated children)\nhave completed when assertDestroyablesDestroyed is called.

\n", + "itemtype": "method", + "name": "enableDestroyableTracking", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 164, + "description": "

Receives a destroyable object and a destructor function, and associates the\nfunction with it. When the destroyable is destroyed with destroy, or when its\nparent is destroyed, the destructor function will be called.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, () => this.resize.unregister(this));\n  }\n}
\n
\n
\n \n

Multiple destructors can be associated with a given destroyable, and they can be\nassociated over time, allowing libraries to dynamically add destructors as needed.\nregisterDestructor also returns the associated destructor function, for convenience.

\n

The destructor function is passed a single argument, which is the destroyable itself.\nThis allows the function to be reused multiple times for many destroyables, rather\nthan creating a closure function per destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nfunction unregisterResize(instance) {\n  instance.resize.unregister(instance);\n}\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, unregisterResize);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "registerDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to register the destructor function with", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to run when the destroyable object is destroyed", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 229, + "description": "

Receives a destroyable and a destructor function, and de-associates the destructor\nfrom the destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor, unregisterDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service modals;\n\n  constructor(...args) {\n    super(...args);\n\n    this.modals.add(this);\n\n    this.modalDestructor = registerDestructor(this, () => this.modals.remove(this));\n  }\n\n  @action pinModal() {\n    unregisterDestructor(this, this.modalDestructor);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "unregisterDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to unregister the destructor function from", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to remove from the destroyable", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/destroyable", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/helper-bb51052029.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/helper-bb51052029.json new file mode 100644 index 000000000..28e4463e2 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/helper-bb51052029.json @@ -0,0 +1,128 @@ +{ + "data": { + "id": "ember-4.11.0-@ember/helper", + "type": "class", + "attributes": { + "name": "@ember/helper", + "shortname": "@ember/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/helper", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/helper/index.ts", + "line": 5, + "description": "

capabilities returns a capabilities configuration which can be used to modify\nthe behavior of the manager. Manager capabilities must be provided using the\ncapabilities function, as the underlying implementation can change over time.

\n

The first argument to capabilities is a version string, which is the version of\nEmber that the capabilities were defined in. Ember can add new versions at any\ntime, and these may have entirely different behaviors, but it will not remove\nold versions until the next major version.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
capabilities('3.23');
\n
\n
\n \n

The second argument is an object of capabilities and boolean values indicating\nwhether they are enabled or disabled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
capabilities('3.23', {\n  hasValue: true,\n  hasDestructor: true,\n});
\n
\n
\n \n

If no value is specified, then the default value will be used.

\n

3.23 capabilities

\n

hasDestroyable

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a destroyable to include in the destructor\nhierarchy. If enabled, the getDestroyable hook will be called, and its result\nwill be associated with the destroyable parent block.

\n

hasValue

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a value which can be used externally. The helper's\ngetValue hook will be run whenever the value of the helper is accessed if this\ncapability is enabled.

\n", + "itemtype": "method", + "name": "capabilities", + "static": 1, + "params": [ + { + "name": "managerApiVersion", + "description": "The version of capabilities that are being used", + "type": "String" + }, + { + "name": "options", + "description": "The capabilities values" + } + ], + "return": { + "description": "The capabilities object instance", + "type": "Capabilities" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 58, + "description": "

Sets the helper manager for an object or function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
setHelperManager((owner) => new ClassHelperManager(owner), Helper)
\n
\n
\n \n

When a value is used as a helper in a template, the helper manager is looked up\non the object by walking up its prototype chain and finding the first helper\nmanager. This manager then receives the value and can create and manage an\ninstance of a helper from it. This provides a layer of indirection that allows\nusers to design high-level helper APIs, without Ember needing to worry about the\ndetails. High-level APIs can be experimented with and iterated on while the\ncore of Ember helpers remains stable, and new APIs can be introduced gradually\nover time to existing code bases.

\n

setHelperManager receives two arguments:

\n
    \n
  1. A factory function, which receives the owner and returns an instance of a\n helper manager.
  2. \n
  3. A helper definition, which is the object or function to associate the factory function with.
  4. \n
\n

The first time the object is looked up, the factory function will be called to\ncreate the helper manager. It will be cached, and in subsequent lookups the\ncached helper manager will be used instead.

\n

Only one helper manager is guaranteed to exist per owner and per usage of\nsetHelperManager, so many helpers will end up using the same instance of the\nhelper manager. As such, you should only store state that is related to the\nmanager itself. If you want to store state specific to a particular helper\ndefinition, you should assign a unique helper manager to that helper. In\ngeneral, most managers should either be stateless, or only have the owner they\nwere created with as state.

\n

Helper managers must fulfill the following interface (This example uses\nTypeScript interfaces\nfor precision, you do not need to write helper managers using TypeScript):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
interface HelperManager<HelperStateBucket> {\n  capabilities: HelperCapabilities;\n\n  createHelper(definition: HelperDefinition, args: TemplateArgs): HelperStateBucket;\n\n  getValue?(bucket: HelperStateBucket): unknown;\n\n  runEffect?(bucket: HelperStateBucket): void;\n\n  getDestroyable?(bucket: HelperStateBucket): object;\n}
\n
\n
\n \n

The capabilities property must be provided using the capabilities() function\nimported from the same module as setHelperManager:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capabilities } from '@ember/helper';\n\nclass MyHelperManager {\n  capabilities = capabilities('3.21.0', { hasValue: true });\n\n  // ...snip...\n}
\n
\n
\n \n

Below is a description of each of the methods on the interface and their\nfunctions.

\n

createHelper

\n

createHelper is a required hook on the HelperManager interface. The hook is\npassed the definition of the helper that is currently being created, and is\nexpected to return a state bucket. This state bucket is what represents the\ncurrent state of the helper, and will be passed to the other lifecycle hooks at\nappropriate times. It is not necessarily related to the definition of the\nhelper itself - for instance, you could return an object containing an\ninstance of the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
class MyManager {\n  createHelper(Definition, args) {\n    return {\n      instance: new Definition(args);\n    };\n  }\n}
\n
\n
\n \n

This allows the manager to store metadata that it doesn't want to expose to the\nuser.

\n

This hook is not autotracked - changes to tracked values used within this hook\nwill not result in a call to any of the other lifecycle hooks. This is because\nit is unclear what should happen if it invalidates, and rather than make a\ndecision at this point, the initial API is aiming to allow as much expressivity\nas possible. This could change in the future with changes to capabilities and\ntheir behaviors.

\n

If users do want to autotrack some values used during construction, they can\neither create the instance of the helper in runEffect or getValue, or they\ncan use the cache API to autotrack the createHelper hook themselves. This\nprovides maximum flexibility and expressiveness to manager authors.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called as discovered during DOM construction
  • \n
  • called in definition order in the template
  • \n
\n

getValue

\n

getValue is an optional hook that should return the value of the helper. This\nis the value that is returned from the helper and passed into the template.

\n

This hook is called when the value is requested from the helper (e.g. when the\ntemplate is rendering and the helper value is needed). The hook is autotracked,\nand will rerun whenever any tracked values used inside of it are updated.\nOtherwise it does not rerun.

\n
\n

Note: This means that arguments which are not consumed within the hook will\nnot trigger updates.

\n
\n

This hook is only called for helpers with the hasValue capability enabled.\nThis hook has the following timing semantics:

\n

Always

\n
    \n
  • called the first time the helper value is requested
  • \n
  • called after autotracked state has changed
  • \n
\n

Never

\n
    \n
  • called if the hasValue capability is disabled
  • \n
\n

runEffect

\n

runEffect is an optional hook that should run the effect that the helper is\napplying, setting it up or updating it.

\n

This hook is scheduled to be called some time after render and prior to paint.\nThere is not a guaranteed, 1-to-1 relationship between a render pass and this\nhook firing. For instance, multiple render passes could occur, and the hook may\nonly trigger once. It may also never trigger if it was dirtied in one render\npass and then destroyed in the next.

\n

The hook is autotracked, and will rerun whenever any tracked values used inside\nof it are updated. Otherwise it does not rerun.

\n

The hook is also run during a time period where state mutations are disabled\nin Ember. Any tracked state mutation will throw an error during this time,\nincluding changes to tracked properties, changes made using Ember.set, updates\nto computed properties, etc. This is meant to prevent infinite rerenders and\nother antipatterns.

\n

This hook is only called for helpers with the hasScheduledEffect capability\nenabled. This hook is also not called in SSR currently, though this could be\nadded as a capability in the future. It has the following timing semantics:

\n

Always

\n
    \n
  • called after the helper was first created, if the helper has not been\ndestroyed since creation
  • \n
  • called after autotracked state has changed, if the helper has not been\ndestroyed during render
  • \n
\n

Never

\n
    \n
  • called if the hasScheduledEffect capability is disabled
  • \n
  • called in SSR
  • \n
\n

getDestroyable

\n

getDestroyable is an optional hook that users can use to register a\ndestroyable object for the helper. This destroyable will be registered to the\ncontaining block or template parent, and will be destroyed when it is destroyed.\nSee the Destroyables RFC\nfor more details.

\n

getDestroyable is only called if the hasDestroyable capability is enabled.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called immediately after the createHelper hook is called
  • \n
\n

Never

\n
    \n
  • called if the hasDestroyable capability is disabled
  • \n
\n", + "itemtype": "method", + "name": "setHelperManager", + "static": 1, + "params": [ + { + "name": "factory", + "description": "A factory function which receives an optional owner, and returns a helper manager", + "type": "Function" + }, + { + "name": "definition", + "description": "The definition to associate the manager factory with", + "type": "Object" + } + ], + "return": { + "description": "The definition passed into setHelperManager", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 251, + "description": "

The invokeHelper function can be used to create a helper instance in\nJavaScript.

\n

To access a helper's value you have to use getValue from\n@glimmer/tracking/primitives/cache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
// app/components/data-loader.js\nimport Component from '@glimmer/component';\nimport { getValue } from '@glimmer/tracking/primitives/cache';\nimport Helper from '@ember/component/helper';\nimport { invokeHelper } from '@ember/helper';\n\nclass PlusOne extends Helper {\n  compute([number]) {\n    return number + 1;\n  }\n}\n\nexport default class PlusOneComponent extends Component {\n  plusOne = invokeHelper(this, PlusOne, () => {\n    return {\n      positional: [this.args.number],\n    };\n  });\n\n  get value() {\n    return getValue(this.plusOne);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{this.value}}
\n
\n
\n \n

It receives three arguments:

\n
    \n
  • context: The parent context of the helper. When the parent is torn down and\nremoved, the helper will be as well.
  • \n
  • definition: The definition of the helper.
  • \n
  • computeArgs: An optional function that produces the arguments to the helper.\nThe function receives the parent context as an argument, and must return an\nobject with a positional property that is an array and/or a named\nproperty that is an object.
  • \n
\n

And it returns a Cache instance that contains the most recent value of the\nhelper. You can access the helper using getValue() like any other cache. The\ncache is also destroyable, and using the destroy() function on it will cause\nthe helper to be torn down.

\n

Note that using getValue() on helpers that have scheduled effects will not\ntrigger the effect early. Effects will continue to run at their scheduled time.

\n", + "itemtype": "method", + "name": "invokeHelper", + "static": 1, + "params": [ + { + "name": "context", + "description": "The parent context of the helper", + "type": "Object" + }, + { + "name": "definition", + "description": "The helper definition", + "type": "Object" + }, + { + "name": "computeArgs", + "description": "An optional function that produces args", + "type": "Function" + } + ], + "return": { + "description": "" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/helper", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object-603c9f7dc3.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/object-3b94521639.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object-603c9f7dc3.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/object-3b94521639.json index de62f621f..944fef465 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object-603c9f7dc3.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/object-3b94521639.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/object", + "id": "ember-4.11.0-@ember/object", "type": "class", "attributes": { "name": "@ember/object", @@ -506,13 +506,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/object", + "id": "ember-4.11.0-@ember/object", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/object/compat-3d1be7e1e5.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/object/compat-3d1be7e1e5.json new file mode 100644 index 000000000..708004f26 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/object/compat-3d1be7e1e5.json @@ -0,0 +1,64 @@ +{ + "data": { + "id": "ember-4.11.0-@ember/object/compat", + "type": "class", + "attributes": { + "name": "@ember/object/compat", + "shortname": "@ember/object/compat", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/object/compat.ts", + "line": 40, + "description": "

@dependentKeyCompat is decorator that can be used on native getters that\nuse tracked properties. It exposes the getter to Ember's classic computed\nproperty and observer systems, so they can watch it for changes. It can be\nused in both native and classic classes.

\n

Native Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { computed, set } from '@ember/object';\n\nclass Person {\n  @tracked firstName;\n  @tracked lastName;\n\n  @dependentKeyCompat\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nclass Profile {\n  constructor(person) {\n    set(this, 'person', person);\n  }\n\n  @computed('person.fullName')\n  get helloMessage() {\n    return `Hello, ${this.person.fullName}!`;\n  }\n}
\n
\n
\n \n

Classic Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport EmberObject, { computed, observer, set } from '@ember/object';\n\nconst Person = EmberObject.extend({\n  firstName: tracked(),\n  lastName: tracked(),\n\n  fullName: dependentKeyCompat(function() {\n    return `${this.firstName} ${this.lastName}`;\n  }),\n});\n\nconst Profile = EmberObject.extend({\n  person: null,\n\n  helloMessage: computed('person.fullName', function() {\n    return `Hello, ${this.person.fullName}!`;\n  }),\n\n  onNameUpdated: observer('person.fullName', function() {\n    console.log('person name updated!');\n  }),\n});
\n
\n
\n \n

dependentKeyCompat() can receive a getter function or an object containing\nget/set methods when used in classic classes, like computed properties.

\n

In general, only properties which you expect to be watched by older,\nuntracked clases should be marked as dependency compatible. The decorator is\nmeant as an interop layer for parts of Ember's older classic APIs, and should\nnot be applied to every possible getter/setter in classes. The number of\ndependency compatible getters should be minimized wherever possible. New\napplication code should not need to use @dependentKeyCompat, since it is\nonly for interoperation with older code.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "dependentKeyCompat", + "static": 1, + "params": [ + { + "name": "desc", + "description": "A property descriptor containing\n the getter and setter (when used in\n classic classes)", + "type": "PropertyDescriptor|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object/compat", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/object/computed-a71312e35f.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/object/computed-a71312e35f.json new file mode 100644 index 000000000..e028f1aa1 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/object/computed-a71312e35f.json @@ -0,0 +1,903 @@ +{ + "data": { + "id": "ember-4.11.0-@ember/object/computed", + "type": "class", + "attributes": { + "name": "@ember/object/computed", + "shortname": "@ember/object/computed", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/expand_properties.ts", + "line": 9, + "description": "

Expands pattern, invoking callback for each expansion.

\n

The only pattern supported is brace-expansion, anything else will be passed\nonce to callback directly.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { expandProperties } from '@ember/object/computed';\n\nfunction echo(arg){ console.log(arg); }\n\nexpandProperties('foo.bar', echo);              //=> 'foo.bar'\nexpandProperties('{foo,bar}', echo);            //=> 'foo', 'bar'\nexpandProperties('foo.{bar,baz}', echo);        //=> 'foo.bar', 'foo.baz'\nexpandProperties('{foo,bar}.baz', echo);        //=> 'foo.baz', 'bar.baz'\nexpandProperties('foo.{bar,baz}.[]', echo)      //=> 'foo.bar.[]', 'foo.baz.[]'\nexpandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs'\nexpandProperties('{foo}.bar.{baz}')             //=> 'foo.bar.baz'
\n
\n
\n \n", + "itemtype": "method", + "name": "expandProperties", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "pattern", + "description": "The property pattern to expand.", + "type": "String" + }, + { + "name": "callback", + "description": "The callback to invoke. It is invoked once per\nexpansion, and is passed the expansion.", + "type": "Function" + } + ], + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 60, + "description": "

A computed property macro that returns true if the value of the dependent\nproperty is null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { empty } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  @empty('todos') isDone;\n}\n\nlet todoList = new ToDoList(\n  ['Unit Test', 'Documentation', 'Release']\n);\n\ntodoList.isDone; // false\nset(todoList, 'todos', []);\ntodoList.isDone; // true
\n
\n
\n \n", + "since": "1.6.0", + "itemtype": "method", + "name": "empty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if the value\nof the dependent property is null, an empty string, empty array, or empty\nfunction and false if the underlying value is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 109, + "description": "

A computed property that returns true if the value of the dependent property\nis NOT null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { notEmpty } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(backpack) {\n    set(this, 'backpack', backpack);\n  }\n\n  @notEmpty('backpack') hasStuff\n}\n\nlet hamster = new Hamster(\n  ['Food', 'Sleeping Bag', 'Tent']\n);\n\nhamster.hasStuff; // true\nset(hamster, 'backpack', []);\nhamster.hasStuff; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "notEmpty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 155, + "description": "

A computed property that returns true if the value of the dependent property\nis null or undefined. This avoids errors from JSLint complaining about use of\n==, which can be technically confusing.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { none } from '@ember/object/computed';\n\nclass Hamster {\n  @none('food') isHungry;\n}\n\nlet hamster = new Hamster();\n\nhamster.isHungry; // true\n\nset(hamster, 'food', 'Banana');\nhamster.isHungry; // false\n\nset(hamster, 'food', null);\nhamster.isHungry; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "none", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is null or undefined.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 198, + "description": "

A computed property that returns the inverse boolean value of the original\nvalue for the dependent property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { not } from '@ember/object/computed';\n\nclass User {\n  loggedIn = false;\n\n  @not('loggedIn') isAnonymous;\n}\n\nlet user = new User();\n\nuser.isAnonymous; // true\nset(user, 'loggedIn', true);\nuser.isAnonymous; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "not", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns inverse of the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 240, + "description": "

A computed property that converts the provided dependent property into a\nboolean value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { bool } from '@ember/object/computed';\n\n\nclass Hamster {\n  @bool('numBananas') hasBananas\n}\n\nlet hamster = new Hamster();\n\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 0);\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 1);\nhamster.hasBananas; // true\n\nset(hamster, 'numBananas', null);\nhamster.hasBananas; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "bool", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which converts to boolean the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 288, + "description": "

A computed property which matches the original value for the dependent\nproperty against a given RegExp, returning true if the value matches the\nRegExp and false if it does not.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { match } from '@ember/object/computed';\n\nclass User {\n  @match('email', /^.+@.+\\..+$/) hasValidEmail;\n}\n\nlet user = new User();\n\nuser.hasValidEmail; // false\n\nset(user, 'email', '');\nuser.hasValidEmail; // false\n\nset(user, 'email', 'ember_hamster@example.com');\nuser.hasValidEmail; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "match", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "regexp", + "description": "", + "type": "RegExp" + } + ], + "return": { + "description": "computed property which match the original value\nfor property against a given RegExp", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 335, + "description": "

A computed property that returns true if the provided dependent property is\nequal to the given value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { equal } from '@ember/object/computed';\n\nclass Hamster {\n  @equal('percentCarrotsEaten', 100) satisfied;\n}\n\nlet hamster = new Hamster();\n\nhamster.satisfied; // false\n\nset(hamster, 'percentCarrotsEaten', 100);\nhamster.satisfied; // true\n\nset(hamster, 'percentCarrotsEaten', 50);\nhamster.satisfied; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "equal", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "String|Number|Object" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is equal to the given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 380, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gt } from '@ember/object/computed';\n\nclass Hamster {\n  @gt('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 11);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 425, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gte } from '@ember/object/computed';\n\nclass Hamster {\n  @gte('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 10);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater or equal then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 470, + "description": "

A computed property that returns true if the provided dependent property is\nless than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lt } from '@ember/object/computed';\n\nclass Hamster {\n  @lt('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 2);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 515, + "description": "

A computed property that returns true if the provided dependent property is\nless than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lte } from '@ember/object/computed';\n\nclass Hamster {\n  @lte('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 5);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less or equal than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 560, + "description": "

A computed property that performs a logical and on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first falsy value or last\ntruthy value just like JavaScript's && operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { and } from '@ember/object/computed';\n\nclass Hamster {\n  @and('hasTent', 'hasBackpack') readyForCamp;\n  @and('hasWalkingStick', 'hasBackpack') readyForHike;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForCamp; // false\n\nset(tomster, 'hasTent', true);\ntomster.readyForCamp; // false\n\nset(tomster, 'hasBackpack', true);\ntomster.readyForCamp; // true\n\nset(tomster, 'hasBackpack', 'Yes');\ntomster.readyForCamp; // 'Yes'\n\nset(tomster, 'hasWalkingStick', null);\ntomster.readyForHike; // null
\n
\n
\n \n", + "itemtype": "method", + "name": "and", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `and` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 606, + "description": "

A computed property which performs a logical or on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first truthy value or last\nfalsy value just like JavaScript's || operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { or } from '@ember/object/computed';\n\nclass Hamster {\n  @or('hasJacket', 'hasUmbrella') readyForRain;\n  @or('hasSunscreen', 'hasUmbrella') readyForBeach;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForRain; // undefined\n\nset(tomster, 'hasUmbrella', true);\ntomster.readyForRain; // true\n\nset(tomster, 'hasJacket', 'Yes');\ntomster.readyForRain; // 'Yes'\n\nset(tomster, 'hasSunscreen', 'Check');\ntomster.readyForBeach; // 'Check'
\n
\n
\n \n", + "itemtype": "method", + "name": "or", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `or` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 649, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { alias } from '@ember/object/computed';\n\nclass Person {\n  name = 'Alex Matchneer';\n\n  @alias('name') nomen;\n}\n\nlet alex = new Person();\n\nalex.nomen; // 'Alex Matchneer'\nalex.name;  // 'Alex Matchneer'\n\nset(alex, 'nomen', '@machty');\nalex.name;  // '@machty'
\n
\n
\n \n", + "itemtype": "method", + "name": "alias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates an alias to the\noriginal value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 684, + "description": "

Where the alias computed macro aliases get and set, and allows for\nbidirectional data flow, the oneWay computed macro only provides an aliased\nget. The set will not mutate the upstream property, rather causes the\ncurrent property to become the value set. This causes the downstream property\nto permanently diverge from the upstream property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { oneWay }from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @oneWay('firstName') nickName;\n}\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear');\nteddy.firstName; // 'Teddy'\nteddy.nickName; // 'TeddyBear'
\n
\n
\n \n", + "itemtype": "method", + "name": "oneWay", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 732, + "description": "

This is a more semantically meaningful alias of the oneWay computed macro,\nwhose name is somewhat ambiguous as to which direction the data flows.

\n", + "itemtype": "method", + "name": "reads", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\n property to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 745, + "description": "

Where oneWay computed macro provides oneWay bindings, the readOnly\ncomputed macro provides a readOnly one way binding. Very often when using\nthe oneWay macro one does not also want changes to propagate back up, as\nthey will replace the value.

\n

This prevents the reverse flow, and also throws an exception when it occurs.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { readOnly } from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @readOnly('firstName') nickName;\n});\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear'); // throws Exception\n// throw new EmberError('Cannot Set: nickName on: <User:ember27288>' );`\n\nteddy.firstName; // 'Teddy'
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 796, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property, but also print a deprecation warning.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { set } from '@ember/object';\nimport { deprecatingAlias } from '@ember/object/computed';\n\nclass Hamster {\n  @deprecatingAlias('cavendishCount', {\n    id: 'hamster.deprecate-banana',\n    until: '3.0.0'\n  })\n  bananaCount;\n}\n\nlet hamster = new Hamster();\n\nset(hamster, 'bananaCount', 5); // Prints a deprecation warning.\nhamster.cavendishCount; // 5
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecatingAlias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "Options for `deprecate`.", + "type": "Object" + } + ], + "return": { + "description": "computed property which creates an alias with a\ndeprecation to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 76, + "description": "

A computed property that returns the sum of the values in the dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { sum } from '@ember/object/computed';\n\nclass Invoice {\n  lineItems = [1.00, 2.50, 9.99];\n\n  @sum('lineItems') total;\n}\n\nlet invoice = new Invoice();\n\ninvoice.total; // 13.49
\n
\n
\n \n", + "itemtype": "method", + "name": "sum", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the sum of all values in the\ndependentKey's array", + "type": "ComputedProperty" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 113, + "description": "

A computed property that calculates the maximum value in the dependent array.\nThis will return -Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, max } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @max('childAges') maxChildAge;\n}\n\nlet lordByron = new Person();\n\nlordByron.maxChildAge; // -Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.maxChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.maxChildAge; // 8
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe max of a list of Date objects will be the highest timestamp as a Number.\nThis behavior is consistent with Math.max.

\n", + "itemtype": "method", + "name": "max", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the largest value in the dependentKey's\narray", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 177, + "description": "

A computed property that calculates the minimum value in the dependent array.\nThis will return Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, min } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @min('childAges') minChildAge;\n}\n\nlet lordByron = Person.create({ children: [] });\n\nlordByron.minChildAge; // Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.minChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.minChildAge; // 5
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe min of a list of Date objects will be the lowest timestamp as a Number.\nThis behavior is consistent with Math.min.

\n", + "itemtype": "method", + "name": "min", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the smallest value in the dependentKey's array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 240, + "description": "

Returns an array mapped via the callback

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function mapCallback(item, index);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', function(chore, index) {\n    return `${chore.toUpperCase()}!`;\n  })\n  excitingChores;\n});\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n

You can optionally pass an array of additional dependent keys as the second\nparameter to the macro, if your map function relies on any external values:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  shouldUpperCase = false;\n\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', ['shouldUpperCase'], function(chore, index) {\n    if (this.shouldUpperCase) {\n      return `${chore.toUpperCase()}!`;\n    } else {\n      return `${chore}!`;\n    }\n  })\n  excitingChores;\n}\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['clean!', 'write more unit tests!']\n\nset(hamster, 'shouldUpperCase', true);\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional\ndependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "an array mapped via the callback", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 364, + "description": "

Returns an array mapped to the specified key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import { set } from '@ember/object';\nimport { mapBy } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n}\n\nlet lordByron = new Person();\n\nlordByron.childAges; // []\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.childAges; // [7]\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.childAges; // [7, 5, 8]
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "an array mapped to the specified key", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 431, + "description": "

Filters the array by the callback, like the Array.prototype.filter method.

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
  • array is the dependant array itself.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function filterCallback(item, index, array);
\n
\n
\n \n

In the callback, return a truthy value that coerces to true to keep the\nelement, or a falsy to reject it.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = Hamster.create([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]
\n
\n
\n \n

You can also use @each.property in your dependent key, the callback will\nstill use the underlying array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores.@each.done', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n\nset(hamster.chores[2], 'done', true);\nhamster.remainingChores; // []
\n
\n
\n \n

Finally, you can optionally pass an array of additional dependent keys as the\nsecond parameter to the macro, if your filter function relies on any external\nvalues:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  doneKey = 'finished';\n\n  @filter('chores', ['doneKey'], function(chore, index, array) {\n    return !chore[this.doneKey];\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', finished: true },\n  { name: 'clean', finished: true },\n  { name: 'write more unit tests', finished: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', finished: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional dependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 601, + "description": "

Filters the array by the property and value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { filterBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filterBy('chores', 'done', false) remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{ name: 'write more unit tests', done: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "*" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 657, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniq } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniq('fruits') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  'banana',\n  'grape',\n  'kale',\n  'banana'\n]);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale']
\n
\n
\n \n", + "itemtype": "method", + "name": "uniq", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 728, + "description": "

A computed property which returns a new array with all the unique elements\nfrom an array, with uniqueness determined by specific key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniqBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniqBy('fruits', 'id') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  { id: 1, 'banana' },\n  { id: 2, 'grape' },\n  { id: 3, 'peach' },\n  { id: 1, 'banana' }\n]);\n\nhamster.uniqueFruits; // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 782, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { union } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits, vegetables) {\n    set(this, 'fruits', fruits);\n    set(this, 'vegetables', vegetables);\n  }\n\n  @union('fruits', 'vegetables') uniqueFruits;\n});\n\nlet hamster = new, Hamster(\n  [\n    'banana',\n    'grape',\n    'kale',\n    'banana',\n    'tomato'\n  ],\n  [\n    'tomato',\n    'carrot',\n    'lettuce'\n  ]\n);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale', 'tomato', 'carrot', 'lettuce']
\n
\n
\n \n", + "itemtype": "method", + "name": "union", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the unique elements\nfrom one or more dependent arrays.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 829, + "description": "

A computed property which returns a new array with all the elements\ntwo or more dependent arrays have in common.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { intersect } from '@ember/object/computed';\n\nclass FriendGroups {\n  constructor(adaFriends, charlesFriends) {\n    set(this, 'adaFriends', adaFriends);\n    set(this, 'charlesFriends', charlesFriends);\n  }\n\n  @intersect('adaFriends', 'charlesFriends') friendsInCommon;\n}\n\nlet groups = new FriendGroups(\n  ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n  ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock']\n);\n\ngroups.friendsInCommon; // ['William King', 'Mary Somerville']
\n
\n
\n \n", + "itemtype": "method", + "name": "intersect", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the duplicated\nelements from the dependent arrays", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 910, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array that are not in the second dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { setDiff } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(likes, fruits) {\n    set(this, 'likes', likes);\n    set(this, 'fruits', fruits);\n  }\n\n  @setDiff('likes', 'fruits') wants;\n}\n\nlet hamster = new Hamster(\n  [\n    'banana',\n    'grape',\n    'kale'\n  ],\n  [\n    'grape',\n    'kale',\n  ]\n);\n\nhamster.wants; // ['banana']
\n
\n
\n \n", + "itemtype": "method", + "name": "setDiff", + "static": 1, + "params": [ + { + "name": "setAProperty", + "description": "", + "type": "String" + }, + { + "name": "setBProperty", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the items from the\nfirst dependent array that are not in the second dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 980, + "description": "

A computed property that returns the array of values for the provided\ndependent properties.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { collect } from '@ember/object/computed';\n\nclass Hamster {\n  @collect('hat', 'shirt') clothes;\n}\n\nlet hamster = new Hamster();\n\nhamster.clothes; // [null, null]\n\nset(hamster, 'hat', 'Camp Hat');\nset(hamster, 'shirt', 'Camp Shirt');\nhamster.clothes; // ['Camp Hat', 'Camp Shirt']
\n
\n
\n \n", + "itemtype": "method", + "name": "collect", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which maps values of all passed\nin properties to an array.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 1035, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array sorted based on a property or sort function. The sort\nmacro can be used in two different ways:

\n
    \n
  1. By providing a sort callback function
  2. \n
  3. By providing an array of keys to sort the array
  4. \n
\n

In the first form, the callback method you provide should have the following\nsignature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function sortCallback(itemA, itemB);
\n
\n
\n \n
    \n
  • itemA the first item to compare.
  • \n
  • itemB the second item to compare.
  • \n
\n

This function should return negative number (e.g. -1) when itemA should\ncome before itemB. It should return positive number (e.g. 1) when itemA\nshould come after itemB. If the itemA and itemB are equal this function\nshould return 0.

\n

Therefore, if this function is comparing some numeric values, simple itemA - itemB or itemA.get( 'foo' ) - itemB.get( 'foo' ) can be used instead of\nseries of if.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', function(a, b){\n    if (a.priority > b.priority) {\n      return 1;\n    } else if (a.priority < b.priority) {\n      return -1;\n    }\n\n    return 0;\n  })\n  priorityTodos;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

You can also optionally pass an array of additional dependent keys as the\nsecond parameter, if your sort function is dependent on additional values that\ncould changes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n
import EmberObject, { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  sortKey = 'priority';\n\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', ['sortKey'], function(a, b){\n    if (a[this.sortKey] > b[this.sortKey]) {\n      return 1;\n    } else if (a[this.sortKey] < b[this.sortKey]) {\n      return -1;\n    }\n\n    return 0;\n  })\n  sortedTodos;\n});\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

In the second form, you should provide the key of the array of sort values as\nthe second parameter:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using standard ascending sort\n  todosSorting = ['name'];\n  @sort('todos', 'todosSorting') sortedTodos;\n\n  // using descending sort\n  todosSortingDesc = ['name:desc'];\n  @sort('todos', 'todosSortingDesc') sortedTodosDesc;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.sortedTodos; // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\ntodoList.sortedTodosDesc; // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n", + "itemtype": "method", + "name": "sort", + "static": 1, + "params": [ + { + "name": "itemsKey", + "description": "", + "type": "String" + }, + { + "name": "sortDefinitionOrDependentKeys", + "description": "The key of the sort definition (an array of sort properties),\nthe sort function, or an array of additional dependent keys", + "type": "String|Function|Array" + }, + { + "name": "sortDefinition", + "description": "the sort function (when used with additional dependent keys)", + "type": "Function?" + } + ], + "return": { + "description": "computes a new sorted array based on the sort\nproperty array or callback function", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/object/evented-b73b4a3b79.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/object/evented-b73b4a3b79.json new file mode 100644 index 000000000..ae4147a89 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/object/evented-b73b4a3b79.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.11.0-@ember/object/evented", + "type": "class", + "attributes": { + "name": "@ember/object/evented", + "shortname": "@ember/object/evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 180, + "description": "

Define a property as a function that should be executed when\na specified event or events are triggered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\nimport { on } from '@ember/object/evented';\nimport { sendEvent } from '@ember/object/events';\n\nlet Job = EmberObject.extend({\n  logCompleted: on('completed', function() {\n    console.log('Job completed!');\n  })\n});\n\nlet job = Job.create();\n\nsendEvent(job, 'completed'); // Logs 'Job completed!'
\n
\n
\n \n", + "itemtype": "method", + "name": "on", + "static": 1, + "params": [ + { + "name": "eventNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the listener function, passed as last argument to on(...)", + "type": "Function" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/owner-b336f2eb0c.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/owner-b336f2eb0c.json new file mode 100644 index 000000000..5643315f0 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/owner-b336f2eb0c.json @@ -0,0 +1,285 @@ +{ + "data": { + "id": "ember-4.11.0-@ember/owner", + "type": "class", + "attributes": { + "name": "@ember/owner", + "shortname": "@ember/owner", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 535, + "description": "

setOwner forces a new owner on a given object instance. This is primarily\nuseful in some testing cases.

\n", + "itemtype": "method", + "name": "setOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object instance.", + "type": "Object" + }, + { + "name": "object", + "description": "The new owner object of the object instance.", + "type": "Owner" + } + ], + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 565, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 597, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 607, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 630, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 640, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 654, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 664, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 674, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 707, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/owner/index.ts", + "line": 41, + "description": "

Framework objects in an Ember application (components, services, routes, etc.)\nare created via a factory and dependency injection system. Each of these\nobjects is the responsibility of an "owner", which handled its\ninstantiation and manages its lifetime.

\n

getOwner fetches the owner object responsible for an instance. This can\nbe used to lookup or resolve other class instances, or register new factories\ninto the owner.

\n

For example, this component dynamically looks up a service based on the\naudioType passed as an argument:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
audio.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getOwner } from '@ember/application';\n\n// Usage:\n//\n//   <PlayAudio @audioType={{@model.audioType}} @audioFile={{@model.file}}/>\n//\nexport default class extends Component {\n  get audioService() {\n    return getOwner(this)?.lookup(`service:${this.args.audioType}`);\n  }\n\n  @action\n  onPlay() {\n    this.audioService?.play(this.args.audioFile);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "getOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object with an owner.", + "type": "Object" + } + ], + "return": { + "description": "An owner object.", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/owner", + "module": "@ember/owner" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/polyfills-8962ed51c5.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/polyfills-8962ed51c5.json new file mode 100644 index 000000000..9d984c019 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/polyfills-8962ed51c5.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.11.0-@ember/polyfills", + "type": "class", + "attributes": { + "name": "@ember/polyfills", + "shortname": "@ember/polyfills", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/polyfills", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/polyfills/lib/assign.ts", + "line": 11, + "description": "

Copy properties from a source object to a target object. Source arguments remain unchanged.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assign } from '@ember/polyfills';\n\nvar a = { first: 'Yehuda' };\nvar b = { last: 'Katz' };\nvar c = { company: 'Other Company' };\nvar d = { company: 'Tilde Inc.' };\nassign(a, b, c, d); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' };
\n
\n
\n \n", + "itemtype": "method", + "name": "assign", + "params": [ + { + "name": "target", + "description": "The object to assign into", + "type": "Object" + }, + { + "name": "args", + "description": "The objects to copy properties from", + "type": "Object", + "multiple": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/polyfills", + "module": "@ember/polyfills" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/polyfills", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/runloop-98e2e4a919.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/runloop-98e2e4a919.json new file mode 100644 index 000000000..a559ae465 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/runloop-98e2e4a919.json @@ -0,0 +1,497 @@ +{ + "data": { + "id": "ember-4.11.0-@ember/runloop", + "type": "class", + "attributes": { + "name": "@ember/runloop", + "shortname": "@ember/runloop", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/runloop", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 105, + "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

Normally 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { run } from '@ember/runloop';\n\nrun(function() {\n  // code to be executed within a RunLoop\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "run", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "return value from invoking the passed function.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 150, + "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

Please note: This is not for normal usage, and should be used sparingly.

\n

If invoked when not within a run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { join } from '@ember/runloop';\n\njoin(function() {\n  // creates a new run-loop\n});
\n
\n
\n \n

Alternatively, if called within an existing run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "join", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Return value from invoking the passed function. Please note,\nwhen called within an existing loop, no return value is possible.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 209, + "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

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

Let'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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import 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
\n \n

In 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.

\n", + "itemtype": "method", + "name": "bind", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "returns a new function that will always have a particular context", + "type": "Function" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 323, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "begin", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 346, + "description": "

Ends a RunLoop. This must be called sometime after you call\nbegin() to flush any deferred actions. This is a lower-level way\nto use a RunLoop instead of using run().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "end", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 369, + "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

At 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "schedule", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'", + "type": "String" + }, + { + "name": "target", + "description": "target object to use as the context when invoking a method.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.", + "type": "String|Function" + }, + { + "name": "arguments*", + "description": "Optional arguments to be passed to the queued method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 442, + "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

You 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "later", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 490, + "description": "

Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling scheduleOnce with the "actions" queue.

\n", + "itemtype": "method", + "name": "once", + "static": 1, + "params": [ + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 521, + "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

Note that although you can pass optional arguments these will not be\nconsidered when looking for duplicates. New arguments will replace previous\ncalls.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Also note that for scheduleOnce to prevent additional calls, you need to\npass the same function instance. The following case works as expected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
function log() {\n  console.log('Logging only once');\n}\n\nfunction scheduleIt() {\n  scheduleOnce('actions', myContext, log);\n}\n\nscheduleIt();\nscheduleIt();
\n
\n
\n \n

But this other case will schedule the function multiple times:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { 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
\n \n

Available queues, and their order, can be found at queues

\n", + "itemtype": "method", + "name": "scheduleOnce", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'.", + "type": "String", + "optional": true + }, + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 615, + "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\nlater with a wait time of 1ms.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { 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
\n \n

Multiple 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

Note 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

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

One 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

The 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.

\n", + "itemtype": "method", + "name": "next", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 700, + "description": "

Cancels a scheduled item. Must be a value returned by later(),\nonce(), scheduleOnce(), next(), debounce(), or\nthrottle().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n
import {\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
\n
\n \n", + "itemtype": "method", + "name": "cancel", + "static": 1, + "params": [ + { + "name": "timer", + "description": "Timer object to cancel", + "type": "Object" + } + ], + "return": { + "description": "true if canceled or false/undefined if it wasn't found", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 771, + "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

This 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n \n

Immediate allows you to run the function immediately, but debounce\nother calls for this function until the wait time has elapsed. If\ndebounce 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "debounce", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to false.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 868, + "description": "

Ensure that the target method is never called more frequently than\nthe specified spacing period. The target method is called immediately.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "throttle", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "spacing", + "description": "Number of milliseconds to space out requests.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to true.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 62, + "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.

\n", + "itemtype": "property", + "name": "queues", + "type": "Array", + "default": "['actions', 'destroy']", + "access": "private", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/routing/transition" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/runloop", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/service-9bcb011981.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/service-9bcb011981.json new file mode 100644 index 000000000..487de8179 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/service-9bcb011981.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.11.0-@ember/service", + "type": "class", + "attributes": { + "name": "@ember/service", + "shortname": "@ember/service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/service/index.ts", + "line": 10, + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + }, + { + "file": "packages/@ember/service/index.ts", + "line": 30, + "description": "

Creates a property that lazily looks up a service in the container. There are\nno restrictions as to what objects a service can be injected into.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service('auth') authManager;\n\n  model() {\n    return this.authManager.findCurrentUser();\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default Route.extend({\n  authManager: service('auth'),\n\n  model() {\n    return this.get('authManager').findCurrentUser();\n  }\n});
\n
\n
\n \n

This example will create an authManager property on the application route\nthat looks up the auth service in the container, making it easily accessible\nin the model hook.

\n", + "itemtype": "method", + "name": "service", + "static": 1, + "since": "4.1.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/template-98ee6ab267.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/template-80a2e4cf07.json similarity index 97% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/template-98ee6ab267.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/template-80a2e4cf07.json index 2a256d3f9..89fefc713 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/template-98ee6ab267.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/template-80a2e4cf07.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/template", + "id": "ember-4.11.0-@ember/template", "type": "class", "attributes": { "name": "@ember/template", @@ -92,13 +92,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/template", + "id": "ember-4.11.0-@ember/template", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/test-3f8f6a994a.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/test-3f8f6a994a.json new file mode 100644 index 000000000..e4b94b4f8 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/test-3f8f6a994a.json @@ -0,0 +1,395 @@ +{ + "data": { + "id": "ember-4.11.0-@ember/test", + "type": "class", + "attributes": { + "name": "@ember/test", + "shortname": "@ember/test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/test", + "namespace": "", + "methods": [ + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 64, + "description": "

This hook defers the readiness of the application, so that you can start\nthe app when your tests are ready to run. It also sets the router's\nlocation to 'none', so that the window's location will not be modified\n(preventing both accidental leaking of state between tests and interference\nwith your testing framework). setupForTesting should only be called after\nsetting a custom router class (for example App.Router = Router.extend().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.setupForTesting();
\n
\n
\n \n", + "itemtype": "method", + "name": "setupForTesting", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 103, + "description": "

This injects the test helpers into the helperContainer object. If an object is provided\nit will be used as the helperContainer. If helperContainer is not set it will default\nto window. If a function of the same name has already been defined it will be cached\n(so that it can be reset if the helper is removed with unregisterHelper or\nremoveTestHelpers).

\n

Any callbacks registered with onInjectHelpers will be called once the\nhelpers have been injected.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.injectTestHelpers();
\n
\n
\n \n", + "itemtype": "method", + "name": "injectTestHelpers", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 148, + "description": "

This removes all helpers that have been registered, and resets and functions\nthat were overridden by the helpers.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.removeTestHelpers();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "removeTestHelpers", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/helpers/current_path.ts", + "line": 9, + "description": "

Returns the current path.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentPath(), 'some.path.index', "correct path was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentPath", + "return": { + "description": "The currently active path.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_route_name.ts", + "line": 8, + "description": "

Returns the currently active route name.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
function validateRouteName() {\nequal(currentRouteName(), 'some.path', "correct route was transitioned into.");\n}\nvisit('/some/path').then(validateRouteName)
\n
\n
\n \n", + "itemtype": "method", + "name": "currentRouteName", + "return": { + "description": "The name of the currently active route.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_url.ts", + "line": 9, + "description": "

Returns the current URL.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentURL(), '/some/path', "correct URL was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentURL", + "return": { + "description": "The currently active URL.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.ts", + "line": 9, + "description": "

Resumes a test paused by pauseTest.

\n", + "itemtype": "method", + "name": "resumeTest", + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.ts", + "line": 22, + "description": "

Pauses the current test - this is useful for debugging while testing or for test-driving.\nIt allows you to inspect the state of your application at any point.\nExample (The test will pause before clicking the button):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('/')\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

You may want to turn off the timeout before pausing.

\n

qunit (timeout available to use as of 2.4.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nassert.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

mocha (timeout happens automatically as of ember-mocha v0.14.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nthis.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n", + "since": "1.9.0", + "itemtype": "method", + "name": "pauseTest", + "return": { + "description": "A promise that will never resolve", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/visit.ts", + "line": 6, + "description": "

Loads a route, sets up any controllers, and renders any templates associated\nwith the route as though a real user had triggered the route change while\nusing your app.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('posts/index').then(function() {\n  // assert something\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/wait.ts", + "line": 12, + "description": "

Causes the run loop to process any pending events. This is used to ensure that\nany async operations from other helpers (or your assertions) have been processed.

\n

This is most often used as the return value for the helper functions (see 'click',\n'fillIn','visit',etc). However, there is a method to register a test helper which\nutilizes this method without the need to actually call wait() in your helpers.

\n

The wait helper is built into registerAsyncHelper by default. You will not need\nto return app.testHelpers.wait(); - the wait behavior is provided for you.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('loginUser', function(app, username, password) {\n  visit('secured/path/here')\n    .fillIn('#username', username)\n    .fillIn('#password', password)\n    .click('.submit');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "wait", + "params": [ + { + "name": "value", + "description": "The value to be returned.", + "type": "Object" + } + ], + "return": { + "description": "Promise that resolves to the passed value.", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 15, + "description": "

registerHelper is used to register a test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

This helper can later be called without arguments because it will be\ncalled with app as the first parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nApp = Application.create();\nApp.injectTestHelpers();\nboot();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 59, + "description": "

registerAsyncHelper is used to register an async test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerAsyncHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterAsyncHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

The advantage of an async helper is that it will not run\nuntil the last async helper has completed. All async helpers\nafter it will wait for it complete before running.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('deletePost', function(app, postId) {\n  click('.delete-' + postId);\n});\n\n// ... in your test\nvisit('/post/2');\ndeletePost(2);\nvisit('/post/3');\ndeletePost(3);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerAsyncHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 112, + "description": "

Remove a previously added helper method.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { unregisterHelper } from '@ember/test';\n\nunregisterHelper('wait');
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregisterHelper", + "static": 1, + "params": [ + { + "name": "name", + "description": "The helper to remove.", + "type": "String" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 7, + "description": "

This allows ember-testing to play nicely with other asynchronous\nevents, such as an application that is waiting for a CSS3\ntransition or an IndexDB transaction. The waiter runs periodically\nafter each async helper (i.e. click, andThen, visit, etc) has executed,\nuntil the returning result is truthy. After the waiters finish, the next async helper\nis executed and the process repeats.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(function() {\n  return myPendingTransactions() === 0;\n});
\n
\n
\n \n

The context argument allows you to optionally specify the this\nwith which your callback will be invoked.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(MyDB, MyDB.hasPendingTransactions);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 66, + "description": "

unregisterWaiter is used to unregister a callback that was\nregistered with registerWaiter.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "unregisterWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 94, + "description": "

Iterates through each registered test waiter, and invokes\nits callback. If any waiter returns false, this method will return\ntrue indicating that the waiters have not settled yet.

\n

This is generally used internally from the acceptance/integration test\ninfrastructure.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "checkWaiters", + "class": "@ember/test", + "module": "@ember/test" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 23, + "description": "

This property contains the testing helpers for the current application. These\nare created once you call injectTestHelpers on your Application\ninstance. The included helpers are also available on the window object by\ndefault, but can be used from this object on the individual application also.

\n", + "itemtype": "property", + "name": "testHelpers", + "type": "{Object}", + "default": "{}", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 36, + "description": "

This property will contain the original methods that were registered\non the helperContainer before injectTestHelpers is called.

\n

When removeTestHelpers is called, these methods are restored to the\nhelperContainer.

\n", + "itemtype": "property", + "name": "originalMethods", + "type": "{Object}", + "default": "{}", + "access": "private", + "tagname": "", + "since": "1.3.0", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 51, + "description": "

This property indicates whether or not this application is currently in\ntesting mode. This is set when setupForTesting is called on the current\napplication.

\n", + "itemtype": "property", + "name": "testing", + "type": "{Boolean}", + "default": "false", + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 91, + "description": "

This will be used as the container to inject the test helpers into. By\ndefault the helpers are injected into window.

\n", + "itemtype": "property", + "name": "helperContainer", + "type": "{Object} The object to be used for test helpers.", + "default": "window", + "since": "1.2.0", + "access": "private", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/test", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/utils-526f62ce94.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/utils-526f62ce94.json new file mode 100644 index 000000000..6ad99173d --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@ember/utils-526f62ce94.json @@ -0,0 +1,213 @@ +{ + "data": { + "id": "ember-4.11.0-@ember/utils", + "type": "class", + "attributes": { + "name": "@ember/utils", + "shortname": "@ember/utils", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/utils", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/utils/lib/compare.ts", + "line": 53, + "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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { compare } from '@ember/utils';\n\ncompare('hello', 'hello');  // 0\ncompare('abc', 'dfg');      // -1\ncompare(2, 1);              // 1
\n
\n
\n \n

If 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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { compare } from '@ember/utils';\n\ncompare('hello', 50);       // 1\ncompare(50, 'hello');       // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "compare", + "static": 1, + "params": [ + { + "name": "v", + "description": "First value to compare", + "type": "Object" + }, + { + "name": "w", + "description": "Second value to compare", + "type": "Object" + } + ], + "return": { + "description": "-1 if v < w, 0 if v = w and 1 if v > w.", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is-equal.ts", + "line": 4, + "description": "

Compares two objects, returning true if they are equal.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { isEqual } from '@ember/utils';\n\nisEqual('hello', 'hello');                   // true\nisEqual(1, 2);                               // false
\n
\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Due 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { isEqual } from '@ember/utils';\n\nisEqual([4, 2], [4, 2]);                     // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEqual", + "static": 1, + "params": [ + { + "name": "a", + "description": "first object to compare", + "type": "Object" + }, + { + "name": "b", + "description": "second object to compare", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_blank.ts", + "line": 5, + "description": "

A value is blank if it is empty or a whitespace string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "isBlank", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_empty.ts", + "line": 6, + "description": "

Verifies that a value is null or undefined, an empty string, or an empty\narray.

\n

Constrains the rules on isNone by returning true for empty strings and\nempty arrays.

\n

If the value is an object with a size property of type number, it is used\nto check emptiness.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
isEmpty(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
\n
\n \n", + "itemtype": "method", + "name": "isEmpty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_none.ts", + "line": 4, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
isNone(null);          // true\nisNone(undefined);     // true\nisNone('');            // false\nisNone([]);            // false\nisNone(function() {}); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isNone", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_present.ts", + "line": 5, + "description": "

A value is present if it not isBlank.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
isPresent(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
\n
\n \n", + "itemtype": "method", + "name": "isPresent", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.8.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/type-of.ts", + "line": 40, + "description": "

Returns a consistent type for the passed object.

\n

Use 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\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
\n
\n \n

Examples:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "typeOf", + "params": [ + { + "name": "item", + "description": "the item to check" + } + ], + "return": { + "description": "the type", + "type": "String" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/utils", + "module": "@ember/utils" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/utils", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-@glimmer/tracking-d7f925b42e.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@glimmer/tracking-d7f925b42e.json new file mode 100644 index 000000000..549b80743 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@glimmer/tracking-d7f925b42e.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.11.0-@glimmer/tracking", + "type": "class", + "attributes": { + "name": "@glimmer/tracking", + "shortname": "@glimmer/tracking", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 22, + "description": "

Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are static, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>Count: {{this.count}}</div>\n<div>Times Ten: {{this.timesTen}}</div>\n<div>\n  <button {{on "click" this.plusOne}}>\n    Plus One\n  </button>\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class CounterComponent extends Component {\n  @tracked count = 0;\n\n  get timesTen() {\n    return this.count * 10;\n  }\n\n  @action\n  plusOne() {\n    this.count += 1;\n  }\n}
\n
\n
\n \n

Both the {{this.count}} and the {{this.timesTen}} properties in the\ntemplate will update whenever the button is clicked. Any tracked properties\nthat are used in any way to calculate a value that is used in the template\nwill cause a rerender when updated - this includes through method calls and\nother means:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nclass Entry {\n  @tracked name;\n  @tracked phoneNumber;\n\n  constructor(name, phoneNumber) {\n    this.name = name;\n    this.phoneNumber = phoneNumber;\n  }\n}\n\nexport default class PhoneBookComponent extends Component {\n  entries = [\n    new Entry('Pizza Palace', 5551234),\n    new Entry('1st Street Cleaners', 5554321),\n    new Entry('Plants R Us', 5552468),\n  ];\n\n  // Any usage of this property will update whenever any of the names in the\n  // entries arrays are updated\n  get names() {\n    return this.entries.map(e => e.name);\n  }\n\n  // Any usage of this property will update whenever any of the numbers in the\n  // entries arrays are updated\n  get numbers() {\n    return this.getFormattedNumbers();\n  }\n\n  getFormattedNumbers() {\n    return this.entries\n      .map(e => e.phoneNumber)\n      .map(number => {\n        let numberString = '' + number;\n\n        return numberString.slice(0, 3) + '-' + numberString.slice(3);\n      });\n  }\n}
\n
\n
\n \n

It's important to note that setting tracked properties will always trigger an\nupdate, even if the property is set to the same value as it was before.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let entry = new Entry('Pizza Palace', 5551234);\n\n// if entry was used when rendering, this would cause a rerender, even though\n// the name is being set to the same value as it was before\nentry.name = entry.name;
\n
\n
\n \n

tracked can also be used with the classic Ember object model in a similar\nmanner to classic computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked(),\n  phoneNumber: tracked()\n});
\n
\n
\n \n

Often this is unnecessary, but to ensure robust auto-tracking behavior it is\nadvisable to mark tracked state appropriately wherever possible.

\n

This form of tracked also accepts an optional configuration object\ncontaining either an initial value or an initializer function (but not\nboth).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked({ value: 'Zoey' }),\n  favoriteSongs: tracked({\n    initializer: () => ['Raspberry Beret', 'Time After Time']\n  })\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "tracked", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 158, + "description": "

Gives the getter a caching behavior. The return value of the getter\nwill be cached until any of the properties it is entangled with\nare invalidated. This is useful when a getter is expensive and\nused very often.

\n

For instance, in this GuestList class, we have the sortedGuests\ngetter that sorts the guests alphabetically:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
  import { tracked } from '@glimmer/tracking';\n\n  class GuestList {\n    @tracked guests = ['Zoey', 'Tomster'];\n\n    get sortedGuests() {\n      return this.guests.slice().sort()\n    }\n  }
\n
\n
\n \n

Every time sortedGuests is accessed, a new array will be created and sorted,\nbecause JavaScript getters do not cache by default. When the guest list\nis small, like the one in the example, this is not a problem. However, if\nthe guest list were to grow very large, it would mean that we would be doing\na large amount of work each time we accessed sortedGuests. With @cached,\nwe can cache the value instead:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
  import { tracked, cached } from '@glimmer/tracking';\n\n  class GuestList {\n    @tracked guests = ['Zoey', 'Tomster'];\n\n    @cached\n    get sortedGuests() {\n      return this.guests.slice().sort()\n    }\n  }
\n
\n
\n \n

Now the sortedGuests getter will be cached based on autotracking.\nIt will only rerun and create a new sorted array when the guests tracked\nproperty is updated.

\n

Tradeoffs

\n

Overuse is discouraged.

\n

In general, you should avoid using @cached unless you have confirmed that\nthe getter you are decorating is computationally expensive, since @cached\nadds a small amount of overhead to the getter.\nWhile the individual costs are small, a systematic use of the @cached\ndecorator can add up to a large impact overall in your app.\nMany getters and tracked properties are only accessed once during rendering,\nand then never rerendered, so adding @cached when unnecessary can\nnegatively impact performance.

\n

Also, @cached may rerun even if the values themselves have not changed,\nsince tracked properties will always invalidate.\nFor example updating an integer value from 5 to an other 5 will trigger\na rerun of the cached properties building from this integer.

\n

Avoiding a cache invalidation in this case is not something that can\nbe achieved on the @cached decorator itself, but rather when updating\nthe underlying tracked values, by applying some diff checking mechanisms:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
if (nextValue !== this.trackedProp) {\n  this.trackedProp = nextValue;\n}
\n
\n
\n \n

Here equal values won't update the property, therefore not triggering\nthe subsequent cache invalidations of the @cached properties who were\nusing this trackedProp.

\n

As a reminder, do not use this piece of code inside a tracked getter,\nas the dependency chain could lead to an infinite loop. Mutating an adjacent\nproperty from a getter is not a good practice anyway, even with a caching\nmechanism reducing reruns.

\n

The cost of these edge-guards adds up to the trade-off calculation of using\na caching strategy, hence requiring a very sensitive and moderate approach\nregarding performance.

\n", + "itemtype": "method", + "name": "cached", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@glimmer/tracking", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-@glimmer/tracking/primitives/cache-ca10873eee.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-@glimmer/tracking/primitives/cache-ca10873eee.json new file mode 100644 index 000000000..3be52cba1 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-@glimmer/tracking/primitives/cache-ca10873eee.json @@ -0,0 +1,77 @@ +{ + "data": { + "id": "ember-4.11.0-@glimmer/tracking/primitives/cache", + "type": "class", + "attributes": { + "name": "@glimmer/tracking/primitives/cache", + "shortname": "@glimmer/tracking/primitives/cache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking/primitives/cache", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 14, + "description": "

Receives a function, and returns a wrapped version of it that memoizes based on\nautotracking. The function will only rerun whenever any tracked values used\nwithin it have changed. Otherwise, it will return the previous value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state. Now, `counter` will\n  // only rerun if `state.value` changes.\n  state.value;\n\n  return ++computeCount;\n});\n\ngetValue(counter); // 1\n\n// returns the same value because no tracked state has changed\ngetValue(counter); // 1\n\nstate.value = 'foo';\n\n// reruns because a tracked value used in the function has changed,\n// incermenting the counter\ngetValue(counter); // 2
\n
\n
\n \n", + "itemtype": "method", + "name": "createCache", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 56, + "description": "

Gets the value of a cache created with createCache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  return ++computeCount;\n});\n\ngetValue(counter); // 1
\n
\n
\n \n", + "itemtype": "method", + "name": "getValue", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 78, + "description": "

Can be used to check if a memoized function is constant. If no tracked state\nwas used while running a memoized function, it will never rerun, because nothing\ncan invalidate its result. isConst can be used to determine if a memoized\nfunction is constant or not, in order to optimize code surrounding that\nfunction.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue, isConst } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state\n  state.value;\n\n  return computeCount++;\n});\n\nlet constCounter = createCache(() => {\n  return computeCount++;\n});\n\ngetValue(counter);\ngetValue(constCounter);\n\nisConst(counter); // false\nisConst(constCounter); // true
\n
\n
\n \n

If called on a cache that hasn't been accessed yet, it will throw an\nerror. This is because there's no way to know if the function will be constant\nor not yet, and so this helps prevent missing an optimization opportunity on\naccident.

\n", + "itemtype": "method", + "name": "isConst", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@glimmer/tracking/primitives/cache", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Application-b696b850cb.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Application-b696b850cb.json new file mode 100644 index 000000000..7574a6e27 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Application-b696b850cb.json @@ -0,0 +1,604 @@ +{ + "data": { + "id": "ember-4.11.0-Application", + "type": "class", + "attributes": { + "name": "Application", + "shortname": "Application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/index.ts", + "line": 43, + "description": "

An instance of Application is the starting point for every Ember\napplication. It instantiates, initializes and coordinates the\nobjects that make up your app.

\n

Each Ember app has one and only one Application object. Although\nEmber CLI creates this object implicitly, the Application class\nis defined in the app/app.js. You can define a ready method on the\nApplication class, which will be run by Ember when the application is\ninitialized.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
export default class App extends Application {\n  ready() {\n    // your code here\n  }\n}
\n
\n
\n \n

Because Application ultimately inherits from Ember.Namespace, any classes\nyou create will have useful string representations when calling toString().\nSee the Ember.Namespace documentation for more information.

\n

While you can think of your Application as a container that holds the\nother classes in your application, there are several other responsibilities\ngoing on under-the-hood that you may want to understand. It is also important\nto understand that an Application is different from an ApplicationInstance.\nRefer to the Guides to understand the difference between these.

\n

Event Delegation

\n

Ember uses a technique called event delegation. This allows the framework\nto set up a global, shared event listener instead of requiring each view to\ndo it manually. For example, instead of each view registering its own\nmousedown listener on its associated element, Ember sets up a mousedown\nlistener on the body.

\n

If a mousedown event occurs, Ember will look at the target of the event and\nstart walking up the DOM node tree, finding corresponding views and invoking\ntheir mouseDown method as it goes.

\n

Application has a number of default events that it listens for, as\nwell as a mapping from lowercase events to camel-cased view method names. For\nexample, the keypress event causes the keyPress method on the view to be\ncalled, the dblclick event causes doubleClick to be called, and so on.

\n

If there is a bubbling browser event that Ember does not listen for by\ndefault, you can specify custom events and their corresponding view method\nnames by setting the application's customEvents property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nexport default class App extends Application {\n  customEvents = {\n    // add support for the paste event\n    paste: 'paste'\n  }\n}
\n
\n
\n \n

To prevent Ember from setting up a listener for a default event,\nspecify the event name with a null value in the customEvents\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nexport default class App extends Application {\n  customEvents = {\n    // prevent listeners for mouseenter/mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n}
\n
\n
\n \n

By default, the application sets up these event listeners on the document\nbody. However, in cases where you are embedding an Ember application inside\nan existing page, you may want it to set up the listeners on an element\ninside the body.

\n

For example, if only events inside a DOM element with the ID of ember-app\nshould be delegated, set your application's rootElement property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nexport default class App extends Application {\n  rootElement = '#ember-app'\n}
\n
\n
\n \n

The rootElement can be either a DOM element or a CSS selector\nstring. Note that views appended to the DOM outside the root element will\nnot receive events. If you specify a custom root element, make sure you only\nappend views inside it!

\n

To learn more about the events Ember components use, see

\n

components/handling-events.

\n

Initializers

\n

To add behavior to the Application's boot process, you can define initializers in\nthe app/initializers directory, or with ember generate initializer using Ember CLI.\nThese files should export a named initialize function which will receive the created application\nobject as its first argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
export function initialize(application) {\n  // application.inject('route', 'foo', 'service:foo');\n}
\n
\n
\n \n

Application initializers can be used for a variety of reasons including:

\n
    \n
  • setting up external libraries
  • \n
  • injecting dependencies
  • \n
  • setting up event listeners in embedded apps
  • \n
  • deferring the boot process using the deferReadiness and advanceReadiness APIs.
  • \n
\n

Routing

\n

In addition to creating your application's router, Application is\nalso responsible for telling the router when to start routing. Transitions\nbetween routes can be logged with the LOG_TRANSITIONS flag, and more\ndetailed intra-transition logging can be logged with\nthe LOG_TRANSITIONS_INTERNAL flag:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  LOG_TRANSITIONS: true, // basic logging of successful transitions\n  LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n});
\n
\n
\n \n

By default, the router will begin trying to translate the current URL into\napplication state once the browser emits the DOMContentReady event. If you\nneed to defer routing, you can call the application's deferReadiness()\nmethod. Once routing can begin, call the advanceReadiness() method.

\n

If there is any setup required before routing begins, you can implement a\nready() method on your app that will be invoked immediately before routing\nbegins.

\n", + "extends": "Engine", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/application/index.ts", + "line": 197, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 444, + "description": "

Create an ApplicationInstance for this application.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the application instance", + "type": "ApplicationInstance" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 469, + "description": "

Start tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is created.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_watchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 480, + "description": "

Stop tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is about to be destroyed.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_unwatchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 493, + "description": "

Enable the legacy globals mode by allowing this application to act\nas a global namespace. See the docs on the _globalsMode property\nfor details.

\n

Most of these features are already deprecated in 1.x, so we can\nstop using them internally and try to remove them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareForGlobalsMode", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 540, + "description": "

Automatically kick-off the boot process for the application once the\nDOM has become ready.

\n

The initialization itself is scheduled on the actions queue which\nensures that code-loading finishes before booting.

\n

If you are asynchronously loading code, you should call deferReadiness()\nto defer booting, and then call advanceReadiness() once all of your code\nhas finished loading.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "waitForDOMReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 580, + "description": "

This is the autoboot flow:

\n
    \n
  1. Boot the app by calling this.boot()
  2. \n
  3. Create an instance (or use the __deprecatedInstance__ in globals mode)
  4. \n
  5. Boot the instance by calling instance.boot()
  6. \n
  7. Invoke the App.ready() callback
  8. \n
  9. Kick-off routing on the instance
  10. \n
\n

Ideally, this is all we would need to do:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
_autoBoot() {\n  this.boot().then(() => {\n    let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance();\n    return instance.boot();\n  }).then((instance) => {\n    App.ready();\n    instance.startRouting();\n  });\n}
\n
\n
\n \n

Unfortunately, we cannot actually write this because we need to participate\nin the "synchronous" boot process. While the code above would work fine on\nthe initial boot (i.e. DOM ready), when App.reset() is called, we need to\nboot a new instance synchronously (see the documentation on _bootSync()\nfor details).

\n

Because of this restriction, the actual logic of this method is located\ninside didBecomeReady().

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "domReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 625, + "description": "

Use this to defer readiness until some condition is true.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Application from '@ember/application';\n\nlet App = Application.create();\n\nApp.deferReadiness();\n\nfetch('/auth-token')\n.then(response => response.json())\n.then(data => {\n  App.token = data.token;\n  App.advanceReadiness();\n});
\n
\n
\n \n

This allows you to perform asynchronous setup logic and defer\nbooting your application until the setup has finished.

\n

However, if the setup requires a loading UI, it might be better\nto use the router for this purpose.

\n", + "itemtype": "method", + "name": "deferReadiness", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 675, + "description": "

Call advanceReadiness after any asynchronous setup logic has completed.\nEach call to deferReadiness must be matched by a call to advanceReadiness\nor the application will never become ready and routing will not begin.

\n", + "itemtype": "method", + "name": "advanceReadiness", + "see": [ + "{Application#deferReadiness}" + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 714, + "description": "

Initialize the application and return a promise that resolves with the Application\nobject when the boot process is complete.

\n

Run any application initializers and run the application load hook. These hooks may\nchoose to defer readiness. For example, an authentication hook might want to defer\nreadiness until the auth token has been retrieved.

\n

By default, this method is called automatically on "DOM ready"; however, if autoboot\nis disabled, this is automatically called when the first application instance is\ncreated via visit.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 795, + "description": "

Reset the application. This is typically used only in tests. It cleans up\nthe application in the following order:

\n
    \n
  1. Deactivate existing routes
  2. \n
  3. Destroy all objects in the container
  4. \n
  5. Create a new application container
  6. \n
  7. Re-route to the existing url
  8. \n
\n

Typical Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    App.reset();\n  }\n});\n\ntest('first test', function() {\n  // App is freshly reset\n});\n\ntest('second test', function() {\n  // App is again freshly reset\n});
\n
\n
\n \n

Advanced Example:

\n

Occasionally you may want to prevent the app from initializing during\nsetup. This could enable extra configuration, or enable asserting prior\nto the app becoming ready.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    run(function() {\n      App.reset();\n      App.deferReadiness();\n    });\n  }\n});\n\ntest('first test', function() {\n  ok(true, 'something before app is initialized');\n\n  run(function() {\n    App.advanceReadiness();\n  });\n\n  ok(true, 'something after app is initialized');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reset", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 899, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "didBecomeReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 977, + "description": "

Boot a new instance of ApplicationInstance for the current\napplication and navigate it to the given url. Returns a Promise that\nresolves with the instance when the initial routing and rendering is\ncomplete, or rejects with any error that occurred during the boot process.

\n

When autoboot is disabled, calling visit would first cause the\napplication to boot, which runs the application initializers.

\n

This method also takes a hash of boot-time configuration options for\ncustomizing the instance's behavior. See the documentation on\nApplicationInstance.BootOptions for details.

\n

ApplicationInstance.BootOptions is an interface class that exists\npurely to document the available options; you do not need to construct it\nmanually. Simply pass a regular JavaScript object containing of the\ndesired options:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Supported Scenarios

\n

While the BootOptions class exposes a large number of knobs, not all\ncombinations of them are valid; certain incompatible combinations might\nresult in unexpected behavior.

\n

For example, booting the instance in the full browser environment\nwhile specifying a foreign document object (e.g. { isBrowser: true, document: iframe.contentDocument }) does not work correctly today,\nlargely due to Ember's jQuery dependency.

\n

Currently, there are three officially supported scenarios/configurations.\nUsages outside of these scenarios are not guaranteed to work, but please\nfeel free to file bug reports documenting your experience and any issues\nyou encountered to help expand support.

\n

Browser Applications (Manual Boot)

\n

The setup is largely similar to how Ember works out-of-the-box. Normally,\nEmber will boot a default instance for your Application on "DOM ready".\nHowever, you can customize this behavior by disabling autoboot.

\n

For example, this allows you to render a miniture demo of your application\ninto a specific area on your marketing website:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let options = {\n    // Override the router's location adapter to prevent it from updating\n    // the URL in the address bar\n    location: 'none',\n\n    // Override the default `rootElement` on the app to render into a\n    // specific `div` on the page\n    rootElement: '#demo'\n  };\n\n  // Start the app at the special demo URL\n  App.visit('/demo', options);\n});
\n
\n
\n \n

Or perhaps you might want to boot two instances of your app on the same\npage for a split-screen multiplayer experience:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let sessionId = MyApp.generateSessionID();\n\n  let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' });\n  let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' });\n\n  Promise.all([player1, player2]).then(() => {\n    // Both apps have completed the initial render\n    $('#loading').fadeOut();\n  });\n});
\n
\n
\n \n

Do note that each app instance maintains their own registry/container, so\nthey will run in complete isolation by default.

\n

Server-Side Rendering (also known as FastBoot)

\n

This setup allows you to run your Ember app in a server environment using\nNode.js and render its content into static HTML for SEO purposes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap);\n\nfunction renderURL(url) {\n  let dom = new SimpleDOM.Document();\n  let rootElement = dom.body;\n  let options = { isBrowser: false, document: dom, rootElement: rootElement };\n\n  return MyApp.visit(options).then(instance => {\n    try {\n      return HTMLSerializer.serialize(rootElement.firstChild);\n    } finally {\n      instance.destroy();\n    }\n  });\n}
\n
\n
\n \n

In this scenario, because Ember does not have access to a global document\nobject in the Node.js environment, you must provide one explicitly. In practice,\nin the non-browser environment, the stand-in document object only needs to\nimplement a limited subset of the full DOM API. The SimpleDOM library is known\nto work.

\n

Since there is no DOM access in the non-browser environment, you must also\nspecify a DOM Element object in the same document for the rootElement option\n(as opposed to a selector string like "body").

\n

See the documentation on the isBrowser, document and rootElement properties\non ApplicationInstance.BootOptions for details.

\n

Server-Side Resource Discovery

\n

This setup allows you to run the routing layer of your Ember app in a server\nenvironment using Node.js and completely disable rendering. This allows you\nto simulate and discover the resources (i.e. AJAX requests) needed to fulfill\na given request and eagerly "push" these resources to the client.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
service.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import BrowserNetworkService from 'app/services/network/browser';\nimport NodeNetworkService from 'app/services/network/node';\n\n// Inject a (hypothetical) service for abstracting all AJAX calls and use\n// the appropriate implementation on the client/server. This also allows the\n// server to log all the AJAX calls made during a particular request and use\n// that for resource-discovery purpose.\n\nexport function initialize(application) {\n  if (window) { // browser\n    application.register('service:network', BrowserNetworkService);\n  } else { // node\n    application.register('service:network', NodeNetworkService);\n  }\n};\n\nexport default {\n  name: 'network-service',\n  initialize: initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\n// An example of how the (hypothetical) service is used in routes.\n\nexport default class IndexRoute extends Route {\n  @service network;\n\n  model(params) {\n    return this.network.fetch(`/api/posts/${params.post_id}.json`);\n  }\n\n  afterModel(post) {\n    if (post.isExternalContent) {\n      return this.network.fetch(`/api/external/?url=${post.externalURL}`);\n    } else {\n      return post;\n    }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
// Finally, put all the pieces together\n\nfunction discoverResourcesFor(url) {\n  return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => {\n    let networkService = instance.lookup('service:network');\n    return networkService.requests; // => { "/api/posts/123.json": "..." }\n  });\n}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "The initial URL to navigate to", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "ApplicationInstance.BootOptions" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 62, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 209, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 285, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 346, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 359, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 371, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 384, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 392, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 400, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 414, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 448, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Enginer" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 41, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [ + { + "file": "packages/@ember/application/index.ts", + "line": 952, + "description": "

Called when the Application has become ready, immediately before routing\nbegins. The call will be delayed until the DOM has become ready.

\n", + "itemtype": "event", + "name": "ready", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + } + ], + "properties": [ + { + "file": "packages/@ember/application/index.ts", + "line": 242, + "description": "

The root DOM element of the Application. This can be specified as an\nelement or a selector string.

\n

This is the element that will be passed to the Application's,\neventDispatcher, which sets up the listeners for event delegation. Every\nview in your application should be a child of the element you specify here.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 257, + "itemtype": "property", + "name": "_document", + "type": "Document | null", + "default": "'window.document'", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 266, + "description": "

The Ember.EventDispatcher responsible for delegating events to this\napplication's views.

\n

The event dispatcher is created by the application at initialization time\nand sets up event listeners on the DOM element described by the\napplication's rootElement property.

\n

See the documentation for Ember.EventDispatcher for more information.

\n", + "itemtype": "property", + "name": "eventDispatcher", + "type": "Ember.EventDispatcher", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 283, + "description": "

The DOM events for which the event dispatcher should listen.

\n

By default, the application's Ember.EventDispatcher listens\nfor a set of standard DOM events, such as mousedown and\nkeyup, and delegates them to your application's Ember.View\ninstances.

\n

If you would like additional bubbling events to be delegated to your\nviews, set your Application's customEvents property\nto a hash containing the DOM event name as the key and the\ncorresponding view method name as the value. Setting an event to\na value of null will prevent a default event listener from being\nadded for that event.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // add support for the paste event\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // remove support for mouseenter / mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "customEvents", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 331, + "description": "

Whether the application should automatically start routing and render\ntemplates to the rootElement on DOM ready. While default by true,\nother environments such as FastBoot or a testing harness can set this\nproperty to false and control the precise timing and behavior of the boot\nprocess.

\n", + "itemtype": "property", + "name": "autoboot", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 345, + "description": "

Whether the application should be configured for the legacy "globals mode".\nUnder this mode, the Application object serves as a global namespace for all\nclasses.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Application from '@ember/application';\nimport Component from '@ember/component';\n\nlet App = Application.create({\n  ...\n});\n\nApp.Router.reopen({\n  location: 'none'\n});\n\nApp.Router.map({\n  ...\n});\n\nApp.MyComponent = Component.extend({\n  ...\n});
\n
\n
\n \n

This flag also exposes other internal APIs that assumes the existence of\na special "default instance", like App.__container__.lookup(...).

\n

This option is currently not configurable, its value is derived from\nthe autoboot flag – disabling autoboot also implies opting-out of\nglobals mode support, although they are ultimately orthogonal concerns.

\n

Some of the global modes features are already deprecated in 1.x. The\nexistence of this flag is to untangle the globals mode code paths from\nthe autoboot code paths, so that these legacy features can be reviewed\nfor deprecation/removal separately.

\n

Forcing the (autoboot=true, _globalsMode=false) here and running the tests\nwould reveal all the places where we are still relying on these legacy\nbehavior internally (mostly just tests).

\n", + "itemtype": "property", + "name": "_globalsMode", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 394, + "description": "

An array of application instances created by buildInstance(). Used\ninternally to ensure that all instances get destroyed.

\n", + "itemtype": "property", + "name": "_applicationInstances", + "type": "Array", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 325, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 338, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.11.0-Engine", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-ApplicationInstance-d5826e684b.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-ApplicationInstance-d5826e684b.json new file mode 100644 index 000000000..ae0029ea6 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-ApplicationInstance-d5826e684b.json @@ -0,0 +1,834 @@ +{ + "data": { + "id": "ember-4.11.0-ApplicationInstance", + "type": "class", + "attributes": { + "name": "ApplicationInstance", + "shortname": "ApplicationInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/instance.ts", + "line": 19, + "description": "

The ApplicationInstance encapsulates all of the stateful aspects of a\nrunning Application.

\n

At a high-level, we break application boot into two distinct phases:

\n
    \n
  • Definition time, where all of the classes, templates, and other\ndependencies are loaded (typically in the browser).
  • \n
  • Run time, where we begin executing the application once everything\nhas loaded.
  • \n
\n

Definition time can be expensive and only needs to happen once since it is\nan idempotent operation. For example, between test runs and FastBoot\nrequests, the application stays the same. It is only the state that we want\nto reset.

\n

That state is what the ApplicationInstance manages: it is responsible for\ncreating the container that contains all application state, and disposing of\nit once the particular test run or FastBoot request has finished.

\n", + "access": "public", + "tagname": "", + "extends": "EngineInstance", + "methods": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 296, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 58, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 109, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 175, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 192, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 222, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 41, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 189, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ApplicationInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 238, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ApplicationInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 45, + "description": "

The Application for which this is an instance.

\n", + "itemtype": "property", + "name": "application", + "type": "Application", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 53, + "description": "

The root DOM element of the Application as an element or a\nCSS selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "String|DOMElement", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 70, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 25, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.11.0-EngineInstance", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-ApplicationInstance.BootOptions-8e363bdf1f.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-ApplicationInstance.BootOptions-8e363bdf1f.json new file mode 100644 index 000000000..718ae4cbe --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-ApplicationInstance.BootOptions-8e363bdf1f.json @@ -0,0 +1,143 @@ +{ + "data": { + "id": "ember-4.11.0-ApplicationInstance.BootOptions", + "type": "class", + "attributes": { + "name": "ApplicationInstance.BootOptions", + "shortname": "ApplicationInstance.BootOptions", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "ApplicationInstance", + "file": "packages/@ember/application/instance.ts", + "line": 316, + "description": "

A list of boot-time configuration options for customizing the behavior of\nan ApplicationInstance.

\n

This is an interface class that exists purely to document the available\noptions; you do not need to construct it manually. Simply pass a regular\nJavaScript object containing the desired options into methods that require\none of these options object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Not all combinations of the supported options are valid. See the documentation\non Application#visit for the supported configurations.

\n

Internal, experimental or otherwise unstable flags are marked as private.

\n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 339, + "description": "

Interactive mode: whether we need to set up event delegation and invoke\nlifecycle callbacks on Components.

\n", + "itemtype": "property", + "name": "isInteractive", + "type": "boolean", + "default": "auto-detected", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 350, + "itemtype": "property", + "name": "_renderMode", + "type": "string", + "default": "undefined", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 358, + "description": "

Run in a full browser environment.

\n

When this flag is set to false, it will disable most browser-specific\nand interactive features. Specifically:

\n
    \n
  • It does not use jQuery to append the root view; the rootElement\n(either specified as a subsequent option or on the application itself)\nmust already be an Element in the given document (as opposed to a\nstring selector).

    \n
  • \n
  • It does not set up an EventDispatcher.

    \n
  • \n
  • It does not run any Component lifecycle hooks (such as didInsertElement).

    \n
  • \n
  • It sets the location option to "none". (If you would like to use\nthe location adapter specified in the app's router instead, you can also\nspecify { location: null } to specifically opt-out.)

    \n
  • \n
\n", + "itemtype": "property", + "name": "isBrowser", + "type": "boolean", + "default": "auto-detected", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 384, + "description": "

If present, overrides the router's location property with this\nvalue. This is useful for environments where trying to modify the\nURL would be inappropriate.

\n", + "itemtype": "property", + "name": "location", + "type": "string", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 396, + "description": "

Disable rendering completely.

\n

When this flag is set to false, it will disable the entire rendering\npipeline. Essentially, this puts the app into "routing-only" mode. No\ntemplates will be rendered, and no Components will be created.

\n", + "itemtype": "property", + "name": "shouldRender", + "type": "boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 410, + "description": "

If present, render into the given Document object instead of the\nglobal window.document object.

\n

In practice, this is only useful in non-browser environment or in\nnon-interactive mode, because Ember's jQuery dependency is\nimplicitly bound to the current document, causing event delegation\nto not work properly when the app is rendered into a foreign\ndocument object (such as an iframe's contentDocument).

\n

In non-browser mode, this could be a "Document-like" object as\nEmber only interact with a small subset of the DOM API in non-\ninteractive mode. While the exact requirements have not yet been\nformalized, the SimpleDOM library's implementation is known to\nwork.

\n", + "itemtype": "property", + "name": "document", + "type": "Document", + "default": "the global `document` object", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 433, + "description": "

If present, overrides the application's rootElement property on\nthe instance. This is useful for testing environment, where you\nmight want to append the root view to a fixture area.

\n

In non-browser mode, because Ember does not have access to jQuery,\nthis options must be specified as a DOM Element object instead of\na selector string.

\n

See the documentation on Application's rootElement for\ndetails.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "String|Element", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-ArrayProxy-823f753c72.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-ArrayProxy-dc14e58c97.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-ArrayProxy-823f753c72.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-ArrayProxy-dc14e58c97.json index 31151dbc9..9d22bd61c 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-ArrayProxy-823f753c72.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-ArrayProxy-dc14e58c97.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-ArrayProxy", + "id": "ember-4.11.0-ArrayProxy", "type": "class", "attributes": { "name": "ArrayProxy", @@ -1810,7 +1810,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.11.0-EmberObject", "type": "class" } }, @@ -1819,13 +1819,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/array/proxy", + "id": "ember-4.11.0-@ember/array/proxy", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-BasicContainer-f459e891b3.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-BasicContainer-f459e891b3.json new file mode 100644 index 000000000..d7048ea85 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-BasicContainer-f459e891b3.json @@ -0,0 +1,102 @@ +{ + "data": { + "id": "ember-4.11.0-BasicContainer", + "type": "class", + "attributes": { + "name": "BasicContainer", + "shortname": "BasicContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Owner" + ], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 180, + "description": "

The common interface for the ability to lookup() or get the factoryFor an\nitem, shared by the Owner and ContainerProxy interfaces.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 189, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "BasicContainer", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 238, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "BasicContainer", + "module": "@ember/owner" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.11.0-ContainerProxy" + } + ] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-BasicRegistry-da09ede701.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-BasicRegistry-da09ede701.json new file mode 100644 index 000000000..14d426925 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-BasicRegistry-da09ede701.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-4.11.0-BasicRegistry", + "type": "class", + "attributes": { + "name": "BasicRegistry", + "shortname": "BasicRegistry", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Owner" + ], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 89, + "description": "

The common interface for the ability to register() an item, shared by the\nOwner and RegistryProxy interfaces.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "BasicRegistry", + "module": "@ember/owner" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.11.0-RegistryProxy" + } + ] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Component-19a668a9d0.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Component-19a668a9d0.json new file mode 100644 index 000000000..ac33e5a5e --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Component-19a668a9d0.json @@ -0,0 +1,1587 @@ +{ + "data": { + "id": "ember-4.11.0-Component", + "type": "class", + "attributes": { + "name": "Component", + "shortname": "Component", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 39, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault component's for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Classic components. If you are looking for the\nAPI documentation for Template-only or Glimmer components, it is\navailable here.

\n

Defining a Classic Component

\n

If you want to customize the component in order to handle events, transform\narguments or maintain internal state, you implement a subclass of Component.

\n

One example is to add computed properties to your component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  displayName: computed('person.title', 'person.firstName', 'person.lastName', function() {\n    let { title, firstName, lastName } = this.person;\n\n    if (title) {\n      return `${title} ${lastName}`;\n    } else {\n      return `${firstName} ${lastName}`;\n    }\n  })\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

Customizing a Classic Component's HTML Element in JavaScript

\n

HTML Tag

\n

The default HTML tag name used for a component's HTML representation is div.\nThis can be customized by setting the tagName property.

\n

Consider the following component class:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
paragraph.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'em'\n});
\n
\n
\n \n

When invoked, this component would produce output that looks something like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<em id="ember1" class="ember-view"></em>
\n
\n
\n \n

HTML class Attribute

\n

The HTML class attribute of a component's tag can be set by providing a\nclassNames property that is set to an array of strings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class']\n});
\n
\n
\n \n

Invoking this component will produce output that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class"></div>
\n
\n
\n \n

class attribute values can also be set by providing a classNameBindings\nproperty set to an array of properties names for the component. The return\nvalue of these properties will be added as part of the value for the\ncomponents's class attribute. These properties can be computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class'],\n  classNameBindings: ['propertyA', 'propertyB'],\n\n  propertyA: 'from-a',\n  propertyB: computed(function() {\n    if (someLogic) { return 'from-b'; }\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

Note that classNames and classNameBindings is in addition to the class\nattribute passed with the angle bracket invocation syntax. Therefore, if this\ncomponent was invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyWidget class="from-invocation" />
\n
\n
\n \n

The resulting HTML will look similar to this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="from-invocation ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

If the value of a class name binding returns a boolean the property name\nitself will be used as the class name if the property is true. The class name\nwill not be added if the value is false or undefined.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['hovered'],\n\n  hovered: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view hovered"></div>
\n
\n
\n \n

Custom Class Names for Boolean Values

\n

When using boolean class name bindings you can supply a string value other\nthan the property name for use as the class HTML attribute by appending the\npreferred value after a ":" character when defining the binding:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['awesome:so-very-cool'],\n\n  awesome: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view so-very-cool"></div>
\n
\n
\n \n

Boolean value class name bindings whose property names are in a\ncamelCase-style format will be converted to a dasherized format:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isUrgent'],\n\n  isUrgent: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view is-urgent"></div>
\n
\n
\n \n

Class name bindings can also refer to object values that are found by\ntraversing a path relative to the component itself:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport EmberObject from '@ember/object';\n\nexport default Component.extend({\n  classNameBindings: ['messages.empty'],\n\n  messages: EmberObject.create({\n    empty: true\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view empty"></div>
\n
\n
\n \n

If you want to add a class name for a property which evaluates to true and\nand a different class name if it evaluates to false, you can pass a binding\nlike this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isEnabled:enabled:disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view enabled"></div>
\n
\n
\n \n

When isEnabled is false, the resulting HTML representation looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

This syntax offers the convenience to add a class if a property is false:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\n// Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\nexport default Component.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component when the isEnabled property is true will produce\nHTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view"></div>
\n
\n
\n \n

Invoking it when the isEnabled property on the component is false will\nproduce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

Updates to the value of a class name binding will result in automatic update\nof the HTML class attribute in the component's rendered HTML\nrepresentation. If the value becomes false or undefined the class name\nwill be removed.

\n

Both classNames and classNameBindings are concatenated properties. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Other HTML Attributes

\n

The HTML attribute section of a component's tag can be set by providing an\nattributeBindings property set to an array of property names on the component.\nThe return value of these properties will be used as the value of the component's\nHTML associated attribute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['href'],\n\n  href: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

One property can be mapped on to another by placing a ":" between\nthe source property and the destination property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['url:href'],\n\n  url: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

HTML attributes passed with angle bracket invocations will take precedence\nover those specified in attributeBindings. Therefore, if this component was\ninvoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyAnchor href="http://bing.com" @url="http://google.com" />
\n
\n
\n \n

The resulting HTML will looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://bing.com"></a>
\n
\n
\n \n

Note that the href attribute is ultimately set to http://bing.com,\ndespite it having attribute binidng to the url property, which was\nset to http://google.com.

\n

Namespaced attributes (e.g. xlink:href) are supported, but have to be\nmapped, since : is not a valid character for properties in Javascript:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
use.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'use',\n  attributeBindings: ['xlinkHref:xlink:href'],\n\n  xlinkHref: '#triangle'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<use xlink:href="#triangle"></use>
\n
\n
\n \n

If the value of a property monitored by attributeBindings is a boolean, the\nattribute will be present or absent depending on the value:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: false\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id="ember1" class="ember-view" />
\n
\n
\n \n

attributeBindings can refer to computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: computed(function() {\n    if (someLogic) {\n      return true;\n    } else {\n      return false;\n    }\n  })\n});
\n
\n
\n \n

To prevent setting an attribute altogether, use null or undefined as the\nvalue of the property used in attributeBindings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'form',\n  attributeBindings: ['novalidate'],\n  novalidate: null\n});
\n
\n
\n \n

Updates to the property of an attribute binding will result in automatic\nupdate of the HTML attribute in the component's HTML output.

\n

attributeBindings is a concatenated property. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Layouts

\n

The layout property can be used to dynamically specify a template associated\nwith a component class, instead of relying on Ember to link together a\ncomponent class and a template based on file names.

\n

In general, applications should not use this feature, but it's commonly used\nin addons for historical reasons.

\n

The layout property should be set to the default export of a template\nmodule, which is the name of a template file without the .hbs extension.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>Person's Title</h1>\n<div class='details'>{{yield}}</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n
  import Component from '@ember/component';\n  import layout from '../templates/components/person-profile';\n\n  export default Component.extend({\n    layout\n  });
\n
\n
\n \n

If you invoke the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile>\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</PersonProfile>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#person-profile}}\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n{{/person-profile}}
\n
\n
\n \n

It will result in the following HTML output:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<h1>Person's Title</h1>\n  <div class="details">\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</div>
\n
\n
\n \n

Handling Browser Events

\n

Components can respond to user-initiated events in one of three ways: passing\nactions with angle bracket invocation, adding event handler methods to the\ncomponent's class, or adding actions to the component's template.

\n

Passing Actions With Angle Bracket Invocation

\n

For one-off events specific to particular instance of a component, it is possible\nto pass actions to the component's element using angle bracket invocation syntax.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyWidget {{action 'firstWidgetClicked'}} />\n\n<MyWidget {{action 'secondWidgetClicked'}} />
\n
\n
\n \n

In this case, when the first component is clicked on, Ember will invoke the\nfirstWidgetClicked action. When the second component is clicked on, Ember\nwill invoke the secondWidgetClicked action instead.

\n

Besides {{action}}, it is also possible to pass any arbitrary element modifiers\nusing the angle bracket invocation syntax.

\n

Event Handler Methods

\n

Components can also respond to user-initiated events by implementing a method\nthat matches the event name. This approach is appropriate when the same event\nshould be handled by all instances of the same component.

\n

An event object will be passed as the argument to the event handler method.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click(event) {\n    // `event.target` is either the component's element or one of its children\n    let tag = event.target.tagName.toLowerCase();\n    console.log('clicked on a `<${tag}>` HTML element!');\n  }\n});
\n
\n
\n \n

In this example, whenever the user clicked anywhere inside the component, it\nwill log a message to the console.

\n

It is possible to handle event types other than click by implementing the\nfollowing event handler methods. In addition, custom events can be registered\nby using Application.customEvents.

\n

Touch events:

\n
    \n
  • touchStart
  • \n
  • touchMove
  • \n
  • touchEnd
  • \n
  • touchCancel
  • \n
\n

Keyboard events:

\n
    \n
  • keyDown
  • \n
  • keyUp
  • \n
  • keyPress
  • \n
\n

Mouse events:

\n
    \n
  • mouseDown
  • \n
  • mouseUp
  • \n
  • contextMenu
  • \n
  • click
  • \n
  • doubleClick
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
\n

Form events:

\n
    \n
  • submit
  • \n
  • change
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
  • input
  • \n
\n

Drag and drop events:

\n
    \n
  • dragStart
  • \n
  • drag
  • \n
  • dragEnter
  • \n
  • dragLeave
  • \n
  • dragOver
  • \n
  • dragEnd
  • \n
  • drop
  • \n
\n

{{action}} Helper

\n

Instead of handling all events of a particular type anywhere inside the\ncomponent's element, you may instead want to limit it to a particular\nelement in the component's template. In this case, it would be more\nconvenient to implement an action instead.

\n

For example, you could implement the action hello for the person-profile\ncomponent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  actions: {\n    hello(name) {\n      console.log("Hello", name);\n    }\n  }\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
<h1>{{@person.name}}</h1>\n\n<button {{action 'hello' @person.name}}>\n  Say Hello to {{@person.name}}\n</button>
\n
\n
\n \n

When the user clicks the button, Ember will invoke the hello action,\npassing in the current value of @person.name as an argument.

\n

See Ember.Templates.helpers.action.

\n", + "extends": "Ember.CoreView", + "uses": [ + "Ember.ViewStateSupport", + "Ember.ViewMixin", + "Ember.ActionSupport", + "Ember.ClassNamesSupport", + "Ember.TargetActionSupport" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 656, + "description": "

Called when the attributes passed into the component have been updated.\n Called both during the initial render of a container and during a rerender.\n Can be used in place of an observer; code placed here will be executed\n every time any attribute updates.

\n", + "itemtype": "method", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 677, + "description": "

Called after a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "method", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 694, + "description": "

Called before a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "method", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 711, + "description": "

Called when the attributes passed into the component have been changed.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 728, + "description": "

Called when the component is about to update and rerender itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 745, + "description": "

Called when the component has updated and rerendered itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 951, + "description": "

Normally, Ember's component model is "write-only". The component takes a\nbunch of attributes that it got passed in, and uses them to render its\ntemplate.

\n

One nice thing about this model is that if you try to set a value to the\nsame thing as last time, Ember (through HTMLBars) will avoid doing any\nwork on the DOM.

\n

This is not just a performance optimization. If an attribute has not\nchanged, it is important not to clobber the element's "hidden state".\nFor example, if you set an input's value to the same value as before,\nit will clobber selection state and cursor position. In other words,\nsetting an attribute is not always idempotent.

\n

This method provides a way to read an element's attribute and also\nupdate the last value Ember knows about at the same time. This makes\nsetting an attribute idempotent.

\n

In particular, what this means is that if you get an <input> element's\nvalue attribute and then re-render the template with the same value,\nit will avoid clobbering the cursor and selection position.\nSince most attribute sets are idempotent in the browser, you typically\ncan get away with reading attributes using jQuery, but the most reliable\nway to do so is through this method.

\n", + "itemtype": "method", + "name": "readDOMAttr", + "params": [ + { + "name": "name", + "description": "the name of the attribute", + "type": "String" + } + ], + "return": { + "description": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 36, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 58, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 78, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 110, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 153, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 162, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 177, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 193, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 209, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 77, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 93, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 121, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 141, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 181, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 246, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 331, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 405, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 439, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 52, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.TargetActionSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/mixin.ts", + "line": 435, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/mixin", + "inherited": true, + "inheritedFrom": "Mixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 667, + "description": "

Called when the attributes passed into the component have been updated.\n Called both during the initial render of a container and during a rerender.\n Can be used in place of an observer; code placed here will be executed\n every time any attribute updates.

\n", + "itemtype": "event", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 686, + "description": "

Called after a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "event", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 703, + "description": "

Called before a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "event", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 720, + "description": "

Called when the attributes passed into the component have been changed.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 737, + "description": "

Called when the component is about to update and rerender itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 754, + "description": "

Called when the component has updated and rerendered itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 300, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 308, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 321, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 345, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 358, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 366, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 762, + "description": "

The HTML id of the component's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent @elementId="a-really-cool-id" />
\n
\n
\n \n

If not manually set a default value will be provided by the framework.\nOnce rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
export default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    var index = this.get('index');\n    this.set('elementId', `component-id${index}`);\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1011, + "description": "

Layout can be used to wrap content in a component.

\n", + "itemtype": "property", + "name": "layout", + "type": "Function", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1019, + "description": "

The name of the layout to lookup if no layout is provided.\nBy default Component will lookup a template with this name in\nEmber.TEMPLATES (a shared global object).

\n", + "itemtype": "property", + "name": "layoutName", + "type": "String", + "default": "undefined", + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1030, + "description": "

The WAI-ARIA role of the control represented by this view. For example, a\n button may have a role of type 'button', or a pane may have a role of\n type 'alertdialog'. This property is used by assistive software to help\n visually challenged users navigate rich web applications.

\n

The full list of valid WAI-ARIA roles is available at:\n https://www.w3.org/TR/wai-aria/#roles_categorization

\n", + "itemtype": "property", + "name": "ariaRole", + "type": "String", + "default": "undefined", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1055, + "description": "

Enables components to take a list of parameters as arguments.\n For example, a component that takes two parameters with the names\n name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: ['name', 'age']\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" 38}}
\n
\n
\n \n

The parameters can be referred to just like named parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Name: {{name}}, Age: {{age}}.
\n
\n
\n \n

Using a string instead of an array allows for an arbitrary number of\n parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: 'names'\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" "Michael" "Scott"}}
\n
\n
\n \n

The parameters can then be referred to by enumerating over the list:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{#each names as |name|}}{{name}}{{/each}}
\n
\n
\n \n", + "static": 1, + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "positionalParams", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 38, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 35, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 166, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 267, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 378, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/child_views_support.ts", + "line": 14, + "description": "

Array of child views. You should never edit this array directly.

\n", + "itemtype": "property", + "name": "childViews", + "type": "Array", + "default": "[]", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 36, + "description": "

Standard CSS class names to apply to the view's outer element. This\nproperty automatically inherits any class names defined by the view's\nsuperclasses as well.

\n", + "itemtype": "property", + "name": "classNames", + "type": "Array", + "default": "['ember-view']", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 48, + "description": "

A list of properties of the view to apply as class names. If the property\nis a string value, the value of that string will be applied as a class\nname.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'high' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['priority'],\n  priority: 'high'\n});
\n
\n
\n \n

If the value of the property is a Boolean, the name of that property is\nadded as a dasherized class name.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'is-urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would prefer to use a custom value instead of the dasherized\nproperty name, you can pass a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent:urgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would like to specify a class that should only be added when the\nproperty is false, you can declare a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'disabled' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: false\n});
\n
\n
\n \n

This list of properties is inherited from the component's superclasses as well.

\n", + "itemtype": "property", + "name": "classNameBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.11.0-Ember.CoreView", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-ComputedProperty-7ad91be9f2.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-ComputedProperty-7ad91be9f2.json new file mode 100644 index 000000000..a5f54f635 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-ComputedProperty-7ad91be9f2.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-4.11.0-ComputedProperty", + "type": "class", + "attributes": { + "name": "ComputedProperty", + "shortname": "ComputedProperty", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 76, + "description": "

@computed is a decorator that turns a JavaScript getter and setter into a\ncomputed property, which is a cached, trackable value. By default the getter\nwill only be called once and the result will be cached. You can specify\nvarious properties that your computed property depends on. This will force the\ncached result to be cleared if the dependencies are modified, and lazily recomputed the next time something asks for it.

\n

In the following example we decorate a getter - fullName - by calling\ncomputed with the property dependencies (firstName and lastName) as\narguments. The fullName getter will be called once (regardless of how many\ntimes it is accessed) as long as its dependencies do not change. Once\nfirstName or lastName are updated any future calls to fullName will\nincorporate the new values, and any watchers of the value such as templates\nwill be updated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet tom = new Person('Tom', 'Dale');\n\ntom.fullName; // 'Tom Dale'
\n
\n
\n \n

You can also provide a setter, which will be used when updating the computed\nproperty. Ember's set function must be used to update the property\nsince it will also notify observers of the property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(' ');\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

You can also pass a getter function or object with get and set functions\nas the last argument to the computed decorator. This allows you to define\ncomputed property macros:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { computed } from '@ember/object';\n\nfunction join(...keys) {\n  return computed(...keys, function() {\n    return keys.map(key => this[key]).join(' ');\n  });\n}\n\nclass Person {\n  @join('firstName', 'lastName')\n  fullName;\n}
\n
\n
\n \n

Note that when defined this way, getters and setters receive the key of the\nproperty they are decorating as the first argument. Setters receive the value\nthey are setting to as the second argument instead. Additionally, setters must\nreturn the value that should be cached:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { computed, set } from '@ember/object';\n\nfunction fullNameMacro(firstNameKey, lastNameKey) {\n  return computed(firstNameKey, lastNameKey, {\n    get() {\n      return `${this[firstNameKey]} ${this[lastNameKey]}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, firstNameKey, firstName);\n      set(this, lastNameKey, lastName);\n\n      return value;\n    }\n  });\n}\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @fullNameMacro('firstName', 'lastName') fullName;\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

Computed properties can also be used in classic classes. To do this, we\nprovide the getter and setter as the last argument like we would for a macro,\nand we assign it to a property on the class definition. This is an anonymous\ncomputed macro:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import EmberObject, { computed, set } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  // these will be supplied by `create`\n  firstName: null,\n  lastName: null,\n\n  fullName: computed('firstName', 'lastName', {\n    get() {\n      return `${this.firstName} ${this.lastName}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, 'firstName', firstName);\n      set(this, 'lastName', lastName);\n\n      return value;\n    }\n  })\n});\n\nlet tom = Person.create({\n  firstName: 'Tom',\n  lastName: 'Dale'\n});\n\ntom.get('fullName') // 'Tom Dale'
\n
\n
\n \n

You can overwrite computed property without setters with a normal property (no\nlonger computed) that won't change if dependencies change. You can also mark\ncomputed property as .readOnly() and block all attempts to set it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName').readOnly()\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet person = new Person();\nperson.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX>
\n
\n
\n \n

Additional resources:

\n\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 606, + "description": "

Call on a computed property to set it into read-only mode. When in this\nmode the computed property will throw an error when set.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  @computed().readOnly()\n  get guid() {\n    return 'guid-guid-guid';\n  }\n}\n\nlet person = new Person();\nset(person, 'guid', 'new-guid'); // will throw an exception
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  guid: computed(function() {\n    return 'guid-guid-guid';\n  }).readOnly()\n});\n\nlet person = Person.create();\nperson.set('guid', 'new-guid'); // will throw an exception
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "return": { + "description": "this", + "type": "ComputedProperty" + }, + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 656, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For example,\ncomputed property functions may close over variables that are then no longer\navailable for introspection. You can pass a hash of these values to a\ncomputed property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nclass Store {\n  @computed().meta({ type: Person })\n  get person() {\n    let personId = this.personId;\n    return Person.create({ id: personId });\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nconst Store = EmberObject.extend({\n  person: computed(function() {\n    let personId = this.get('personId');\n    return Person.create({ id: personId });\n  }).meta({ type: Person })\n});
\n
\n
\n \n

The hash that you pass to the meta() function will be saved on the\ncomputed property descriptor under the _meta key. Ember runtime\nexposes a public API for retrieving these values from classes,\nvia the metaForProperty() function.

\n", + "itemtype": "method", + "name": "meta", + "params": [ + { + "name": "meta", + "description": "", + "type": "Object" + } + ], + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Container-d12b7ac674.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Container-d12b7ac674.json new file mode 100644 index 000000000..9a9af6792 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Container-d12b7ac674.json @@ -0,0 +1,175 @@ +{ + "data": { + "id": "ember-4.11.0-Container", + "type": "class", + "attributes": { + "name": "Container", + "shortname": "Container", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 60, + "description": "

A container used to instantiate and cache objects.

\n

Every Container must be associated with a Registry, which is referenced\nto determine the factory and options that should be used to instantiate\nobjects.

\n

The public API for Container is still in flux and should not be considered\nstable.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 119, + "description": "

Given a fullName return a corresponding instance.\n The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter');\ntwitter instanceof Twitter; // => true\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted, an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions", + "optional": true + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 161, + "description": "

A depth first traversal, destroying the container, its descendant containers and all\ntheir managed objects.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "destroy", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 178, + "description": "

Clear either the entire cache or just the cache for a particular key.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "params": [ + { + "name": "fullName", + "description": "optional key to reset; if missing, resets everything", + "type": "String" + } + ], + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 195, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "return": { + "description": "", + "type": "Object" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 208, + "description": "

Given a fullName, return the corresponding factory. The consumer of the factory\nis responsible for the destruction of any factory instances, as there is no\nway for the container to ensure instances are destroyed when it itself is\ndestroyed.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 100, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registry", + "type": "Registry", + "since": "1.11.0", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 107, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "cache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 113, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "validationCache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-ContainerDebugAdapter-5c4635111e.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-ContainerDebugAdapter-0d956f4f3c.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-ContainerDebugAdapter-5c4635111e.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-ContainerDebugAdapter-0d956f4f3c.json index 9e764eca4..55cf1e9cc 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-ContainerDebugAdapter-5c4635111e.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-ContainerDebugAdapter-0d956f4f3c.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-ContainerDebugAdapter", + "id": "ember-4.11.0-ContainerDebugAdapter", "type": "class", "attributes": { "name": "ContainerDebugAdapter", @@ -568,7 +568,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.11.0-EmberObject", "type": "class" } }, @@ -577,13 +577,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/debug/container-debug-adapter", + "id": "ember-4.11.0-@ember/debug/container-debug-adapter", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-ContainerProxy-069847d7b8.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-ContainerProxy-069847d7b8.json new file mode 100644 index 000000000..0456a3148 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-ContainerProxy-069847d7b8.json @@ -0,0 +1,108 @@ +{ + "data": { + "id": "ember-4.11.0-ContainerProxy", + "type": "class", + "attributes": { + "name": "ContainerProxy", + "shortname": "ContainerProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 554, + "description": "

The interface for a container proxy, which is itself a private API used\nby the private ContainerProxyMixin as part of the base definition of\nEngineInstance.

\n", + "access": "private", + "tagname": "", + "extends": "BasicContainer", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 189, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ContainerProxy", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 238, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ContainerProxy", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.11.0-BasicContainer", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.11.0-ContainerProxyMixin" + } + ] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-ContainerProxyMixin-8cb3cb0c28.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-ContainerProxyMixin-8cb3cb0c28.json new file mode 100644 index 000000000..9f5bf36f5 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-ContainerProxyMixin-8cb3cb0c28.json @@ -0,0 +1,118 @@ +{ + "data": { + "id": "ember-4.11.0-ContainerProxyMixin", + "type": "class", + "attributes": { + "name": "ContainerProxyMixin", + "shortname": "ContainerProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 12, + "description": "

ContainerProxyMixin is used to provide public access to specific\ncontainer functionality.

\n", + "extends": "ContainerProxy", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 189, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ContainerProxyMixin", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 238, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ContainerProxyMixin", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 25, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ContainerProxyMixin", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.11.0-ContainerProxy", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-CoreObject-a39201c892.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-CoreObject-7008c5c323.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-CoreObject-a39201c892.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-CoreObject-7008c5c323.json index b61936dd7..e0a7f17ee 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-CoreObject-a39201c892.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-CoreObject-7008c5c323.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-CoreObject", + "id": "ember-4.11.0-CoreObject", "type": "class", "attributes": { "name": "CoreObject", @@ -133,23 +133,23 @@ "data": [ { "type": "class", - "id": "ember-4.12.1-Helper" + "id": "ember-4.11.0-Helper" }, { "type": "class", - "id": "ember-4.12.1-EmberObject" + "id": "ember-4.11.0-EmberObject" } ] }, "module": { "data": { - "id": "ember-4.12.1-@ember/object/core", + "id": "ember-4.11.0-@ember/object/core", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-DataAdapter-58971af5b8.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-DataAdapter-83222702fa.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-DataAdapter-58971af5b8.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-DataAdapter-83222702fa.json index 29f16ff72..f43296d14 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-DataAdapter-58971af5b8.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-DataAdapter-83222702fa.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-DataAdapter", + "id": "ember-4.11.0-DataAdapter", "type": "class", "attributes": { "name": "DataAdapter", @@ -911,7 +911,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.11.0-EmberObject", "type": "class" } }, @@ -920,13 +920,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/debug/data-adapter", + "id": "ember-4.11.0-@ember/debug/data-adapter", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.@ember/controller-3f69b161e5.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.@ember/controller-3f69b161e5.json new file mode 100644 index 000000000..b2c9c62a6 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.@ember/controller-3f69b161e5.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.11.0-Ember.@ember/controller", + "type": "class", + "attributes": { + "name": "Ember.@ember/controller", + "shortname": "@ember/controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember/controller", + "namespace": "Ember", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 344, + "description": "

Creates a property that lazily looks up another controller in the container.\nCan only be used when defining another controller.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default class PostController extends Controller {\n  @controller posts;\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default Controller.extend({\n  posts: controller()\n});
\n
\n
\n \n

This example will create a posts property on the post controller that\nlooks up the posts controller in the container, making it easy to reference\nother controllers.

\n", + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the controller to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "Ember.@ember/controller", + "module": "ember/controller" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.ActionHandler-d1b3193d74.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.ActionHandler-d1b3193d74.json new file mode 100644 index 000000000..1fbd3d928 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.ActionHandler-d1b3193d74.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.11.0-Ember.ActionHandler", + "type": "class", + "attributes": { + "name": "Ember.ActionHandler", + "shortname": "Ember.ActionHandler", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.CoreView", + "Ember.ControllerMixin" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 9, + "description": "

Ember.ActionHandler is available on some familiar classes including\nRoute, Component, and Controller.\n(Internally the mixin is used by Ember.CoreView, Ember.ControllerMixin,\nand Route and available to the above classes through\ninheritance.)

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.Controller-78b14a8932.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.Controller-78b14a8932.json new file mode 100644 index 000000000..8b5695249 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.Controller-78b14a8932.json @@ -0,0 +1,729 @@ +{ + "data": { + "id": "ember-4.11.0-Ember.Controller", + "type": "class", + "attributes": { + "name": "Ember.Controller", + "shortname": "Controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember/controller", + "namespace": "Ember", + "file": "packages/@ember/controller/index.ts", + "line": 335, + "extends": "EmberObject", + "uses": [ + "Ember.ControllerMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 91, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 169, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 264, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 285, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 36, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 54, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 63, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.11.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.ControllerMixin-1d246531e3.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.ControllerMixin-1d246531e3.json new file mode 100644 index 000000000..7fa342f63 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.ControllerMixin-1d246531e3.json @@ -0,0 +1,228 @@ +{ + "data": { + "id": "ember-4.11.0-Ember.ControllerMixin", + "type": "class", + "attributes": { + "name": "Ember.ControllerMixin", + "shortname": "Ember.ControllerMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.Controller" + ], + "module": "ember/controller", + "namespace": "Ember", + "file": "packages/@ember/controller/index.ts", + "line": 24, + "uses": [ + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 91, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 169, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 264, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 285, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 36, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 54, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 63, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.CoreView-d80819e982.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.CoreView-13a6e01b12.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.CoreView-d80819e982.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.CoreView-13a6e01b12.json index 27cf005f7..f3ad8966f 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.CoreView-d80819e982.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.CoreView-13a6e01b12.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.CoreView", + "id": "ember-4.11.0-Ember.CoreView", "type": "class", "attributes": { "name": "Ember.CoreView", @@ -904,7 +904,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.11.0-EmberObject", "type": "class" } }, @@ -912,19 +912,19 @@ "data": [ { "type": "class", - "id": "ember-4.12.1-Component" + "id": "ember-4.11.0-Component" } ] }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.11.0-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.EventDispatcher-47b31ebdf6.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.EventDispatcher-070d3aa37c.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.EventDispatcher-47b31ebdf6.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.EventDispatcher-070d3aa37c.json index 8a41c2dbf..9060d54c4 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.EventDispatcher-47b31ebdf6.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.EventDispatcher-070d3aa37c.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.EventDispatcher", + "id": "ember-4.11.0-Ember.EventDispatcher", "type": "class", "attributes": { "name": "Ember.EventDispatcher", @@ -635,7 +635,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.11.0-EmberObject", "type": "class" } }, @@ -644,13 +644,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.11.0-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.NativeArray-600110ad8e.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.NativeArray-600110ad8e.json new file mode 100644 index 000000000..268a3b43a --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.NativeArray-600110ad8e.json @@ -0,0 +1,1636 @@ +{ + "data": { + "id": "ember-4.11.0-Ember.NativeArray", + "type": "class", + "attributes": { + "name": "Ember.NativeArray", + "shortname": "Ember.NativeArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/array/index.ts", + "line": 2062, + "description": "

The NativeArray mixin contains the properties needed to make the native\nArray support MutableArray and all of its dependent APIs. Unless you\nhave EmberENV.EXTEND_PROTOTYPES or EmberENV.EXTEND_PROTOTYPES.Array set to\nfalse, this will be applied automatically. Otherwise you can apply the mixin\nat anytime by calling Ember.NativeArray.apply(Array.prototype).

\n", + "uses": [ + "Observable", + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1484, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1503, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1520, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1538, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1560, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1577, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1593, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1609, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1625, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1642, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1659, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1668, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1686, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1703, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1712, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1729, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.TargetActionSupport-e5956a21ca.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.TargetActionSupport-e5956a21ca.json new file mode 100644 index 000000000..47b58654e --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.TargetActionSupport-e5956a21ca.json @@ -0,0 +1,101 @@ +{ + "data": { + "id": "ember-4.11.0-Ember.TargetActionSupport", + "type": "class", + "attributes": { + "name": "Ember.TargetActionSupport", + "shortname": "Ember.TargetActionSupport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 11, + "description": "

Ember.TargetActionSupport is a mixin that can be included in a class\nto add a triggerAction method with semantics similar to the Handlebars\n{{action}} helper. In normal Ember usage, the {{action}} helper is\nusually the best choice. This mixin is most often useful when you are\ndoing more complex event handling in Components.

\n", + "extends": "Mixin", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 52, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/object/mixin.ts", + "line": 435, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "@ember/object/mixin", + "inherited": true, + "inheritedFrom": "Mixin" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.11.0-Mixin", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.Templates.components-121248e355.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.Templates.components-121248e355.json new file mode 100644 index 000000000..7fff8db9c --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.Templates.components-121248e355.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-4.11.0-Ember.Templates.components", + "type": "class", + "attributes": { + "name": "Ember.Templates.components", + "shortname": "Ember.Templates.components", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 66, + "description": "

The Input component lets you create an HTML <input> element.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value="987" />
\n
\n
\n \n

creates an <input> element with type="text" and value set to 987.

\n

Text field

\n

If no type argument is specified, a default of type 'text' is used.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Search:\n<Input @value={{this.searchWord}} />
\n
\n
\n \n

In this example, the initial value in the <input> will be set to the value of\nthis.searchWord. If the user changes the text, the value of this.searchWord will also be\nupdated.

\n

Actions

\n

The Input component takes a number of arguments with callbacks that are invoked in response to\nuser events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-down
  • \n
  • key-press
  • \n
  • key-up
  • \n
\n

These callbacks are passed to Input like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Starting with Ember Octane, we recommend using the {{on}} modifier to call actions\non specific events, such as the input event.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
<label for="input-name">Name:</label>\n<Input\n  @id="input-name"\n  @value={{this.name}}\n  {{on "input" this.validateName}}\n/>
\n
\n
\n \n

The event name (e.g. focusout, input, keydown) always follows the casing\nthat the HTML standard uses.

\n

<input> HTML Attributes to Avoid

\n

In most cases, if you want to pass an attribute to the underlying HTML <input> element, you\ncan pass the attribute directly, just like any other Ember component.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @type="text" size="10" />
\n
\n
\n \n

In this example, the size attribute will be applied to the underlying <input> element in the\noutputted HTML.

\n

However, there are a few attributes where you must use the @ version.

\n
    \n
  • @type: This argument is used to control which Ember component is used under the hood
  • \n
  • @value: The @value argument installs a two-way binding onto the element. If you wanted a\none-way binding, use <input> with the value property and the input event instead.
  • \n
  • @checked (for checkboxes): like @value, the @checked argument installs a two-way binding\nonto the element. If you wanted a one-way binding, use <input type="checkbox"> with\nchecked and the input event instead.
  • \n
\n

Checkbox

\n

To create an <input type="checkbox">:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Emberize Everything:\n<Input @type="checkbox" @checked={{this.isEmberized}} name="isEmberized" />
\n
\n
\n \n

This will bind the checked state of this checkbox to the value of isEmberized -- if either one\nchanges, it will be reflected in the other.

\n", + "itemtype": "method", + "name": "Input", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 42, + "description": "

The LinkTo component renders a link to the supplied routeName passing an optionally\nsupplied model to the route as its model context of the route. The block for LinkTo\nbecomes the contents of the rendered element:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

Disabling the LinkTo component

\n

The LinkTo component can be disabled by using the disabled argument. A disabled link\ndoesn't result in a transition when activated, and adds the disabled class to the <a>\nelement.

\n

(The class name to apply to the element can be overridden by using the disabledClass\nargument)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @disabled={{true}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

Handling href

\n

<LinkTo> will use your application's Router to fill the element's href property with a URL\nthat matches the path to the supplied routeName.

\n

Handling current route

\n

The LinkTo component will apply a CSS class name of 'active' when the application's current\nroute matches the supplied routeName. For example, if the application's current route is\n'photoGallery.recent', then the following invocation of LinkTo:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

will result in

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="active">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

The CSS class used for active classes can be customized by passing an activeClass argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent' @activeClass="current-url">\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="current-url">\n  Great Hamster Photos\n</a>
\n
\n
\n \n\n

If you need a link to be 'active' even when it doesn't match the current route, you can use the\ncurrent-when argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @current-when='photos'>\n  Photo Gallery\n</LinkTo>
\n
\n
\n \n

This may be helpful for keeping links active for:

\n
    \n
  • non-nested routes that are logically related
  • \n
  • some secondary menu approaches
  • \n
  • 'top navigation' with 'sub navigation' scenarios
  • \n
\n

A link will be active if current-when is true or the current\nroute is the route this link would transition to.

\n

To match multiple routes 'space-separate' the routes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='gallery' @current-when='photos drawings paintings'>\n  Art Gallery\n</LinkTo>
\n
\n
\n \n

Supplying a model

\n

An optional model argument can be used for routes whose\npaths contain dynamic segments. This argument will become\nthe model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", {path: "hamster-photos/:photo_id"});\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{this.aPhoto}}>\n  {{aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

Supplying multiple models

\n

For deep-linking to route paths that contain multiple\ndynamic segments, the models argument can be used.

\n

As the router transitions through the route path, each\nsupplied model argument will become the context for the\nroute with the dynamic segments:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() {\n    this.route("comment", {path: "comments/:comment_id"});\n  });\n});
\n
\n
\n \n

This argument will become the model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.comment' @models={{array this.aPhoto this.comment}}>\n  {{comment.body}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42/comments/718">\n  A+++ would snuggle again.\n</a>
\n
\n
\n \n

Supplying an explicit dynamic segment value

\n

If you don't have a model object available to pass to LinkTo,\nan optional string or integer argument can be passed for routes whose\npaths contain dynamic segments. This argument will become the value\nof the dynamic segment:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{aPhotoId}}>\n  {{this.aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

When transitioning into the linked route, the model hook will\nbe triggered with parameters including this passed identifier.

\n

Supplying query parameters

\n

If you need to add optional key-value pairs that appear to the right of the ? in a URL,\nyou can use the query argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @query={{hash page=1 per_page=20}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos?page=1&per_page=20">\n  Great Hamster Photos\n</a>
\n
\n
\n \n", + "itemtype": "method", + "name": "LinkTo", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 9, + "description": "

The Textarea component inserts a new instance of <textarea> tag into the template.

\n

The @value argument provides the content of the <textarea>.

\n

This template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value="A bunch of text" />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  A bunch of text\n</textarea>
\n
\n
\n \n

The @value argument is two-way bound. If the user types text into the textarea, the @value\nargument is updated. If the @value argument is updated, the text in the textarea is updated.

\n

In the following example, the writtenWords property on the component will be updated as the user\ntypes 'Lots of text' into the text area of their browser's window.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class WordEditorComponent extends Component {\n  @tracked writtenWords = "Lots of text that IS bound";\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{writtenWords}} />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  Lots of text that IS bound\n</textarea>
\n
\n
\n \n

If you wanted a one way binding, you could use the <textarea> element directly, and use the\nvalue DOM property and the input event.

\n

Actions

\n

The Textarea component takes a number of arguments with callbacks that are invoked in\nresponse to user events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-press
  • \n
\n

These callbacks are passed to Textarea like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Classic Invocation Syntax

\n

The Textarea component can also be invoked using curly braces, just like any other Ember\ncomponent.

\n

For example, this is an invocation using angle-bracket notation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

You could accomplish the same thing using classic invocation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{textarea value=this.searchWord enter=this.query}}
\n
\n
\n \n

The main difference is that angle-bracket invocation supports any HTML attribute using HTML\nattribute syntax, because attributes and arguments have different syntax when using angle-bracket\ninvocation. Curly brace invocation, on the other hand, only has a single syntax for arguments,\nand components must manually map attributes onto component arguments.

\n

When using classic invocation with {{textarea}}, only the following attributes are mapped onto\narguments:

\n
    \n
  • rows
  • \n
  • cols
  • \n
  • name
  • \n
  • selectionEnd
  • \n
  • selectionStart
  • \n
  • autocomplete
  • \n
  • wrap
  • \n
  • lang
  • \n
  • dir
  • \n
  • value
  • \n
\n

Classic layout and layoutName properties

\n

Because HTML textarea elements do not contain inner HTML the layout and\nlayoutName properties will not be applied.

\n", + "itemtype": "method", + "name": "Textarea", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.Templates.helpers-275528c99e.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.Templates.helpers-275528c99e.json new file mode 100644 index 000000000..e345a8a1d --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.Templates.helpers-275528c99e.json @@ -0,0 +1,508 @@ +{ + "data": { + "id": "ember-4.11.0-Ember.Templates.helpers", + "type": "class", + "attributes": { + "name": "Ember.Templates.helpers", + "shortname": "Ember.Templates.helpers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 86, + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 45, + "description": "

See Ember.Templates.components.Input.

\n", + "itemtype": "method", + "name": "input", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 254, + "description": "

See Ember.Templates.components.LinkTo.

\n", + "itemtype": "method", + "name": "link-to", + "see": [ + "{Ember.Templates.components.LinkTo}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 122, + "description": "

See Ember.Templates.components.Textarea.

\n", + "itemtype": "method", + "name": "textarea", + "see": [ + "{Ember.Templates.components.Textarea}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/action.ts", + "line": 18, + "description": "

The {{action}} helper provides a way to pass triggers for behavior (usually\njust a function) between components, and into components from controllers.

\n

Passing functions with the action helper

\n

There are three contexts an action helper can be used in. The first two\ncontexts to discuss are attribute context, and Handlebars value context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>\n{{! Examples of Handlebars value context }}\n{{input on-input=(action "save")}}\n{{yield (action "refreshData") andAnotherParam}}
\n
\n
\n \n

In these contexts,\nthe helper is called a "closure action" helper. Its behavior is simple:\nIf passed a function name, read that function off the actions property\nof the current context. Once that function is read, or immediately if a function was\npassed, create a closure over that function and any arguments.\nThe resulting value of an action helper used this way is simply a function.

\n

For example, in the attribute context:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>
\n
\n
\n \n

The resulting template render logic would be:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
var div = document.createElement('div');\nvar actionFunction = (function(context){\n  return function() {\n    return context.actions.save.apply(context, arguments);\n  };\n})(context);\ndiv.onclick = actionFunction;
\n
\n
\n \n

Thus when the div is clicked, the action on that context is called.\nBecause the actionFunction is just a function, closure actions can be\npassed between components and still execute in the correct context.

\n

Here is an example action handler on a component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  save() {\n    this.model.save();\n  }\n}
\n
\n
\n \n

Actions are always looked up on the actions property of the current context.\nThis avoids collisions in the naming of common actions, such as destroy.\nTwo options can be passed to the action helper when it is used in this way.

\n
    \n
  • target=someProperty will look to someProperty instead of the current\ncontext for the actions hash. This can be useful when targeting a\nservice for actions.
  • \n
  • value="target.value" will read the path target.value off the first\nargument to the action when it is called and rewrite the first argument\nto be that value. This is useful when attaching actions to event listeners.
  • \n
\n

Invoking an action

\n

Closure actions curry both their scope and any arguments. When invoked, any\nadditional arguments are added to the already curried list.\nActions are presented in JavaScript as callbacks, and are\ninvoked like any other JavaScript function.

\n

For example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.hbs
1\n
{{input on-input=(action (action 'setName' @model) value="target.value")}}
\n
\n
\n \n

The first argument (@model) was curried over, and the run-time argument (event)\nbecomes a second argument. Action calls can be nested this way because each simply\nreturns a function. Any function can be passed to the {{action}} helper, including\nother actions.

\n

Actions invoked with sendAction have the same currying behavior as demonstrated\nwith on-input above. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyInput @submit={{action 'setName' @model}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-input submit=(action 'setName' @model)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    // Note that model is not passed, it was curried in the template\n    this.submit('bob');\n  }\n});
\n
\n
\n \n

Attaching actions to DOM elements

\n

The third context of the {{action}} helper can be called "element space".\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of element space }}\n<div {{action "save"}}></div>
\n
\n
\n \n

Used this way, the {{action}} helper provides a useful shortcut for\nregistering an HTML element in a template for a single DOM event and\nforwarding that interaction to the template's context (controller or component).\nIf the context of a template is a controller, actions used this way will\nbubble to routes when the controller does not implement the specified action.\nOnce an action hits a route, it will bubble through the route hierarchy.

\n

Event Propagation

\n

{{action}} helpers called in element space can control event bubbling. Note\nthat the closure style actions cannot.

\n

Events triggered through the action helper will automatically have\n.preventDefault() called on them. You do not need to do so in your event\nhandlers. If you need to allow event propagation (to handle file inputs for\nexample) you can supply the preventDefault=false option to the {{action}} helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<div {{action "sayHello" preventDefault=false}}>\n  <input type="file" />\n  <input type="checkbox" />\n</div>
\n
\n
\n \n

To disable bubbling, pass bubbles=false to the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<button {{action 'edit' post bubbles=false}}>Edit</button>
\n
\n
\n \n

To disable bubbling with closure style actions you must create your own\nwrapper helper that makes use of event.stopPropagation():

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div onclick={{disable-bubbling (action "sayHello")}}>Hello</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
bubbling.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { helper } from '@ember/component/helper';\n\nexport function disableBubbling([action]) {\n  return function(event) {\n    event.stopPropagation();\n    return action(event);\n  };\n}\nexport default helper(disableBubbling);
\n
\n
\n \n

If you need the default handler to trigger you should either register your\nown event handler, or use event methods on your view class. See\n"Responding to Browser Events"\nin the documentation for Component for more information.

\n

Specifying DOM event type

\n

{{action}} helpers called in element space can specify an event type.\nBy default the {{action}} helper registers for DOM click events. You can\nsupply an on option to the helper to specify a different DOM event name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" on="doubleClick"}}>\n  click me\n</div>
\n
\n
\n \n

See "Event Names" for a list of\nacceptable DOM event names.

\n

Specifying whitelisted modifier keys

\n

{{action}} helpers called in element space can specify modifier keys.\nBy default the {{action}} helper will ignore click events with pressed modifier\nkeys. You can supply an allowedKeys option to specify which keys should not be ignored.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="alt"}}>\n  click me\n</div>
\n
\n
\n \n

This way the action will fire when clicking with the alt key pressed down.\nAlternatively, supply "any" to the allowedKeys option to accept any combination of modifier keys.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="any"}}>\n  click me with any key pressed\n</div>
\n
\n
\n \n

Specifying a Target

\n

A target option can be provided to the helper to change\nwhich object will receive the method call. This option must be a path\nto an object, accessible in the current context:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<div {{action "anActionName" target=someService}}>\n  click me\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n
import Controller from '@ember/controller';\nimport { service } from '@ember/service';\n\nexport default class extends Controller {\n  @service someService;\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "action", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/array.ts", + "line": 5, + "description": "

Use the {{array}} helper to create an array to pass as an option to your\ncomponents.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<MyComponent @people={{array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson}}\n/>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{my-component people=(array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson)\n}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Tom Dale', 'Yehuda Katz', this.get('myOtherPerson')]
\n
\n
\n \n

Where the 3rd item in the array is bound to updates of the myOtherPerson property.

\n", + "itemtype": "method", + "name": "array", + "params": [ + { + "name": "options", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "Array", + "type": "Array" + }, + "since": "3.8.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/component.ts", + "line": 5, + "description": "

The {{component}} helper lets you add instances of Component to a\ntemplate. See Component for\nadditional information on how a Component functions.\n{{component}}'s primary use is for cases where you want to dynamically\nchange which type of component is rendered as the state of your application\nchanges. This helper has three modes: inline, block, and nested.

\n

Inline Form

\n

Given the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/application.hbs
1\n
{{component this.infographicComponentName}}
\n
\n
\n \n

And the following application code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Controller from '@ember/controller';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

The live-updating-chart component will be appended when isMarketOpen is\ntrue, and the market-close-summary component will be appended when\nisMarketOpen is false. If the value changes while the app is running,\nthe component will be automatically swapped out accordingly.\nNote: You should not use this helper when you are consistently rendering the same\ncomponent. In that case, use standard component syntax, for example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LiveUpdatingChart />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{live-updating-chart}}
\n
\n
\n \n

Block Form

\n

Using the block form of this helper is similar to using the block form\nof a component. Given the following application template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
{{#component this.infographicComponentName}}\n  Last update: {{this.lastUpdateTimestamp}}\n{{/component}}
\n
\n
\n \n

The following controller code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Controller from '@ember/controller';\nimport { computed } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get lastUpdateTimestamp() {\n    return new Date();\n  }\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

And the following component template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
chart.hbs
1\n2\n
{{! chart }}\n{{yield}}
\n
\n
\n \n

The Last Update: {{this.lastUpdateTimestamp}} will be rendered in place of the {{yield}}.

\n

Nested Usage

\n

The component helper can be used to package a component path with initial attrs.\nThe included attrs can then be merged during the final invocation.\nFor example, given a person-form component with the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.hbs
1\n2\n3\n
{{yield (hash\n  nameInput=(component "my-input-component" value=@model.name placeholder="First Name")\n)}}
\n
\n
\n \n

When yielding the component via the hash helper, the component is invoked directly.\nSee the following snippet:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonForm as |form|>\n  <form.nameInput @placeholder="Username" />\n</PersonForm>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-form as |form|}}\n  {{form.nameInput placeholder="Username"}}\n{{/person-form}}
\n
\n
\n \n

Which outputs an input whose value is already bound to model.name and placeholder\nis "Username".

\n

When yielding the component without the hash helper use the component helper.\nFor example, below is a full-name component template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{yield (component "my-input-component" value=@model.name placeholder="Name")}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<FullName as |field|>\n  {{component field placeholder="Full name"}}\n</FullName>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#full-name as |field|}}\n  {{component field placeholder="Full name"}}\n{{/full-name}}
\n
\n
\n \n", + "itemtype": "method", + "name": "component", + "since": "1.11.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/concat.ts", + "line": 5, + "description": "

Concatenates the given arguments into a string.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{some-component name=(concat firstName " " lastName)}}\n\n{{! would pass name="<first name value> <last name value>" to the component}}
\n
\n
\n \n

or for angle bracket invocation, you actually don't need concat at all.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @name="{{firstName}} {{lastName}}" />
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "concat", + "since": "1.13.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 13, + "description": "

The {{#each}} helper loops over elements in a collection. It is an extension\nof the base Handlebars {{#each}} helper.

\n

The default behavior of {{#each}} is to yield its inner block once for every\nitem in an array passing the item as the first block parameter.

\n

Assuming the @developers argument contains this array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
[{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }];
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

The same rules apply to arrays of primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Yehuda', 'Tom', 'Paul']
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developerNames as |name|}}\n    <li>Hello, {{name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

During iteration, the index of each item in the array is provided as a second block\nparameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person index|}}\n    <li>Hello, {{person.name}}! You're number {{index}} in line</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

Specifying Keys

\n

In order to improve rendering speed, Ember will try to reuse the DOM elements\nwhere possible. Specifically, if the same item is present in the array both\nbefore and after the change, its DOM output will be reused.

\n

The key option is used to tell Ember how to determine if the items in the\narray being iterated over with {{#each}} has changed between renders. By\ndefault the item's object identity is used.

\n

This is usually sufficient, so in most cases, the key option is simply not\nneeded. However, in some rare cases, the objects' identities may change even\nthough they represent the same underlying data.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
people.map(person => {\n  return { ...person, type: 'developer' };\n});
\n
\n
\n \n

In this case, each time the people array is map-ed over, it will produce\nan new array with completely different objects between renders. In these cases,\nyou can help Ember determine how these objects related to each other with the\nkey option:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers key="name" as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

By doing so, Ember will use the value of the property specified (person.name\nin the example) to find a "match" from the previous render. That is, if Ember\nhas previously seen an object from the @developers array with a matching\nname, its DOM elements will be re-used.

\n

There are two special values for key:

\n
    \n
  • @index - The index of the item in the array.
  • \n
  • @identity - The item in the array itself.
  • \n
\n

{{else}} condition

\n

{{#each}} can have a matching {{else}}. The contents of this block will render\nif the collection is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<ul>\n  {{#each @developers as |person|}}\n    <li>{{person.name}} is available!</li>\n  {{else}}\n    <li>Sorry, nobody is available for this task.</li>\n  {{/each}}\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 124, + "description": "

The {{each-in}} helper loops over properties on an object.

\n

For example, given this component definition:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    "name": "Shelly Sails",\n    "age": 42\n  };\n}
\n
\n
\n \n

This template would display all properties on the developer\nobject in a list:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.hbs
1\n2\n3\n4\n5\n
<ul>\n  {{#each-in this.developer as |key value|}}\n    <li>{{key}}: {{value}}</li>\n  {{/each-in}}\n</ul>
\n
\n
\n \n

Outputting their name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<ul>\n  <li>name: Shelly Sails</li>\n  <li>age: 42</li>\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each-in", + "access": "public", + "tagname": "", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/fn.ts", + "line": 5, + "description": "

The fn helper allows you to ensure a function that you are passing off\nto another component, helper, or modifier has access to arguments that are\navailable in the template.

\n

For example, if you have an each helper looping over a number of items, you\nmay need to pass a function that expects to receive the item as an argument\nto a component invoked within the loop. Here's how you could use the fn\nhelper to pass both the function and its arguments together:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
listing.hbs
1\n2\n3\n
{{#each @items as |item|}}\n<DisplayItem @item=item @select={{fn this.handleSelected item}} />\n{{/each}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class ItemsList extends Component {\n  @action\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this case the display-item component will receive a normal function\nthat it can invoke. When it invokes the function, the handleSelected\nfunction will receive the item and any arguments passed, thanks to the\nfn helper.

\n

Let's take look at what that means in a couple circumstances:

\n
    \n
  • When invoked as this.args.select() the handleSelected function will\nreceive the item from the loop as its first and only argument.
  • \n
  • When invoked as this.args.select('foo') the handleSelected function\nwill receive the item from the loop as its first argument and the\nstring 'foo' as its second argument.
  • \n
\n

In the example above, we used @action to ensure that handleSelected is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class ItemsList extends Component {\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when handleSelected is invoked inside the display-item\ncomponent, it will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into fn!

\n

See also partial application.

\n", + "itemtype": "method", + "name": "fn", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/get.ts", + "line": 5, + "description": "

Dynamically look up a property on an object or an element in an array.\nThe second argument to {{get}} should have a string or number value,\nalthough it can be bound.

\n

For example, these two usages are equivalent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{this.developer.name}}\n{{get this.developer "name"}}
\n
\n
\n \n

If there were several facts about a person, the {{get}} helper can dynamically\npick one:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<DeveloperDetail @factName="language" />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.developer @factName}}
\n
\n
\n \n

For a more complex example, this template would allow the user to switch\nbetween showing the user's name and preferred coding language with a click:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n\n  @tracked currentFact = 'name'\n\n  @action\n  showFact(fact) {\n    this.currentFact = fact;\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
{{get this.developer this.currentFact}}\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

The {{get}} helper can also respect mutable values itself. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
<Input @value={{mut (get this.person this.currentFact)}} />\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

Would allow the user to swap what fact is being displayed, and also edit\nthat fact via a two-way mutable binding.

\n

The {{get}} helper can also be used for array element access via index.\nThis would display the value of the first element in the array this.names:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names 0}}
\n
\n
\n \n

Array element access also works with a dynamic second argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names @index}}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "get", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/hash.ts", + "line": 5, + "description": "

Use the {{hash}} helper to create a hash to pass as an option to your\ncomponents. This is specially useful for contextual components where you can\njust yield a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{yield (hash\n   name='Sarah'\n   title=office\n)}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ name: 'Sarah', title: this.get('office') }
\n
\n
\n \n

Where the title is bound to updates of the office property.

\n

Note that the hash is an empty object with no prototype chain, therefore\ncommon methods like toString are not available in the resulting hash.\nIf you need to use such a method, you can use the call or apply\napproach:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
function toString(obj) {\n  return Object.prototype.toString.apply(obj);\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "Hash", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/helper.ts", + "line": 5, + "description": "

Use the {{helper}} helper to create contextual helper so\nthat it can be passed around as first-class values in templates.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let (helper "join-words" "foo" "bar" separator=" ") as |foo-bar|}}\n\n  {{!-- this is equivalent to invoking `{{join-words "foo" "bar" separator=" "}}` --}}\n  {{foo-bar}}\n\n  {{!-- this will pass the helper itself into the component, instead of invoking it now --}}\n  <MyComponent @helper={{helper foo-bar "baz"}} />\n\n  {{!-- this will yield the helper itself ("contextual helper"), instead of invoking it now --}}\n  {{yield foo-bar}}\n{{/let}}
\n
\n
\n \n

Arguments

\n

The {{helper}} helper works similarly to the {{component}} and\n{{modifier}} helper:

\n
    \n
  • When passed a string (e.g. (helper "foo")) as the first argument,\nit will produce an opaque, internal "helper definition" object\nthat can be passed around and invoked elsewhere.

    \n
  • \n
  • Any additional positional and/or named arguments (a.k.a. params and hash)\nwill be stored ("curried") inside the definition object, such that, when invoked,\nthese arguments will be passed along to the referenced helper.

    \n
  • \n
\n", + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "3.27.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 5, + "description": "

The if helper allows you to conditionally render one of two branches,\ndepending on the "truthiness" of a property.\nFor example the following values are all falsey: false, undefined, null, "", 0, NaN or an empty array.

\n

This helper has two forms, block and inline.

\n

Block form

\n

You can use the block form of if to conditionally render a section of the template.

\n

To use it, pass the conditional value to the if helper,\nusing the block form to wrap the section of template you want to conditionally render.\nLike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n
{{! will not render because greeting is undefined}}\n{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{/if}}
\n
\n
\n \n

You can also define what to show if the property is falsey by using\nthe else helper.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n
{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{else}}\n  No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

You are also able to combine else and if helpers to create more complex\nconditional logic.

\n

For the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if @isRaining}}\n Yes, grab an umbrella!\n{{else if @isCold}}\n Grab a coat, it's chilly!\n{{else}}\n No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

If you call it by saying isCold is true:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather @isCold={{true}} />
\n
\n
\n \n

Then Grab a coat, it's chilly! will be rendered.

\n

Inline form

\n

The inline if helper conditionally renders a single property or string.

\n

In this form, the if helper receives three arguments, the conditional value,\nthe value to render when truthy, and the value to render when falsey.

\n

For example, if useLongGreeting is truthy, the following:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{true}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{if @useLongGreeting "Hello" "Hi"}} Alex
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hello Alex
\n
\n
\n \n

One detail to keep in mind is that both branches of the if helper will be evaluated,\nso if you have {{if condition "foo" (expensive-operation "bar"),\nexpensive-operation will always calculate.

\n", + "itemtype": "method", + "name": "if", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 97, + "description": "

The unless helper is the inverse of the if helper. It displays if a value\nis falsey ("not true" or "is false"). Example values that will display with\nunless: false, undefined, null, "", 0, NaN or an empty array.

\n

Inline form

\n

The inline unless helper conditionally renders a single property or string.\nThis helper acts like a ternary operator. If the first property is falsy,\nthe second argument will be displayed, otherwise, the third argument will be\ndisplayed

\n

For example, if you pass a falsey useLongGreeting to the Greeting component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{false}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{unless @useLongGreeting "Hi" "Hello"}} Ben
\n
\n
\n \n

Then it will display:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hi Ben
\n
\n
\n \n

Block form

\n

Like the if helper, the unless helper also has a block form.

\n

The following will not render anything:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n2\n3\n
{{#unless @greeting}}\n  No greeting was found. Why not set one?\n{{/unless}}
\n
\n
\n \n

You can also use an else helper with the unless block. The\nelse will display if the value is truthy.

\n

If you have the following component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
in.hbs
1\n2\n3\n4\n5\n
{{#unless @userData}}\n  Please login.\n{{else}}\n  Welcome back!\n{{/unless}}
\n
\n
\n \n

Calling it with a truthy userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{hash username="Zoey"}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Welcome back!
\n
\n
\n \n

and calling it with a falsey userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{false}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Please login.
\n
\n
\n \n", + "itemtype": "method", + "name": "unless", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/log.ts", + "line": 5, + "description": "

log allows you to output the value of variables in the current rendering\ncontext. log also accepts primitive types such as strings or numbers.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{log "myVariable:" myVariable }}
\n
\n
\n \n", + "itemtype": "method", + "name": "log", + "params": [ + { + "name": "params", + "description": "", + "type": "Array" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/modifier.ts", + "line": 5, + "description": "

Use the {{modifier}} helper to create contextual modifier so\nthat it can be passed around as first-class values in templates.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let (modifier "click-outside" click=this.submit) as |on-click-outside|}}\n\n  {{!-- this is equivalent to `<MyComponent {{click-outside click=this.submit}} />` --}}\n  <MyComponent {{on-click-outside}} />\n\n  {{!-- this will pass the modifier itself into the component, instead of invoking it now --}}\n  <MyComponent @modifier={{modifier on-click-outside "extra" "args"}} />\n\n  {{!-- this will yield the modifier itself ("contextual modifier"), instead of invoking it now --}}\n  {{yield on-click-outside}}\n{{/let}}
\n
\n
\n \n

Arguments

\n

The {{modifier}} helper works similarly to the {{component}} and\n{{helper}} helper:

\n
    \n
  • When passed a string (e.g. (modifier "foo")) as the first argument,\nit will produce an opaque, internal "modifier definition" object\nthat can be passed around and invoked elsewhere.

    \n
  • \n
  • Any additional positional and/or named arguments (a.k.a. params and hash)\nwill be stored ("curried") inside the definition object, such that, when invoked,\nthese arguments will be passed along to the referenced modifier.

    \n
  • \n
\n", + "itemtype": "method", + "name": "modifier", + "access": "public", + "tagname": "", + "since": "3.27.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/mut.ts", + "line": 9, + "description": "

The mut helper lets you clearly specify that a child Component can update the\n(mutable) value passed to it, which will change the value of the parent component.

\n

To specify that a parameter is mutable, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{fn (mut totalClicks)}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(mut totalClicks)}}
\n
\n
\n \n

The child Component can then modify the parent's value just by modifying its own\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

Note that for curly components ({{my-component}}) the bindings are already mutable,\nmaking the mut unnecessary.

\n

Additionally, the mut helper can be combined with the fn helper to\nmutate a value. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=totalClicks click-count-change=(fn (mut totalClicks))}}
\n
\n
\n \n

The child Component would invoke the function with the new click value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.get('click-count-change')(this.get('childClickCount') + 1);\n  }\n});
\n
\n
\n \n

The mut helper changes the totalClicks value to what was provided as the fn argument.

\n

The mut helper, when used with fn, will return a function that\nsets the value passed to mut to its first argument. As an example, we can create a\nbutton that increments a value passing the value directly to the fn:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{! inc helper is not provided by Ember }}\n<button onclick={{fn (mut count) (inc count)}}>\n  Increment count\n</button>
\n
\n
\n \n", + "itemtype": "method", + "name": "mut", + "params": [ + { + "name": "attr", + "description": "the \"two-way\" attribute that can be modified.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/page-title.ts", + "line": 5, + "description": "

page-title allows you to set the title of any page in your application and\nappend additional titles for each route. For complete documentation, see\nhttps://github.com/ember-cli/ember-page-title.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{page-title "My Page Title" }}
\n
\n
\n \n", + "itemtype": "method", + "name": "page-title", + "params": [ + { + "name": "param", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/readonly.ts", + "line": 9, + "description": "

The readonly helper let's you specify that a binding is one-way only,\ninstead of two-way.\nWhen you pass a readonly binding from an outer context (e.g. parent component),\nto to an inner context (e.g. child component), you are saying that changing that\nproperty in the inner context does not change the value in the outer context.

\n

To specify that a binding is read-only, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n
export default Component.extend({\n  totalClicks: 3\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} // -> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Now, when you update childClickCount:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n
export default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

The value updates in the child component, but not the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClickCount}} //-> 4
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Objects and Arrays

\n

When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string),\nonly the reference to the object is protected using the readonly helper.\nThis means that you can change properties of the object both on the parent component, as well as the child component.\nThe readonly binding behaves similar to the const keyword in JavaScript.

\n

Let's look at an example:

\n

First let's set up the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  clicks: null,\n\n  init() {\n    this._super(...arguments);\n    this.set('clicks', { total: 3 });\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n

Now, if you update the total property of childClicks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    this.get('clicks').incrementProperty('total');\n  }\n});
\n
\n
\n \n

You will see the following happen:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClicks.total}} //-> 4
\n
\n
\n \n", + "itemtype": "method", + "name": "readonly", + "params": [ + { + "name": "attr", + "description": "the read-only attribute.", + "type": "Object", + "optional": true + } + ], + "access": "private", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unbound.ts", + "line": 10, + "description": "

The {{unbound}} helper disconnects the one-way binding of a property,\nessentially freezing its value at the moment of rendering. For example,\nin this example the display of the variable name will not change even\nif it is set with a new value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{unbound this.name}}
\n
\n
\n \n

Like any helper, the unbound helper can accept a nested helper expression.\nThis allows for custom helpers to be rendered unbound:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{unbound (some-custom-helper)}}\n{{unbound (capitalize this.name)}}\n{{! You can use any helper, including unbound, in a nested expression }}\n{{capitalize (unbound this.name)}}
\n
\n
\n \n

The unbound helper only accepts a single argument, and it return an\nunbound value.

\n", + "itemtype": "method", + "name": "unbound", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts", + "line": 5, + "description": "

Use the {{unique-id}} helper to generate a unique ID string suitable for use as\nan ID attribute in the DOM.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id={{unique-id}} type="email" />
\n
\n
\n \n

Each 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#let (unique-id) as |emailId|}}\n  <label for={{emailId}}>Email address</label>\n  <input id={{emailId}} type="email" />\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "unique-id", + "since": "4.4.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/modifiers/on.ts", + "line": 5, + "description": "

The {{on}} modifier lets you easily add event listeners (it uses\nEventTarget.addEventListener\ninternally).

\n

For example, if you'd like to run a function on your component when a <button>\nin the components template is clicked you might do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' this.saveLike}}>Like this post!</button>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class LikePostComponent extends Component {\n  @action\n  saveLike() {\n    // someone likes your post!\n    // better send a request off to your server...\n  }\n}
\n
\n
\n \n

Arguments

\n

{{on}} accepts two positional arguments, and a few named arguments.

\n

The positional arguments are:

\n
    \n
  • event -- the name to use when calling addEventListener
  • \n
  • callback -- the function to be passed to addEventListener
  • \n
\n

The named arguments are:

\n
    \n
  • capture -- a true value indicates that events of this type will be dispatched\nto the registered listener before being dispatched to any EventTarget beneath it\nin the DOM tree.
  • \n
  • once -- indicates that the listener should be invoked at most once after being\nadded. If true, the listener would be automatically removed when invoked.
  • \n
  • passive -- if true, indicates that the function specified by listener will never\ncall preventDefault(). If a passive listener does call preventDefault(), the user\nagent will do nothing other than generate a console warning. See\nImproving scrolling performance with passive listeners\nto learn more.
  • \n
\n

The callback function passed to {{on}} will receive any arguments that are passed\nto the event handler. Most commonly this would be the event itself.

\n

If you would like to pass additional arguments to the function you should use\nthe {{fn}} helper.

\n

For example, in our example case above if you'd like to pass in the post that\nwas being liked when the button is clicked you could do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' (fn this.saveLike @post)}}>Like this post!</button>
\n
\n
\n \n

In this case, the saveLike function will receive two arguments: the click event\nand the value of @post.

\n

Function Context

\n

In the example above, we used @action to ensure that likePost is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class LikePostComponent extends Component {\n  saveLike() {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when the button is clicked saveLike will be invoked,\nit will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into on!

\n", + "itemtype": "method", + "name": "on", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/in-element.ts", + "line": 5, + "description": "

The in-element helper renders its block content outside of the regular flow,\ninto a DOM element given by its destinationElement positional argument.

\n

Common use cases - often referred to as "portals" or "wormholes" - are rendering\ndropdowns, modals or tooltips close to the root of the page to bypass CSS overflow\nrules, or to render content to parts of the page that are outside of the control\nof the Ember app itself (e.g. embedded into a static or server rendered HTML page).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#in-element this.destinationElement}}\n  <div>Some content</div>\n{{/in-element}}
\n
\n
\n \n

Arguments

\n

{{in-element}} requires a single positional argument:

\n
    \n
  • destinationElement -- the DOM element to render into. It must exist at the time\nof rendering.
  • \n
\n

It also supports an optional named argument:

\n
    \n
  • insertBefore -- by default the DOM element's content is replaced when used as\ndestinationElement. Passing null to insertBefore changes the behaviour to\nappend the block content to the end of any existing content. Any other value than\nnull is currently not supported.

    \n

    For example:

    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    1\n2\n3\n
    {{#in-element this.destinationElement insertBefore=null}}\n  <div>Some content</div>\n{{/in-element}}
    \n
    \n
    \n \n
  • \n
\n", + "itemtype": "method", + "name": "in-element", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/let.ts", + "line": 5, + "description": "

The let helper receives one or more positional arguments and yields\nthem out as block params.

\n

This allows the developer to introduce shorter names for certain computations\nin the template.

\n

This is especially useful if you are passing properties to a component\nthat receives a lot of options and you want to clean up the invocation.

\n

For the following example, the template receives a post object with\ncontent and title properties.

\n

We are going to call the my-post component, passing a title which is\nthe title of the post suffixed with the name of the blog, the content\nof the post, and a series of options defined in-place.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n    (concat post.title ' | The Ember.js Blog')\n    post.content\n    (hash\n      theme="high-contrast"\n      enableComments=true\n    )\n    as |title content options|\n}}\n  <MyPost @title={{title}} @content={{content}} @options={{options}} />\n{{/let}}
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n  (concat post.title ' | The Ember.js Blog')\n  post.content\n  (hash\n    theme="high-contrast"\n    enableComments=true\n  )\n  as |title content options|\n}}\n{{my-post title=title content=content options=options}}\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "let", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/mount.ts", + "line": 16, + "description": "

The {{mount}} helper lets you embed a routeless engine in a template.\nMounting an engine will cause an instance to be booted and its application\ntemplate to be rendered.

\n

For example, the following template mounts the ember-chat engine:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! application.hbs }}\n{{mount "ember-chat"}}
\n
\n
\n \n

Additionally, you can also pass in a model argument that will be\nset as the engines model. This can be an existing object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div>\n  {{mount 'admin' model=userSettings}}\n</div>
\n
\n
\n \n

Or an inline hash, and you can even pass components:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>\n  <h1>Application template!</h1>\n  {{mount 'admin' model=(hash\n      title='Secret Admin'\n      signInButton=(component 'sign-in-button')\n  )}}\n</div>
\n
\n
\n \n", + "itemtype": "method", + "name": "mount", + "params": [ + { + "name": "name", + "description": "Name of the engine to mount.", + "type": "String" + }, + { + "name": "model", + "description": "Object that will be set as\n the model of the engine.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/outlet.ts", + "line": 22, + "description": "

The {{outlet}} helper lets you specify where a child route will render in\nyour template. An important use of the {{outlet}} helper is in your\napplication's application.hbs file:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n7\n8\n
<MyHeader />\n\n<div class="my-dynamic-content">\n  <!-- this content will change based on the current route, which depends on the current URL -->\n  {{outlet}}\n</div>\n\n<MyFooter />
\n
\n
\n \n

See the routing guide for more\ninformation on how your route interacts with the {{outlet}} helper.\nNote: Your content will not render if there isn't an {{outlet}} for it.

\n", + "itemtype": "method", + "name": "outlet", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 91, + "description": "

{{yield}} denotes an area of a template that will be rendered inside\nof another template.

\n

Use with Component

\n

When designing components {{yield}} is used to denote where, inside the component's\ntemplate, an optional block passed to the component should render:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<LabeledTextfield @value={{@model.name}}>\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<label>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n

Additionally you can yield properties into the context for use by the consumer:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n
<LabeledTextfield @value={{@model.validation}} @validator={{this.firstNameValidator}} as |validationError|>\n  {{#if validationError}}\n    <p class="error">{{validationError}}</p>\n  {{/if}}\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield this.validationError}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<label>\n  <p class="error">First Name must be at least 3 characters long.</p>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n

yield can also be used with the hash helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n
<DateRanges @value={{@model.date}} as |range|>\n  Start date: {{range.start}}\n  End date: {{range.end}}\n</DateRanges>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
ranges.hbs
1\n2\n3\n
<div>\n  {{yield (hash start=@value.start end=@value.end)}}\n</div>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<div>\n  Start date: July 1st\n  End date: July 30th\n</div>
\n
\n
\n \n

Multiple values can be yielded as block params:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |title subtitle body|>\n  <h1>{{title}}</h1>\n  <h2>{{subtitle}}</h2>\n  {{body}}\n</Banner>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner.hbs
1\n2\n3\n
<div>\n  {{yield "Hello title" "hello subtitle" "body text"}}\n</div>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h1>Hello title</h1>\n  <h2>hello subtitle</h2>\n  body text\n</div>
\n
\n
\n \n

However, it is preferred to use the hash helper, as this can prevent breaking changes to your component and also simplify the api for the component.

\n

Multiple components can be yielded with the hash and component helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |banner|>\n  <banner.Title>Banner title</banner.Title>\n  <banner.Subtitle>Banner subtitle</banner.Subtitle>\n  <banner.Body>A load of body text</banner.Body>\n</Banner>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Title from './banner/title';\nimport Subtitle from './banner/subtitle';\nimport Body from './banner/body';\n\nexport default class Banner extends Component {\n  Title = Title;\n  Subtitle = Subtitle;\n  Body = Body;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner.hbs
1\n2\n3\n4\n5\n6\n7\n
<div>\n  {{yield (hash\n    Title=this.Title\n    Subtitle=this.Subtitle\n    Body=(component this.Body defaultArg="some value")\n  )}}\n</div>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h1>Banner title</h1>\n  <h2>Banner subtitle</h2>\n  A load of body text\n</div>
\n
\n
\n \n

A benefit of using this pattern is that the user of the component can change the order the components are displayed.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |banner|>\n  <banner.Subtitle>Banner subtitle</banner.Subtitle>\n  <banner.Title>Banner title</banner.Title>\n  <banner.Body>A load of body text</banner.Body>\n</Banner>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h2>Banner subtitle</h2>\n  <h1>Banner title</h1>\n  A load of body text\n</div>
\n
\n
\n \n

Another benefit to using yield with the hash and component helper\nis you can pass attributes and arguments to these components:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |banner|>\n  <banner.Subtitle class="mb-1">Banner subtitle</banner.Subtitle>\n  <banner.Title @variant="loud">Banner title</banner.Title>\n  <banner.Body>A load of body text</banner.Body>\n</Banner>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner/subtitle.hbs
1\n2\n3\n4\n
{{!-- note the use of ..attributes --}}\n<h2 ...attributes>\n  {{yield}}\n</h2>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner/title.hbs
1\n2\n3\n4\n5\n
{{#if (eq @variant "loud")}}\n    <h1 class="loud">{{yield}}</h1>\n{{else}}\n    <h1 class="quiet">{{yield}}</h1>\n{{/if}}
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h2 class="mb-1">Banner subtitle</h2>\n  <h1 class="loud">Banner title</h1>\n  A load of body text\n</div>
\n
\n
\n \n", + "itemtype": "method", + "name": "yield", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "return": { + "description": "HTML string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 303, + "description": "

{{(has-block)}} indicates if the component was invoked with a block.

\n

This component is invoked with a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component}}
\n
\n
\n \n

Using angle bracket invocation, this looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent>Hi Jen!</MyComponent> {{! with a block}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent/> {{! without a block}}
\n
\n
\n \n

This is useful when you want to create a component that can optionally take a block\nand then render a default template when it is not invoked with a block.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n
{{#if (has-block)}}\n  Welcome {{yield}}, we are happy you're here!\n{{else}}\n  Hey you! You're great!\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with a block", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 348, + "description": "

{{(has-block-params)}} indicates if the component was invoked with block params.

\n

This component is invoked with block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component as |favoriteFlavor|}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jenn!\n{{/my-component}}
\n
\n
\n \n

With angle bracket syntax, block params look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent as |favoriteFlavor|>\nHi Jen!\n</MyComponent>
\n
\n
\n \n

And without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent>\n  Hi Jen!\n</MyComponent>
\n
\n
\n \n

This is useful when you want to create a component that can render itself\ndifferently when it is not invoked with block params.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if (has-block-params)}}\n  Welcome {{yield this.favoriteFlavor}}, we're happy you're here and hope you\n  enjoy your favorite ice cream flavor.\n{{else}}\n  Welcome {{yield}}, we're happy you're here, but we're unsure what\n  flavor ice cream you would enjoy.\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block-params", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with block params", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 403, + "description": "

Execute the debugger statement in the current template's context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{debugger}}
\n
\n
\n \n

When using the debugger helper you will have access to a get function. This\nfunction retrieves values available in the context of the template.\nFor example, if you're wondering why a value {{foo}} isn't rendering as\nexpected within a template, you could place a {{debugger}} statement and,\nwhen the debugger; breakpoint is hit, you can attempt to retrieve this value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('foo')
\n
\n
\n \n

get is also aware of keywords. So in this situation

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#each this.items as |item|}}\n  {{debugger}}\n{{/each}}
\n
\n
\n \n

You'll be able to get values from the current item:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('item.name')
\n
\n
\n \n

You can also access the context of the view to make sure it is the object that\nyou expect:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> context
\n
\n
\n \n", + "itemtype": "method", + "name": "debugger", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.Test-9c271e3f7e.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.Test-9c271e3f7e.json new file mode 100644 index 000000000..876483007 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.Test-9c271e3f7e.json @@ -0,0 +1,147 @@ +{ + "data": { + "id": "ember-4.11.0-Ember.Test", + "type": "class", + "attributes": { + "name": "Ember.Test", + "shortname": "Ember.Test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/ember-testing/lib/test.ts", + "line": 11, + "description": "

This is a container for an assortment of testing related functionality:

\n
    \n
  • Choose your default test adapter (for your framework of choice).
  • \n
  • Register/Unregister additional test helpers.
  • \n
  • Setup callbacks to be fired when the test helpers are injected into\nyour application.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/ember-testing/lib/test/on_inject_helpers.ts", + "line": 5, + "description": "

Used to register callbacks to be fired whenever App.injectTestHelpers\nis called.

\n

The callback will receive the current application as an argument.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import $ from 'jquery';\n\nEmber.Test.onInjectHelpers(function() {\n  $(document).ajaxSend(function() {\n    Test.pendingRequests++;\n  });\n\n  $(document).ajaxComplete(function() {\n    Test.pendingRequests--;\n  });\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "onInjectHelpers", + "params": [ + { + "name": "callback", + "description": "The function to be called.", + "type": "Function" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.ts", + "line": 32, + "description": "

This returns a thenable tailored for testing. It catches failed\nonSuccess callbacks and invokes the Ember.Test.adapter.exception\ncallback in the last chained then.

\n

This method should be returned by async helpers such as wait.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "promise", + "params": [ + { + "name": "resolver", + "description": "The function used to resolve the promise.", + "type": "Function" + }, + { + "name": "label", + "description": "An optional string for identifying the promise.", + "type": "String" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.ts", + "line": 50, + "description": "

Replacement for Ember.RSVP.resolve\nThe only difference is this uses\nan instance of Ember.Test.Promise

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "The", + "description": "value to resolve", + "type": "Mixed" + } + ], + "since": "1.2.0", + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/setup_for_testing.ts", + "line": 8, + "description": "

Sets Ember up for testing. This is useful to perform\nbasic setup steps in order to unit test.

\n

Use App.setupForTesting to perform integration tests (full\napplication testing).

\n", + "itemtype": "method", + "name": "setupForTesting", + "since": "1.5.0", + "access": "private", + "tagname": "", + "class": "Ember.Test", + "module": "@ember/test", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/test.ts", + "line": 24, + "description": "

Hash containing all known test helpers.

\n", + "itemtype": "property", + "name": "_helpers", + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/ember-testing/lib/test.ts", + "line": 45, + "description": "

Used to allow ember-testing to communicate with a specific testing\nframework.

\n

You can manually set it before calling App.setupForTesting().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Ember.Test.adapter = MyCustomAdapter.create()
\n
\n
\n \n

If you do not set it, ember-testing will default to Ember.Test.QUnitAdapter.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "adapter", + "type": "{Class} The adapter to be used.", + "default": "Ember.Test.QUnitAdapter", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.ViewMixin-1c51e34210.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.ViewMixin-1c51e34210.json new file mode 100644 index 000000000..3b61dbfb7 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Ember.ViewMixin-1c51e34210.json @@ -0,0 +1,322 @@ +{ + "data": { + "id": "ember-4.11.0-Ember.ViewMixin", + "type": "class", + "attributes": { + "name": "Ember.ViewMixin", + "shortname": "Ember.ViewMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 15, + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 93, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 121, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 141, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 181, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 246, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 331, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 405, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 439, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 300, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 308, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 321, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 345, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 358, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 366, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 35, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 166, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 267, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 378, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-EmberArray-b76fe6fa1c.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-EmberArray-b76fe6fa1c.json new file mode 100644 index 000000000..549352d3e --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-EmberArray-b76fe6fa1c.json @@ -0,0 +1,836 @@ +{ + "data": { + "id": "ember-4.11.0-EmberArray", + "type": "class", + "attributes": { + "name": "EmberArray", + "shortname": "EmberArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "MutableArray" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/array/index.ts", + "line": 219, + "description": "

This mixin implements Observer-friendly Array-like behavior. It is not a\nconcrete implementation, but it can be used up by other classes that want\nto appear like arrays.

\n

For example, ArrayProxy is a concrete class that can be instantiated to\nimplement array-like behavior. This class uses the Array Mixin by way of\nthe MutableArray mixin, which allows observable changes to be made to the\nunderlying array.

\n

This mixin defines methods specifically for collections that provide\nindex-ordered access to their contents. When you are designing code that\nneeds to accept any kind of Array-like object, you should use these methods\ninstead of Array primitives because these will properly notify observers of\nchanges to the array.

\n

Although these methods are efficient, they do add a layer of indirection to\nyour application so it is a good idea to use them only when you need the\nflexibility of using both true JavaScript arrays and "virtual" arrays such\nas controllers and collections.

\n

You can use the methods defined in this module to access and modify array\ncontents in an observable-friendly way. You can also be notified whenever\nthe membership of an array changes by using .observes('myArray.[]').

\n

To support EmberArray in your own class, you must override two\nprimitives to use it: length() and objectAt().

\n", + "uses": [ + "Enumerable" + ], + "since": "Ember 0.9.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-EmberObject-178a2fab55.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-EmberObject-1033167301.json similarity index 98% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-EmberObject-178a2fab55.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-EmberObject-1033167301.json index f60dc3144..78989f539 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-EmberObject-178a2fab55.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-EmberObject-1033167301.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.11.0-EmberObject", "type": "class", "attributes": { "name": "EmberObject", @@ -515,7 +515,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-CoreObject", + "id": "ember-4.11.0-CoreObject", "type": "class" } }, @@ -523,75 +523,75 @@ "data": [ { "type": "class", - "id": "ember-4.12.1-Ember.EventDispatcher" + "id": "ember-4.11.0-Ember.EventDispatcher" }, { "type": "class", - "id": "ember-4.12.1-Ember.CoreView" + "id": "ember-4.11.0-Ember.CoreView" }, { "type": "class", - "id": "ember-4.12.1-Namespace" + "id": "ember-4.11.0-Namespace" }, { "type": "class", - "id": "ember-4.12.1-ArrayProxy" + "id": "ember-4.11.0-ArrayProxy" }, { "type": "class", - "id": "ember-4.12.1-Ember.Controller" + "id": "ember-4.11.0-Ember.Controller" }, { "type": "class", - "id": "ember-4.12.1-ContainerDebugAdapter" + "id": "ember-4.11.0-ContainerDebugAdapter" }, { "type": "class", - "id": "ember-4.12.1-DataAdapter" + "id": "ember-4.11.0-DataAdapter" }, { "type": "class", - "id": "ember-4.12.1-EngineInstance" + "id": "ember-4.11.0-EngineInstance" }, { "type": "class", - "id": "ember-4.12.1-ObjectProxy" + "id": "ember-4.11.0-ObjectProxy" }, { "type": "class", - "id": "ember-4.12.1-HashLocation" + "id": "ember-4.11.0-HashLocation" }, { "type": "class", - "id": "ember-4.12.1-HistoryLocation" + "id": "ember-4.11.0-HistoryLocation" }, { "type": "class", - "id": "ember-4.12.1-NoneLocation" + "id": "ember-4.11.0-NoneLocation" }, { "type": "class", - "id": "ember-4.12.1-Route" + "id": "ember-4.11.0-Route" }, { "type": "class", - "id": "ember-4.12.1-EmberRouter" + "id": "ember-4.11.0-EmberRouter" }, { "type": "class", - "id": "ember-4.12.1-Service" + "id": "ember-4.11.0-Service" } ] }, "module": { "data": { - "id": "ember-4.12.1-@ember/object", + "id": "ember-4.11.0-@ember/object", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-EmberRouter-88c5f2ab3a.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-EmberRouter-09f6a588f9.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-EmberRouter-88c5f2ab3a.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-EmberRouter-09f6a588f9.json index 59279fe56..94c90cac0 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-EmberRouter-88c5f2ab3a.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-EmberRouter-09f6a588f9.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-EmberRouter", + "id": "ember-4.11.0-EmberRouter", "type": "class", "attributes": { "name": "EmberRouter", @@ -1168,7 +1168,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.11.0-EmberObject", "type": "class" } }, @@ -1177,13 +1177,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/routing/router", + "id": "ember-4.11.0-@ember/routing/router", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Engine-0ea749ee57.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Engine-0ea749ee57.json new file mode 100644 index 000000000..2989e16b2 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Engine-0ea749ee57.json @@ -0,0 +1,304 @@ +{ + "data": { + "id": "ember-4.11.0-Engine", + "type": "class", + "attributes": { + "name": "Engine", + "shortname": "Engine", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/index.ts", + "line": 40, + "description": "

The Engine class contains core functionality for both applications and\nengines.

\n

Each engine manages a registry that's used for dependency injection and\nexposed through RegistryProxy.

\n

Engines also manage initializers and instance initializers.

\n

Engines can spawn EngineInstance instances via buildInstance().

\n", + "extends": "Ember.Namespace", + "uses": [ + "RegistryProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/engine/index.ts", + "line": 62, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 209, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 285, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 346, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 359, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 371, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 384, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 392, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 400, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 414, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 448, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Enginer" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 41, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/index.ts", + "line": 325, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 338, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Engine", + "module": "@ember/engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.Namespace", + "type": "missing" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.11.0-Application" + } + ] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-EngineInstance-1c83ab62c1.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-EngineInstance-1c83ab62c1.json new file mode 100644 index 000000000..0d38fdad4 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-EngineInstance-1c83ab62c1.json @@ -0,0 +1,785 @@ +{ + "data": { + "id": "ember-4.11.0-EngineInstance", + "type": "class", + "attributes": { + "name": "EngineInstance", + "shortname": "EngineInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/instance.ts", + "line": 38, + "description": "

The EngineInstance encapsulates all of the stateful aspects of a\nrunning Engine.

\n", + "access": "public", + "tagname": "", + "extends": "EmberObject", + "uses": [ + "RegistryProxyMixin", + "ContainerProxyMixin" + ], + "methods": [ + { + "file": "packages/@ember/engine/instance.ts", + "line": 58, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 109, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 175, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 192, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 222, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 41, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 189, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "EngineInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 238, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "EngineInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/instance.ts", + "line": 70, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 25, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.11.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.11.0-ApplicationInstance" + } + ] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Evented-c79f965ff2.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Evented-c79f965ff2.json new file mode 100644 index 000000000..4fa6acebd --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Evented-c79f965ff2.json @@ -0,0 +1,190 @@ +{ + "data": { + "id": "ember-4.11.0-Evented", + "type": "class", + "attributes": { + "name": "Evented", + "shortname": "Evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.CoreView", + "Route", + "EmberRouter" + ], + "module": "@ember/object/evented", + "namespace": "", + "file": "packages/@ember/object/evented.ts", + "line": 10, + "description": "

This mixin allows for Ember objects to subscribe to and emit events.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/utils/person.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport Evented from '@ember/object/evented';\n\nexport default EmberObject.extend(Evented, {\n  greet() {\n    // ...\n    this.trigger('greet');\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
var person = Person.create();\n\nperson.on('greet', function() {\n  console.log('Our person has greeted');\n});\n\nperson.greet();\n\n// outputs: 'Our person has greeted'
\n
\n
\n \n

You can also chain multiple event subscriptions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
person.on('greet', function() {\n  console.log('Our person has greeted');\n}).one('greet', function() {\n  console.log('Offer one-time special');\n}).off('event', this, forgetThis);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/object/evented", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-HashLocation-ddafe3a3a6.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-HashLocation-ee37bf4009.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-HashLocation-ddafe3a3a6.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-HashLocation-ee37bf4009.json index 1507f2755..43b20eab1 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-HashLocation-ddafe3a3a6.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-HashLocation-ee37bf4009.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-HashLocation", + "id": "ember-4.11.0-HashLocation", "type": "class", "attributes": { "name": "HashLocation", @@ -617,7 +617,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.11.0-EmberObject", "type": "class" } }, @@ -626,13 +626,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/routing/hash-location", + "id": "ember-4.11.0-@ember/routing/hash-location", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Helper-059161efac.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Helper-d535a37fd8.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Helper-059161efac.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-Helper-d535a37fd8.json index efca60bd8..bdd48bbd0 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Helper-059161efac.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Helper-d535a37fd8.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Helper", + "id": "ember-4.11.0-Helper", "type": "class", "attributes": { "name": "Helper", @@ -182,7 +182,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-CoreObject", + "id": "ember-4.11.0-CoreObject", "type": "class" } }, @@ -191,13 +191,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/component", + "id": "ember-4.11.0-@ember/component", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-HistoryLocation-d91fd1935a.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-HistoryLocation-20da21cf0b.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-HistoryLocation-d91fd1935a.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-HistoryLocation-20da21cf0b.json index e8de09618..a607ae896 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-HistoryLocation-d91fd1935a.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-HistoryLocation-20da21cf0b.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-HistoryLocation", + "id": "ember-4.11.0-HistoryLocation", "type": "class", "attributes": { "name": "HistoryLocation", @@ -683,7 +683,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.11.0-EmberObject", "type": "class" } }, @@ -692,13 +692,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/routing/history-location", + "id": "ember-4.11.0-@ember/routing/history-location", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Location-d697548159.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Location-d697548159.json new file mode 100644 index 000000000..f39b3bbfc --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Location-d697548159.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.11.0-Location", + "type": "class", + "attributes": { + "name": "Location", + "shortname": "Location", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/location", + "namespace": "", + "file": "packages/@ember/routing/location.ts", + "line": 21, + "description": "

Location returns an instance of the correct implementation of\nthe location API.

\n

Implementations

\n

You can pass an implementation name (hash, history, none, auto) to force a\nparticular implementation to be used in your application.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n

Location API

\n

Each location implementation must provide the following methods:

\n
    \n
  • implementation: returns the string name used to reference the implementation.
  • \n
  • getURL: returns the current URL.
  • \n
  • setURL(path): sets the current URL.
  • \n
  • replaceURL(path): replace the current URL (optional).
  • \n
  • onUpdateURL(callback): triggers the callback when the URL changes.
  • \n
  • formatURL(url): formats url to be placed into href attribute.
  • \n
  • detect() (optional): instructs the location to do any feature detection\n necessary. If the location needs to redirect to a different URL, it\n can cancel routing by setting the cancelRouterSetup property on itself\n to false.
  • \n
\n

Calling setURL or replaceURL will not trigger onUpdateURL callbacks.

\n

Custom implementation

\n

Ember scans app/locations/* for extending the Location API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import HistoryLocation from '@ember/routing/history-location';\n\nexport default class MyHistory {\n  implementation = 'my-custom-history';\n\n  constructor() {\n    this._history = HistoryLocation.create(...arguments);\n  }\n\n  create() {\n    return new this(...arguments);\n  }\n\n  pushState(path) {\n     this._history.pushState(path);\n  }\n}
\n
\n
\n \n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/location.ts", + "line": 82, + "description": "

This is deprecated in favor of using the container to lookup the location\nimplementation as desired.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
// Given a location registered as follows:\ncontainer.register('location:history-test', HistoryTestLocation);\n\n// You could create a new instance via:\ncontainer.lookup('location:history-test');
\n
\n
\n \n", + "itemtype": "method", + "name": "create", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "an instance of an implementation of the `location` API", + "type": "Object" + }, + "deprecated": true, + "deprecationMessage": "Use the container to lookup the location implementation that you\n need.", + "access": "private", + "tagname": "", + "class": "Location", + "module": "@ember/routing/location" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/routing/location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Mixin-ea73cc7468.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Mixin-ea73cc7468.json new file mode 100644 index 000000000..f09be9641 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Mixin-ea73cc7468.json @@ -0,0 +1,75 @@ +{ + "data": { + "id": "ember-4.11.0-Mixin", + "type": "class", + "attributes": { + "name": "Mixin", + "shortname": "Mixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/mixin", + "namespace": "", + "file": "packages/@ember/object/mixin.ts", + "line": 449, + "description": "

The Mixin class allows you to create mixins, whose properties can be\nadded to other classes. For instance,

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nconst EditableMixin = Mixin.create({\n  edit() {\n    console.log('starting to edit');\n    this.set('isEditing', true);\n  },\n  isEditing: false\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import EmberObject from '@ember/object';\nimport EditableMixin from '../mixins/editable';\n\n// Mix mixins into classes by passing them as the first arguments to\n// `.extend.`\nconst Comment = EmberObject.extend(EditableMixin, {\n  post: null\n});\n\nlet comment = Comment.create({\n  post: somePost\n});\n\ncomment.edit(); // outputs 'starting to edit'
\n
\n
\n \n

Note that Mixins are created with Mixin.create, not\nMixin.extend.

\n

Note that mixins extend a constructor's prototype so arrays and object literals\ndefined as properties will be shared amongst objects that implement the mixin.\nIf you want to define a property in a mixin that is not shared, you can define\nit either as a computed property or have it be created on initialization of the object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
// filters array will be shared amongst any object implementing mixin\nimport Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\nconst FilterableMixin = Mixin.create({\n  filters: A()\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\nimport { computed } from '@ember/object';\n\n// filters will be a separate array for every object implementing the mixin\nconst FilterableMixin = Mixin.create({\n  filters: computed(function() {\n    return A();\n  })\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\n// filters will be created as a separate array during the object's initialization\nconst Filterable = Mixin.create({\n  filters: null,\n\n  init() {\n    this._super(...arguments);\n    this.set("filters", A());\n  }\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/mixin.ts", + "line": 435, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Mixin", + "module": "@ember/object/mixin" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.11.0-Ember.TargetActionSupport" + } + ] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/object/mixin", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-MutableArray-11ea04a62f.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-MutableArray-11ea04a62f.json new file mode 100644 index 000000000..4118ba538 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-MutableArray-11ea04a62f.json @@ -0,0 +1,1240 @@ +{ + "data": { + "id": "ember-4.11.0-MutableArray", + "type": "class", + "attributes": { + "name": "MutableArray", + "shortname": "MutableArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "ArrayProxy" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/array/index.ts", + "line": 1463, + "description": "

This mixin defines the API for modifying array-like objects. These methods\ncan be applied only to a collection that keeps its items in an ordered set.\nIt builds upon the Array mixin and adds methods to modify the array.\nOne concrete implementations of this class include ArrayProxy.

\n

It is important to use the methods in this class to modify arrays so that\nchanges are observable. This allows the binding system in Ember to function\ncorrectly.

\n

Note that an Array can change even if it does not implement this mixin.\nFor example, one might implement a SparseArray that cannot be directly\nmodified, but if its underlying enumerable changes, it will change also.

\n", + "uses": [ + "MutableEnumerable", + "EmberArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/array/index.ts", + "line": 1484, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1503, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1520, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1538, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1560, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1577, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1593, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1609, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1625, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1642, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1659, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1668, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1686, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1703, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1712, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1729, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Namespace-e6549a348e.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Namespace-f7ca1596fd.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Namespace-e6549a348e.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-Namespace-f7ca1596fd.json index ab249615f..e850890aa 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Namespace-e6549a348e.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Namespace-f7ca1596fd.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Namespace", + "id": "ember-4.11.0-Namespace", "type": "class", "attributes": { "name": "Namespace", @@ -512,7 +512,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.11.0-EmberObject", "type": "class" } }, @@ -521,13 +521,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/application/namespace", + "id": "ember-4.11.0-@ember/application/namespace", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-NoneLocation-52ec6b840a.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-NoneLocation-962b5f5b42.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-NoneLocation-52ec6b840a.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-NoneLocation-962b5f5b42.json index a8986e814..bf511532c 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-NoneLocation-52ec6b840a.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-NoneLocation-962b5f5b42.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-NoneLocation", + "id": "ember-4.11.0-NoneLocation", "type": "class", "attributes": { "name": "NoneLocation", @@ -615,7 +615,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.11.0-EmberObject", "type": "class" } }, @@ -624,13 +624,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/routing/none-location", + "id": "ember-4.11.0-@ember/routing/none-location", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-ObjectProxy-bb88de3038.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-ObjectProxy-368c628abd.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-ObjectProxy-bb88de3038.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-ObjectProxy-368c628abd.json index 1a9a4b24d..4b14e0c98 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-ObjectProxy-bb88de3038.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-ObjectProxy-368c628abd.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-ObjectProxy", + "id": "ember-4.11.0-ObjectProxy", "type": "class", "attributes": { "name": "ObjectProxy", @@ -547,7 +547,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.11.0-EmberObject", "type": "class" } }, @@ -556,13 +556,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/object/proxy", + "id": "ember-4.11.0-@ember/object/proxy", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Observable-7027866d58.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Observable-7027866d58.json new file mode 100644 index 000000000..6399dac4d --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Observable-7027866d58.json @@ -0,0 +1,388 @@ +{ + "data": { + "id": "ember-4.11.0-Observable", + "type": "class", + "attributes": { + "name": "Observable", + "shortname": "Observable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "EmberObject" + ], + "module": "@ember/object/observable", + "namespace": "", + "file": "packages/@ember/object/observable.ts", + "line": 22, + "description": "

Overview

\n

This mixin provides properties and property observing functionality, core\nfeatures of the Ember object model.

\n

Properties and observers allow one object to observe changes to a\nproperty on another object. This is one of the fundamental ways that\nmodels, controllers and views communicate with each other in an Ember\napplication.

\n

Any object that has this mixin applied can be used in observer\noperations. That includes EmberObject and most objects you will\ninteract with as you write your Ember application.

\n

Note that you will not generally apply this mixin to classes yourself,\nbut you will use the features provided by this module frequently, so it\nis important to understand how to use it.

\n

Using get() and set()

\n

Because of Ember's support for bindings and observers, you will always\naccess properties using the get method, and set properties using the\nset method. This allows the observing objects to be notified and\ncomputed properties to be handled properly.

\n

More documentation about get and set are below.

\n

Observing Property Changes

\n

You typically observe property changes simply by using the observer\nfunction in classes that you write.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { observer } from '@ember/object';\nimport EmberObject from '@ember/object';\n\nEmberObject.extend({\n  valueObserver: observer('value', function(sender, key, value, rev) {\n    // Executes whenever the "value" property changes\n    // See the addObserver method for more information about the callback arguments\n  })\n});
\n
\n
\n \n

Although this is the most common way to add an observer, this capability\nis actually built into the EmberObject class on top of two methods\ndefined in this mixin: addObserver and removeObserver. You can use\nthese two methods to add and remove observers yourself if you need to\ndo so at runtime.

\n

To add an observer for a property, call:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
object.addObserver('propertyKey', targetObject, targetAction)
\n
\n
\n \n

This will call the targetAction method on the targetObject whenever\nthe value of the propertyKey changes.

\n

Note that if propertyKey is a computed property, the observer will be\ncalled when any of the property dependencies are changed, even if the\nresulting value of the computed property is unchanged. This is necessary\nbecause computed properties are not computed until get is called.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/object/observable", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Owner-3c7641e4ab.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Owner-3c7641e4ab.json new file mode 100644 index 000000000..a792b6827 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Owner-3c7641e4ab.json @@ -0,0 +1,134 @@ +{ + "data": { + "id": "ember-4.11.0-Owner", + "type": "class", + "attributes": { + "name": "Owner", + "shortname": "Owner", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 285, + "description": "

Framework objects in an Ember application (components, services, routes,\netc.) are created via a factory and dependency injection system. Each of\nthese objects is the responsibility of an "owner", which handles its\ninstantiation and manages its lifetime.

\n

An Owner is not a class you construct; it is one the framework constructs\nfor you. The normal way to get access to the relevant Owner is using the\ngetOwner function.

\n", + "uses": [ + "BasicContainer", + "BasicRegistry" + ], + "since": "4.10.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 189, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Owner", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 238, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "Owner", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Owner", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Promise-eee4d451fc.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Promise-eee4d451fc.json new file mode 100644 index 000000000..b5ba31307 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Promise-eee4d451fc.json @@ -0,0 +1,246 @@ +{ + "data": { + "id": "ember-4.11.0-Promise", + "type": "class", + "attributes": { + "name": "Promise", + "shortname": "Promise", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 26, + "description": "

Promise objects represent the eventual result of an asynchronous operation. The\nprimary way of interacting with a promise is through its then method, which\nregisters callbacks to receive either a promise’s eventual value or the reason\nwhy the promise cannot be fulfilled.

\n

Terminology

\n
    \n
  • promise is an object or function with a then method whose behavior conforms to this specification.
  • \n
  • thenable is an object or function that defines a then method.
  • \n
  • value is any legal JavaScript value (including undefined, a thenable, or a promise).
  • \n
  • exception is a value that is thrown using the throw statement.
  • \n
  • reason is a value that indicates why a promise was rejected.
  • \n
  • settled the final resting state of a promise, fulfilled or rejected.
  • \n
\n

A promise can be in one of three states: pending, fulfilled, or rejected.

\n

Promises that are fulfilled have a fulfillment value and are in the fulfilled\nstate. Promises that are rejected have a rejection reason and are in the\nrejected state. A fulfillment value is never a thenable.

\n

Promises can also be said to resolve a value. If this value is also a\npromise, then the original promise's settled state will match the value's\nsettled state. So a promise that resolves a promise that rejects will\nitself reject, and a promise that resolves a promise that fulfills will\nitself fulfill.

\n

Basic Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
let promise = new Promise(function(resolve, reject) {\n  // on success\n  resolve(value);\n\n  // on failure\n  reject(reason);\n});\n\npromise.then(function(value) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Advanced Usage:

\n

Promises shine when abstracting away asynchronous interactions such as\nXMLHttpRequests.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
function getJSON(url) {\n  return new Promise(function(resolve, reject){\n    let xhr = new XMLHttpRequest();\n\n    xhr.open('GET', url);\n    xhr.onreadystatechange = handler;\n    xhr.responseType = 'json';\n    xhr.setRequestHeader('Accept', 'application/json');\n    xhr.send();\n\n    function handler() {\n      if (this.readyState === this.DONE) {\n        if (this.status === 200) {\n          resolve(this.response);\n        } else {\n          reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n        }\n      }\n    };\n  });\n}\n\ngetJSON('/posts.json').then(function(json) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Unlike callbacks, promises are great composable primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Promise.all([\n  getJSON('/posts'),\n  getJSON('/comments')\n]).then(function(values){\n  values[0] // => postsJSON\n  values[1] // => commentsJSON\n\n  return values;\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "params": [ + { + "name": "resolver", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "is_constructor": 1, + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/promise/all.js", + "line": 3, + "description": "

Promise.all accepts an array of promises, and returns a new promise which\nis fulfilled with an array of fulfillment values for the passed promises, or\nrejected with the reason of the first passed promise to be rejected. It casts all\nelements of the passed iterable to promises as it runs this algorithm.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Promise, { resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // The array here would be [ 1, 2, 3 ];\n});
\n
\n
\n \n

If any of the promises given to RSVP.all are rejected, the first promise\nthat is rejected will be given as an argument to the returned promises's\nrejection handler. For example:

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Promise, { resolve, reject } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error("2"));\nlet promise3 = reject(new Error("3"));\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(error) {\n  // error.message === "2"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "all", + "params": [ + { + "name": "entries", + "description": "array of promises", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all `promises` have been\nfulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "static": 1, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/race.js", + "line": 9, + "description": "

Promise.race returns a new promise which is settled in the same way as the\nfirst passed promise to settle.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 2');\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // result === 'promise 2' because it was resolved before promise1\n  // was resolved.\n});
\n
\n
\n \n

Promise.race is deterministic in that only the state of the first\nsettled promise matters. For example, even if other promises given to the\npromises array argument are resolved, but the first settled promise has\nbecome rejected before the other promises became fulfilled, the returned\npromise will become rejected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    reject(new Error('promise 2'));\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // Code here never runs\n}, function(reason){\n  // reason.message === 'promise 2' because promise 2 became rejected before\n  // promise 1 became fulfilled\n});
\n
\n
\n \n

An example real-world use case is implementing timeouts:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import Promise from 'rsvp';\n\nPromise.race([ajax('foo.json'), timeout(5000)])
\n
\n
\n \n", + "itemtype": "method", + "name": "race", + "static": 1, + "params": [ + { + "name": "entries", + "description": "array of promises to observe", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for describing the promise returned.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise which settles in the same way as the first passed\npromise to settle.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/reject.js", + "line": 6, + "description": "

Promise.reject returns a promise rejected with the passed reason.\nIt is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  reject(new Error('WHOOPS'));\n});\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = Promise.reject(new Error('WHOOPS'));\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/resolve.js", + "line": 6, + "description": "

Promise.resolve returns a promise that will become resolved with the\npassed value. It is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  resolve(1);\n});\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Promise from 'rsvp';\n\nlet promise = RSVP.Promise.resolve(1);\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "resolve", + "static": 1, + "params": [ + { + "name": "object", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 155, + "description": "

catch is simply sugar for then(undefined, onRejection) which makes it the same\nas the catch block of a try/catch statement.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
function findAuthor(){\n  throw new Error('couldn\\'t find that author');\n}\n\n// synchronous\ntry {\n  findAuthor();\n} catch(reason) {\n  // something went wrong\n}\n\n// async with promises\nfindAuthor().catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 187, + "description": "

finally will be invoked regardless of the promise's fate just as native\ntry/catch/finally behaves

\n

Synchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
findAuthor() {\n  if (Math.random() > 0.5) {\n    throw new Error();\n  }\n  return new Author();\n}\n\ntry {\n  return findAuthor(); // succeed or fail\n} catch(error) {\n  return findOtherAuthor();\n} finally {\n  // always runs\n  // doesn't affect the return value\n}
\n
\n
\n \n

Asynchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findAuthor().catch(function(reason){\n  return findOtherAuthor();\n}).finally(function(){\n  // author was either found, or not\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 248, + "description": "

The primary way of interacting with a promise is through its then method,\nwhich registers callbacks to receive either a promise's eventual value or the\nreason why the promise cannot be fulfilled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function(user){\n  // user is available\n}, function(reason){\n  // user is unavailable, and you are given the reason why\n});
\n
\n
\n \n

Chaining

\n

The return value of then is itself a promise. This second, 'downstream'\npromise is resolved with the return value of the first promise's fulfillment\nor rejection handler, or rejected if the handler throws an exception.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
findUser().then(function (user) {\n  return user.name;\n}, function (reason) {\n  return 'default name';\n}).then(function (userName) {\n  // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n  // will be `'default name'`\n});\n\nfindUser().then(function (user) {\n  throw new Error('Found user, but still unhappy');\n}, function (reason) {\n  throw new Error('`findUser` rejected and we\\'re unhappy');\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n  // If `findUser` rejected, `reason` will be '`findUser` rejected and we\\'re unhappy'.\n});
\n
\n
\n \n

If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
findUser().then(function (user) {\n  throw new PedagogicalException('Upstream error');\n}).then(function (value) {\n  // never reached\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // The `PedgagocialException` is propagated all the way down to here\n});
\n
\n
\n \n

Assimilation

\n

Sometimes the value you want to propagate to a downstream promise can only be\nretrieved asynchronously. This can be achieved by returning a promise in the\nfulfillment or rejection handler. The downstream promise will then be pending\nuntil the returned promise is settled. This is called assimilation.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // The user's comments are now available\n});
\n
\n
\n \n

If the assimliated promise rejects, then the downstream promise will also reject.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // If `findCommentsByAuthor` fulfills, we'll have the value here\n}, function (reason) {\n  // If `findCommentsByAuthor` rejects, we'll have the reason here\n});
\n
\n
\n \n

Simple Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let result;\n\ntry {\n  result = findResult();\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findResult(function(result, err){\n  if (err) {\n    // failure\n  } else {\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findResult().then(function(result){\n  // success\n}, function(reason){\n  // failure\n});
\n
\n
\n \n

Advanced Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let author, books;\n\ntry {\n  author = findAuthor();\n  books  = findBooksByAuthor(author);\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
function foundBooks(books) {\n\n}\n\nfunction failure(reason) {\n\n}\n\nfindAuthor(function(author, err){\n  if (err) {\n    failure(err);\n    // failure\n  } else {\n    try {\n      findBoooksByAuthor(author, function(books, err) {\n        if (err) {\n          failure(err);\n        } else {\n          try {\n            foundBooks(books);\n          } catch(reason) {\n            failure(reason);\n          }\n        }\n      });\n    } catch(error) {\n      failure(err);\n    }\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findAuthor().\n  then(findBooksByAuthor).\n  then(function(books){\n    // found books\n}).catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "onFulfillment", + "description": "", + "type": "Function" + }, + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-PromiseProxyMixin-6ded533057.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-PromiseProxyMixin-6ded533057.json new file mode 100644 index 000000000..62d282a21 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-PromiseProxyMixin-6ded533057.json @@ -0,0 +1,186 @@ +{ + "data": { + "id": "ember-4.11.0-PromiseProxyMixin", + "type": "class", + "attributes": { + "name": "PromiseProxyMixin", + "shortname": "PromiseProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/promise-proxy-mixin", + "namespace": "", + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 46, + "description": "

A low level mixin making ObjectProxy promise-aware.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { resolve } from 'rsvp';\nimport $ from 'jquery';\nimport ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nlet ObjectPromiseProxy = ObjectProxy.extend(PromiseProxyMixin);\n\nlet proxy = ObjectPromiseProxy.create({\n  promise: resolve($.getJSON('/some/remote/data.json'))\n});\n\nproxy.then(function(json){\n   // the json\n}, function(reason) {\n   // the reason why you have no json\n});
\n
\n
\n \n

the proxy has bindable attributes which\ntrack the promises life cycle

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> true\nproxy.get('isSettled')  //=> false\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> false
\n
\n
\n \n

When the $.getJSON completes, and the promise is fulfilled\nwith json, the life cycle attributes will update accordingly.\nNote that $.getJSON doesn't return an ECMA specified promise,\nit is useful to wrap this with an RSVP.resolve so that it behaves\nas a spec compliant promise.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> false\nproxy.get('isSettled')   //=> true\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> true
\n
\n
\n \n

As the proxy is an ObjectProxy, and the json now its content,\nall the json properties will be available directly from the proxy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// Assuming the following json:\n{\n  firstName: 'Stefan',\n  lastName: 'Penner'\n}\n\n// both properties will accessible on the proxy\nproxy.get('firstName') //=> 'Stefan'\nproxy.get('lastName')  //=> 'Penner'
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 176, + "description": "

An alias to the proxied promise's then.

\n

See RSVP.Promise.then.

\n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 187, + "description": "

An alias to the proxied promise's catch.

\n

See RSVP.Promise.catch.

\n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 199, + "description": "

An alias to the proxied promise's finally.

\n

See RSVP.Promise.finally.

\n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 110, + "description": "

If the proxied promise is rejected this will contain the reason\nprovided.

\n", + "itemtype": "property", + "name": "reason", + "default": "null", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 120, + "description": "

Once the proxied promise has settled this will become false.

\n", + "itemtype": "property", + "name": "isPending", + "default": "true", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 128, + "description": "

Once the proxied promise has settled this will become true.

\n", + "itemtype": "property", + "name": "isSettled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 137, + "description": "

Will become true if the proxied promise is rejected.

\n", + "itemtype": "property", + "name": "isRejected", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 145, + "description": "

Will become true if the proxied promise is fulfilled.

\n", + "itemtype": "property", + "name": "isFulfilled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 154, + "description": "

The promise whose fulfillment value is being proxied by this object.

\n

This property must be specified upon creation, and should not be\nchanged once created.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nObjectProxy.extend(PromiseProxyMixin).create({\n  promise: <thenable>\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "promise", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/object/promise-proxy-mixin", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Registry-f25f49c702.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Registry-f25f49c702.json new file mode 100644 index 000000000..f250500e9 --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Registry-f25f49c702.json @@ -0,0 +1,407 @@ +{ + "data": { + "id": "ember-4.11.0-Registry", + "type": "class", + "attributes": { + "name": "Registry", + "shortname": "Registry", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 33, + "description": "

A registry used to store factory and option information keyed\nby type.

\n

A Registry stores the factory and option information needed by a\nContainer to instantiate and cache objects.

\n

The API for Registry is still in flux and should not be considered stable.

\n", + "access": "private", + "tagname": "", + "since": "1.11.0", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 122, + "description": "

Creates a container based on this registry.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "container", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "created container", + "type": "Container" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 134, + "description": "

Registers a factory for later injection.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let registry = new Registry();\n\nregistry.register('model:user', Person, {singleton: false });\nregistry.register('fruit:favorite', Orange);\nregistry.register('communication:main', Email, {singleton: false});
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "factory", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 183, + "description": "

Unregister a fullName

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.register('model:user', User);\n\nregistry.resolve('model:user').create() instanceof User //=> true\n\nregistry.unregister('model:user')\nregistry.resolve('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 211, + "description": "

Given a fullName return the corresponding factory.

\n

By default resolve will retrieve the factory from\nthe registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let registry = new Registry();\nregistry.register('api:twitter', Twitter);\n\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n

Optionally the registry can be provided with a custom resolver.\nIf provided, resolve will first provide the custom resolver\nthe opportunity to resolve the fullName, otherwise it will fallback\nto the registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.resolver = function(fullName) {\n   // lookup via the module system of choice\n };\n\n// the twitter factory is added to the module system\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 252, + "description": "

A hook that can be used to describe how the resolver will\nattempt to find the factory.

\n

For example, the default Ember .describe returns the full\nclass name (including namespace) where Ember's resolver expects\nto find the fullName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "describe", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "described fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 275, + "description": "

A hook to enable custom fullName normalization behavior

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalizeFullName", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 293, + "description": "

Normalize a fullName based on the application's conventions

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalize", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 308, + "itemtype": "method", + "name": "makeToString", + "access": "private", + "tagname": "", + "params": [ + { + "name": "factory", + "description": "", + "type": "Any" + }, + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "toString function", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 326, + "description": "

Given a fullName check if the container is aware of its factory\nor singleton instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "the fullname of the request source (used for local lookups)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 345, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let registry = new Registry();\nlet container = registry.container();\n\n// if all of type `connection` must not be singletons\nregistry.optionsForType('connection', { singleton: false });\n\nregistry.register('connection:twitter', TwitterConnection);\nregistry.register('connection:facebook', FacebookConnection);\n\nlet twitter = container.lookup('connection:twitter');\nlet twitter2 = container.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = container.lookup('connection:facebook');\nlet facebook2 = container.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "optionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 386, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "options", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 458, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "knownForType", + "params": [ + { + "name": "type", + "description": "the type to iterate over", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 72, + "description": "

A backup registry for resolving registrations when no matches can be found.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "fallback", + "type": "Registry", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 80, + "description": "

An object that has a resolve method that resolves a name.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "resolver", + "type": "Resolver", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 88, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registrations", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 94, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_normalizeCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 101, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_resolveCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 108, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_options", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 115, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_typeOptions", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-RegistryProxy-90b860ed4f.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-RegistryProxy-90b860ed4f.json new file mode 100644 index 000000000..b65de722b --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-RegistryProxy-90b860ed4f.json @@ -0,0 +1,84 @@ +{ + "data": { + "id": "ember-4.11.0-RegistryProxy", + "type": "class", + "attributes": { + "name": "RegistryProxy", + "shortname": "RegistryProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 590, + "extends": "BasicRegistry", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "RegistryProxy", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.11.0-BasicRegistry", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.11.0-RegistryProxyMixin" + } + ] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-RegistryProxyMixin-2c6a220939.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-RegistryProxyMixin-2c6a220939.json new file mode 100644 index 000000000..179e5d96b --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-RegistryProxyMixin-2c6a220939.json @@ -0,0 +1,112 @@ +{ + "data": { + "id": "ember-4.11.0-RegistryProxyMixin", + "type": "class", + "attributes": { + "name": "RegistryProxyMixin", + "shortname": "RegistryProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Engine", + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 12, + "description": "

RegistryProxyMixin is used to provide public access to specific\nregistry functionality.

\n", + "extends": "RegistryProxy", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 41, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "RegistryProxyMixin", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.11.0-RegistryProxy", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-Route-613f268f41.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Route-613f268f41.json new file mode 100644 index 000000000..bf2ee84fe --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Route-613f268f41.json @@ -0,0 +1,1706 @@ +{ + "data": { + "id": "ember-4.11.0-Route", + "type": "class", + "attributes": { + "name": "Route", + "shortname": "Route", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/route", + "namespace": "", + "file": "packages/@ember/routing/route.ts", + "line": 76, + "description": "

The Route class is used to define individual routes. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented", + "ActionHandler" + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/route.ts", + "line": 302, + "description": "

A hook you can implement to convert the route's model into parameters\nfor the URL.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model({ post_id }) {\n    // the server returns `{ id: 12 }`\n    return fetch(`/posts/${post_id}`;\n  }\n\n  serialize(model) {\n    // this will make the URL `/posts/12`\n    return { post_id: model.id };\n  }\n}
\n
\n
\n \n

The default serialize method will insert the model's id into the\nroute's dynamic segment (in this case, :post_id) if the segment contains '_id'.\nIf the route has multiple dynamic segments or does not contain '_id', serialize\nwill return getProperties(model, params)

\n

This method is called when transitionTo is called with a context\nin order to populate the URL.

\n", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "model", + "description": "the routes model", + "type": "Object" + }, + { + "name": "params", + "description": "an Array of parameter names for the current\n route (in the example, `['post_id']`.", + "type": "Array" + } + ], + "return": { + "description": "the serialized parameters", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 539, + "description": "

Sets the name for this route, including a fully resolved name for routes\ninside engines.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_setRouteName", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 554, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_stashNames", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 597, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_updatingQPChanged", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 605, + "description": "

Returns a hash containing the parameters of an ancestor route.

\n

You may notice that this.paramsFor sometimes works when referring to a\nchild route, but this behavior should not be relied upon as only ancestor\nroutes are certain to be loaded in time.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('member', { path: ':name' }, function() {\n    this.route('interest', { path: ':interest' });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class MemberRoute extends Route {\n  queryParams = {\n    memberQp: { refreshModel: true }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member/interest.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default class MemberInterestRoute extends Route {\n  queryParams = {\n    interestQp: { refreshModel: true }\n  }\n\n  model() {\n    return this.paramsFor('member');\n  }\n}
\n
\n
\n \n

If we visit /turing/maths?memberQp=member&interestQp=interest the model for\nthe member.interest route is a hash with:

\n
    \n
  • name: turing
  • \n
  • memberQp: member
  • \n
\n", + "itemtype": "method", + "name": "paramsFor", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "return": { + "description": "hash containing the parameters of the route `name`", + "type": "Object" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 686, + "description": "

Serializes the query parameter key

\n", + "itemtype": "method", + "name": "serializeQueryParamKey", + "params": [ + { + "name": "controllerPropertyName", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 697, + "description": "

Serializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 713, + "description": "

Deserializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 745, + "description": "

A hook you can use to reset controller values either when the model\nchanges or the route is exiting.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/articles.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class ArticlesRoute extends Route {\n  resetController(controller, isExiting, transition) {\n    if (isExiting && transition.targetName !== 'error') {\n      controller.set('page', 1);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "resetController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "isExiting", + "description": "", + "type": "Boolean" + }, + { + "name": "transition", + "description": "", + "type": "Object" + } + ], + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 772, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "exit", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 783, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_internalReset", + "since": "3.6.0", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 797, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "enter", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 848, + "description": "

This hook is executed when the router completely exits this route. It is\nnot executed when the model for the route changes.

\n", + "itemtype": "method", + "name": "deactivate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 859, + "description": "

This hook is executed when the router enters the route. It is not executed\nwhen the model for the route changes.

\n", + "itemtype": "method", + "name": "activate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 870, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogPosts');\nthis.transitionTo('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('blogPost', { path:':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogComment', aPost, aComment);\nthis.transitionTo('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
this.transitionTo('/');\nthis.transitionTo('/blog/post/1/comment/13');\nthis.transitionTo('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
this.transitionTo('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\nthis.transitionTo({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceWith.

\n

Simple Transition Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n  this.route('fourOhFour', { path: '*:' });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToSecret(context) {\n    if (authorized()) {\n      this.transitionTo('secret', context);\n    } else {\n      this.transitionTo('fourOhFour');\n    }\n  }\n}
\n
\n
\n \n

Transition to a nested route

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('articles', { path: '/articles' }, function() {\n    this.route('new');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToNewArticle() {\n    this.transitionTo('articles.new');\n  }\n}
\n
\n
\n \n

Multiple Models Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n\n  this.route('breakfast', { path: ':breakfastId' }, function() {\n    this.route('cereal', { path: ':cerealId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToChocolateCereal() {\n    let cereal = { cerealId: 'ChocolateYumminess' };\n    let breakfast = { breakfastId: 'CerealAndMilk' };\n\n    this.transitionTo('breakfast.cereal', breakfast, cereal);\n  }\n}
\n
\n
\n \n

Nested Route with Query String Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('fruits', function() {\n    this.route('apples');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToApples() {\n    this.transitionTo('fruits.apples', { queryParams: { color: 'red' } });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL.", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1068, + "description": "

Perform a synchronous transition into another route without attempting\nto resolve promises, update the URL, or abort any currently active\nasynchronous transitions (i.e. regular transitions caused by\ntransitionTo or URL changes).

\n

This method is handy for performing intermediate transitions on the\nway to a final destination route, and is called internally by the\ndefault implementations of the error and loading handlers.

\n", + "itemtype": "method", + "name": "intermediateTransitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) to be used while transitioning\nto the route.", + "type": "...Object" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1090, + "description": "

Refresh the model on this route and any child routes, firing the\nbeforeModel, model, and afterModel hooks in a similar fashion\nto how routes are entered when transitioning in from other route.\nThe current route params (e.g. article_id) will be passed in\nto the respective model hooks, and if a different model is returned,\nsetupController and associated route hooks will re-fire as well.

\n

An example usage of this method is re-querying the server for the\nlatest information using the same parameters as when the route\nwas first entered.

\n

Note that this will cause model hooks to fire even on routes\nthat were provided a model object when the route was initially\nentered.

\n", + "itemtype": "method", + "name": "refresh", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1116, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionTo in all other respects. See\n'transitionTo' for additional information regarding multiple models.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/secret.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class SecretRoute Route {\n  afterModel() {\n    if (!authorized()){\n      this.replaceWith('index');\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1164, + "description": "

This hook is the entry point for router.js

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1239, + "description": "

This hook is the first of the route entry validation hooks\ncalled when an attempt is made to transition into a route\nor one of its children. It is called before model and\nafterModel, and is appropriate for cases when:

\n
    \n
  1. A decision can be made to redirect elsewhere without\nneeding to resolve the model first.
  2. \n
  3. Any async operations need to occur first before the\nmodel is attempted to be resolved.
  4. \n
\n

This hook is provided the current transition attempt\nas a parameter, which can be used to .abort() the transition,\nsave it for a later .retry(), or retrieve values set\non it from a previous hook. You can also just call\nthis.transitionTo to another route to implicitly\nabort the transition.

\n

You can return a promise from this hook to pause the\ntransition until the promise resolves (or rejects). This could\nbe useful, for instance, for retrieving async code from\nthe server that is required to enter a route.

\n", + "itemtype": "method", + "name": "beforeModel", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1274, + "description": "

This hook is called after this route's model has resolved.\nIt follows identical async/promise semantics to beforeModel\nbut is provided the route's resolved model in addition to\nthe transition, and is therefore suited to performing\nlogic that can only take place after the model has already\nresolved.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n  afterModel(posts, transition) {\n    if (posts.get('length') === 1) {\n      this.transitionTo('post.show', posts.get('firstObject'));\n    }\n  }\n}
\n
\n
\n \n

Refer to documentation for beforeModel for a description\nof transition-pausing semantics when a promise is returned\nfrom this hook.

\n", + "itemtype": "method", + "name": "afterModel", + "params": [ + { + "name": "resolvedModel", + "description": "the value returned from `model`,\n or its resolved value if it was a promise", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1312, + "description": "

A hook you can implement to optionally redirect to another route.

\n

Calling this.transitionTo from inside of the redirect hook will\nabort the current transition (into the route that has implemented redirect).

\n

redirect and afterModel behave very similarly and are\ncalled almost at the same time, but they have an important\ndistinction when calling this.transitionTo to a child route\nof the current route. From afterModel, this new transition\ninvalidates the current transition, causing beforeModel,\nmodel, and afterModel hooks to be called again. But the\nsame transition started from redirect does not invalidate\nthe current transition. In other words, by the time the redirect\nhook has been called, both the resolved model and the attempted\nentry into this route are considered fully validated.

\n", + "itemtype": "method", + "name": "redirect", + "params": [ + { + "name": "model", + "description": "the model for this route", + "type": "Object" + }, + { + "name": "transition", + "description": "the transition object associated with the current transition", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1337, + "description": "

Called when the context is changed by router.js.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "contextDidChange", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1347, + "description": "

A hook you can implement to convert the URL into the model for\nthis route.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

The model for the post route is store.findRecord('post', params.post_id).

\n

By default, if your route has a dynamic segment ending in _id:

\n
    \n
  • The model class is determined from the segment (post_id's\nclass is App.Post)
  • \n
  • The find method is called on the model class with the value of\nthe dynamic segment.
  • \n
\n

Note that for routes with dynamic segments, this hook is not always\nexecuted. If the route is entered through a transition (e.g. when\nusing the link-to Handlebars helper or the transitionTo method\nof routes), and a model context is already provided this hook\nis not called.

\n

A model context does not include a primitive string or number,\nwhich does cause the model hook to be called.

\n

Routes without dynamic segments will always execute the model hook.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
// no dynamic segment, model hook always called\nthis.transitionTo('posts');\n\n// model passed in, so model hook not called\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost);\n\n// integer passed in, model hook is called\nthis.transitionTo('post', 1);\n\n// model id passed in, model hook is called\n// useful for forcing the hook to execute\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost.id);
\n
\n
\n \n

This hook follows the asynchronous/promise semantics\ndescribed in the documentation for beforeModel. In particular,\nif a promise returned from model fails, the error will be\nhandled by the error hook on Route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model(params) {\n    return this.store.findRecord('post', params.post_id);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "model", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route. If\n a promise is returned, the transition will pause until\n the promise resolves, and the resolved value of the promise\n will be used as the model for this route.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1462, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "deserialize", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route.\n\nRouter.js hook.", + "type": "Any | Promise" + }, + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1475, + "itemtype": "method", + "name": "findModel", + "params": [ + { + "name": "type", + "description": "the model type", + "type": "String" + }, + { + "name": "value", + "description": "the value passed to find", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1486, + "description": "

A hook you can use to setup the controller for the current route.

\n

This method is called with the controller for the current route and the\nmodel supplied by the model hook.

\n

By default, the setupController hook sets the model property of\nthe controller to the specified model when it is not undefined.

\n

If you implement the setupController hook in your Route, it will\nprevent this default behavior. If you want to preserve that behavior\nwhen implementing your setupController function, make sure to call\nsuper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/photos.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PhotosRoute extends Route {\n  model() {\n    return this.store.findAll('photo');\n  }\n\n  setupController(controller, model) {\n    super.setupController(controller, model);\n\n    this.controllerFor('application').set('showingPhotos', true);\n  }\n}
\n
\n
\n \n

The provided controller will be one resolved based on the name\nof this route.

\n

If no explicit controller is defined, Ember will automatically create one.

\n

As an example, consider the router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

If you have defined a file for the post controller,\nthe framework will use it.\nIf it is not defined, a basic Controller instance would be used.

\n", + "example": [ + " Behavior of a basic Controller\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, model) {\n controller.set('model', model);\n }\n});\n```" + ], + "itemtype": "method", + "name": "setupController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "model", + "description": "", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition", + "optional": true + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1562, + "description": "

Returns the controller of the current route, or a parent (or any ancestor)\nroute in a route hierarchy.

\n

The controller instance must already have been created, either through entering the\nassociated route or using generateController.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.controllerFor('posts').set('currentPost', post);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "controllerFor", + "params": [ + { + "name": "name", + "description": "the name of the route or controller", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Controller | undefined" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1616, + "description": "

Generates a controller for a route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class Post extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.generateController('posts');\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "generateController", + "params": [ + { + "name": "name", + "description": "the name of the controller", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1644, + "description": "

Returns the resolved model of a parent (or any ancestor) route\nin a route hierarchy. During a transition, all routes\nmust resolve a model object, and if a route\nneeds access to a parent route's model in order to\nresolve a model (or just reuse the model from a parent),\nit can call this.modelFor(theNameOfParentRoute) to\nretrieve it. If the ancestor route's model was a promise,\nits resolved result is returned.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' }, function() {\n    this.route('comments');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post/comments.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostCommentsRoute extends Route {\n  model() {\n    let post = this.modelFor('post');\n\n    return post.comments;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "modelFor", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "the model object", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1716, + "description": "

this[RENDER] is used to render a template into a region of another template\n(indicated by an {{outlet}}).

\n", + "itemtype": "method", + "name": "this[RENDER]", + "params": [ + { + "name": "name", + "description": "the name of the template to render", + "type": "String" + }, + { + "name": "options", + "description": "the options", + "type": "Object", + "optional": true, + "props": [ + { + "name": "into", + "description": "the template to render into,\n referenced by name. Defaults to the parent template", + "type": "String", + "optional": true + }, + { + "name": "outlet", + "description": "the outlet inside `options.into` to render into.\n Defaults to 'main'", + "type": "String", + "optional": true + }, + { + "name": "controller", + "description": "the controller to use for this template,\n referenced by name or as a controller instance. Defaults to the Route's paired controller", + "type": "String|Object", + "optional": true + }, + { + "name": "model", + "description": "the model object to set on `options.controller`.\n Defaults to the return value of the Route's model hook", + "type": "Object", + "optional": true + } + ] + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1743, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "teardownViews", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1756, + "description": "

Allows you to produce custom metadata for the route.\nThe return value of this method will be attached to\nits corresponding RouteInfoWithAttributes object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostsIndexRoute extends Route {\n  buildRouteInfoMetadata() {\n    return { title: 'Posts Page' }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service router\n\n  constructor() {\n    super(...arguments);\n\n    this.router.on('routeDidChange', transition => {\n      document.title = transition.to.metadata.title;\n      // would update document's title to "Posts Page"\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "buildRouteInfoMetadata", + "return": { + "description": "any" + }, + "since": "3.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 2012, + "description": "

Sends an action to the router, which will delegate it to the currently\nactive route hierarchy per the bubbling rules explained under actions.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  track(arg) {\n    console.log(arg, 'was clicked');\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  trackIfDebug(arg) {\n    if (debug) {\n      this.send('track', arg);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "name", + "description": "the name of the action to trigger", + "type": "String" + }, + { + "name": "args", + "description": "", + "type": "...*" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 2428, + "description": "

This action is called when one or more query params have changed. Bubbles.

\n", + "itemtype": "method", + "name": "queryParamsDidChange", + "params": [ + { + "name": "changed", + "description": "Keys are names of query params that have changed.", + "type": "Object" + }, + { + "name": "totalPresent", + "description": "Keys are names of query params that are currently set.", + "type": "Object" + }, + { + "name": "removed", + "description": "Keys are names of query params that have been removed.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/routing/route.ts", + "line": 88, + "description": "

The willTransition action 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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ContactFormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData')) {\n      this.controller.displayNavigationConfirm();\n      transition.abort();\n    }\n  }\n}
\n
\n
\n \n

You can also redirect elsewhere by calling\nthis.transitionTo('elsewhere') from within willTransition.\nNote that willTransition will not be fired for the\nredirecting transitionTo, since willTransition doesn't\nfire when there is already a transition underway. If you want\nsubsequent willTransition actions to fire for the redirecting\ntransition, you must first explicitly call\ntransition.abort().

\n

To allow the willTransition event to continue bubbling to the parent\nroute, use return true;. When the willTransition method has a\nreturn value of true then the parent route's willTransition method\nwill be fired, enabling "bubbling" behavior for the event.

\n", + "itemtype": "event", + "name": "willTransition", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 133, + "description": "

The didTransition action is fired after a transition has\nsuccessfully been completed. This occurs after the normal model\nhooks (beforeModel, model, afterModel, setupController)\nhave resolved. The didTransition action has no arguments,\nhowever, it can be useful for tracking page views or resetting\nstate on the controller.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/login.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class LoginRoute extends Route {\n  @action\n  didTransition() {\n    this.controller.get('errors.base').clear();\n    return true; // Bubble the didTransition event\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "didTransition", + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 160, + "description": "

The loading action is fired on the route when a route's model\nhook returns a promise that is not already resolved. The current\nTransition object is the first parameter and the route that\ntriggered the loading event is the second parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  loading(transition, route) {\n    let controller = this.controllerFor('foo');\n\n    // The controller may not be instantiated when initially loading\n    if (controller) {\n      controller.currentlyLoading = true;\n\n      transition.finally(function() {\n        controller.currentlyLoading = false;\n      });\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "loading", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + }, + { + "name": "route", + "description": "The route that triggered the loading event", + "type": "Route" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 195, + "description": "

When attempting to transition into a route, any of the hooks\nmay return a promise that rejects, at which point an error\naction will be fired on the partially-entered routes, allowing\nfor per-route error handling logic, or shared error handling\nlogic defined on a parent route.

\n

Here is an example of an error handler that will be invoked\nfor rejected promises from the various hooks on the route,\nas well as any unhandled errors from child routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/admin.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { reject } from 'rsvp';\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class AdminRoute extends Route {\n  beforeModel() {\n    return reject('bad things!');\n  }\n\n  @action\n  error(error, transition) {\n    // Assuming we got here due to the error in `beforeModel`,\n    // we can expect that error === "bad things!",\n    // but a promise model rejecting would also\n    // call this hook, as would any errors encountered\n    // in `afterModel`.\n\n    // The `error` hook is also provided the failed\n    // `transition`, which can be stored and later\n    // `.retry()`d if desired.\n\n    this.transitionTo('login');\n  }\n}
\n
\n
\n \n

error actions that bubble up all the way to ApplicationRoute\nwill fire a default error handler that logs the error. You can\nspecify your own global default error handler by overriding the\nerror handler on ApplicationRoute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  error(error, transition) {\n    this.controllerFor('banner').displayError(error.message);\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "error", + "params": [ + { + "name": "error", + "description": "", + "type": "Error" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 808, + "description": "

This event is triggered when the router enters the route. It is\nnot executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  collectAnalytics: on('activate', function(){\n    collectAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "activate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 828, + "description": "

This event is triggered when the router completely exits this\nroute. It is not executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  trackPageLeaveAnalytics: on('deactivate', function(){\n    trackPageLeaveAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "deactivate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + } + ], + "properties": [ + { + "file": "packages/@ember/routing/route.ts", + "line": 370, + "description": "

Configuration hash for this route's queryParams. The possible\nconfiguration options and their defaults are as follows\n(assuming a query param whose controller property is page):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
queryParams = {\n  page: {\n    // By default, controller query param properties don't\n    // cause a full transition when they are changed, but\n    // rather only cause the URL to update. Setting\n    // `refreshModel` to true will cause an "in-place"\n    // transition to occur, whereby the model hooks for\n    // this route (and any child routes) will re-fire, allowing\n    // you to reload models (e.g., from the server) using the\n    // updated query param values.\n    refreshModel: false,\n\n    // By default, changes to controller query param properties\n    // cause the URL to update via `pushState`, which means an\n    // item will be added to the browser's history, allowing\n    // you to use the back button to restore the app to the\n    // previous state before the query param property was changed.\n    // Setting `replace` to true will use `replaceState` (or its\n    // hash location equivalent), which causes no browser history\n    // item to be added. This options name and default value are\n    // the same as the `link-to` helper's `replace` option.\n    replace: false,\n\n    // By default, the query param URL key is the same name as\n    // the controller property name. Use `as` to specify a\n    // different URL key.\n    as: 'page'\n  }\n};
\n
\n
\n \n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 423, + "description": "

The name of the template to use by default when rendering this route's\ntemplate.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/list.js
1\n2\n3\n4\n5\n
import Route from '@ember/routing/route';\n\nexport default class PostsListRoute extends Route {\n  templateName = 'posts/list';\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n
import PostsListRoute from '../posts/list';\n\nexport default class PostsIndexRoute extends PostsListRoute {};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/archived.js
1\n2\n3\n
import PostsListRoute from '../posts/list';\n\nexport default class PostsArchivedRoute extends PostsListRoute {};
\n
\n
\n \n", + "itemtype": "property", + "name": "templateName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 456, + "description": "

The name of the controller to associate with this route.

\n

By default, Ember will lookup a route's controller that matches the name\nof the route (i.e. posts.new). However,\nif you would like to define a specific controller to use, you can do so\nusing this property.

\n

This is useful in many ways, as the controller specified will be:

\n
    \n
  • passed to the setupController method.
  • \n
  • used as the controller for the template being rendered by the route.
  • \n
  • returned from a call to controllerFor for the route.
  • \n
\n", + "itemtype": "property", + "name": "controllerName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 479, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 510, + "description": "

The name of the route, dot-delimited.

\n

For example, a route found at app/routes/posts/post.js will have\na routeName of posts.post.

\n", + "itemtype": "property", + "name": "routeName", + "type": "String", + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 524, + "description": "

The name of the route, dot-delimited, including the engine prefix\nif applicable.

\n

For example, a route found at addon/routes/posts/post.js within an\nengine named admin will have a fullRouteName of admin.posts.post.

\n", + "itemtype": "property", + "name": "fullRouteName", + "type": "String", + "since": "2.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 588, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_activeQPChanged", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 729, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_optionsForQueryParam", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1807, + "description": "

Store property provides a hook for data persistence libraries to inject themselves.

\n

By default, this store property provides the exact same functionality previously\nin the model hook.

\n

Currently, the required interface is:

\n

store.find(modelName, findArguments)

\n", + "itemtype": "property", + "name": "store", + "type": "{Object}", + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1873, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_qp", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 2397, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.11.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/routing/route", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-RouterService-fdf945c5c4.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-RouterService-e16bc689e2.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-RouterService-fdf945c5c4.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-RouterService-e16bc689e2.json index bc26d6074..f1b0899b5 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-RouterService-fdf945c5c4.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-RouterService-e16bc689e2.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-RouterService", + "id": "ember-4.11.0-RouterService", "type": "class", "attributes": { "name": "RouterService", @@ -858,7 +858,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-Service", + "id": "ember-4.11.0-Service", "type": "class" } }, @@ -867,13 +867,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/routing/router-service", + "id": "ember-4.11.0-@ember/routing/router-service", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Service-296af98ef7.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-Service-aa0f8098cc.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Service-296af98ef7.json rename to json-docs/ember/4.11.0/classes/ember-4.11.0-Service-aa0f8098cc.json index 8a5d1752b..652f9727d 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Service-296af98ef7.json +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-Service-aa0f8098cc.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Service", + "id": "ember-4.11.0-Service", "type": "class", "attributes": { "name": "Service", @@ -512,7 +512,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.11.0-EmberObject", "type": "class" } }, @@ -520,19 +520,19 @@ "data": [ { "type": "class", - "id": "ember-4.12.1-RouterService" + "id": "ember-4.11.0-RouterService" } ] }, "module": { "data": { - "id": "ember-4.12.1-@ember/service", + "id": "ember-4.11.0-@ember/service", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.11.0", "type": "project-version" } } diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-String-8146cf6157.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-String-8146cf6157.json new file mode 100644 index 000000000..27b8c589e --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-String-8146cf6157.json @@ -0,0 +1,216 @@ +{ + "data": { + "id": "ember-4.11.0-String", + "type": "class", + "attributes": { + "name": "String", + "shortname": "String", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/string", + "namespace": "", + "file": "packages/@ember/string/index.ts", + "line": 74, + "description": "

Defines string helper methods including string formatting and localization.

\n", + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add the package `@ember/string` to your project to use in place of this module.", + "methods": [ + { + "file": "packages/@ember/string/index.ts", + "line": 82, + "description": "

Splits a string into separate units separated by spaces, eliminating any\nempty strings in the process.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { w } from '@ember/string';\n\nw("alpha beta gamma").forEach(function(key) {\n  console.log(key);\n});\n\n// > alpha\n// > beta\n// > gamma
\n
\n
\n \n", + "itemtype": "method", + "name": "w", + "params": [ + { + "name": "str", + "description": "The string to split", + "type": "String" + } + ], + "return": { + "description": "array containing the split strings", + "type": "Array" + }, + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add `@ember/string` to your package.json", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 109, + "description": "

Converts a camelized string into all lower case separated by underscores.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { decamelize } from '@ember/string';\n\ndecamelize('innerHTML');          // 'inner_html'\ndecamelize('action_name');        // 'action_name'\ndecamelize('css-class-name');     // 'css-class-name'\ndecamelize('my favorite items');  // 'my favorite items'
\n
\n
\n \n", + "itemtype": "method", + "name": "decamelize", + "params": [ + { + "name": "str", + "description": "The string to decamelize.", + "type": "String" + } + ], + "return": { + "description": "the decamelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add `@ember/string` to your package.json", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 132, + "description": "

Replaces underscores, spaces, or camelCase with dashes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { dasherize } from '@ember/string';\n\ndasherize('innerHTML');                // 'inner-html'\ndasherize('action_name');              // 'action-name'\ndasherize('css-class-name');           // 'css-class-name'\ndasherize('my favorite items');        // 'my-favorite-items'\ndasherize('privateDocs/ownerInvoice';  // 'private-docs/owner-invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "dasherize", + "params": [ + { + "name": "str", + "description": "The string to dasherize.", + "type": "String" + } + ], + "return": { + "description": "the dasherized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add `@ember/string` to your package.json", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 156, + "description": "

Returns the lowerCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { camelize } from '@ember/string';\n\ncamelize('innerHTML');                   // 'innerHTML'\ncamelize('action_name');                 // 'actionName'\ncamelize('css-class-name');              // 'cssClassName'\ncamelize('my favorite items');           // 'myFavoriteItems'\ncamelize('My Favorite Items');           // 'myFavoriteItems'\ncamelize('private-docs/owner-invoice');  // 'privateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "camelize", + "params": [ + { + "name": "str", + "description": "The string to camelize.", + "type": "String" + } + ], + "return": { + "description": "the camelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add `@ember/string` to your package.json", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 181, + "description": "

Returns the UpperCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { classify } from '@ember/string';\n\nclassify('innerHTML');                   // 'InnerHTML'\nclassify('action_name');                 // 'ActionName'\nclassify('css-class-name');              // 'CssClassName'\nclassify('my favorite items');           // 'MyFavoriteItems'\nclassify('private-docs/owner-invoice');  // 'PrivateDocs/OwnerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "classify", + "params": [ + { + "name": "str", + "description": "the string to classify", + "type": "String" + } + ], + "return": { + "description": "the classified string", + "type": "String" + }, + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add `@ember/string` to your package.json", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 205, + "description": "

More general than decamelize. Returns the lower_case_and_underscored\nform of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { underscore } from '@ember/string';\n\nunderscore('innerHTML');                 // 'inner_html'\nunderscore('action_name');               // 'action_name'\nunderscore('css-class-name');            // 'css_class_name'\nunderscore('my favorite items');         // 'my_favorite_items'\nunderscore('privateDocs/ownerInvoice');  // 'private_docs/owner_invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "underscore", + "params": [ + { + "name": "str", + "description": "The string to underscore.", + "type": "String" + } + ], + "return": { + "description": "the underscored string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add `@ember/string` to your package.json", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 230, + "description": "

Returns the Capitalized form of a string

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capitalize } from '@ember/string';\n\ncapitalize('innerHTML')                 // 'InnerHTML'\ncapitalize('action_name')               // 'Action_name'\ncapitalize('css-class-name')            // 'Css-class-name'\ncapitalize('my favorite items')         // 'My favorite items'\ncapitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "capitalize", + "params": [ + { + "name": "str", + "description": "The string to capitalize.", + "type": "String" + } + ], + "return": { + "description": "The capitalized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "deprecated": true, + "deprecationMessage": "Add `@ember/string` to your package.json", + "class": "String", + "module": "@ember/string" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/string", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/classes/ember-4.11.0-rsvp-4aed7510f7.json b/json-docs/ember/4.11.0/classes/ember-4.11.0-rsvp-4aed7510f7.json new file mode 100644 index 000000000..bb1abf01f --- /dev/null +++ b/json-docs/ember/4.11.0/classes/ember-4.11.0-rsvp-4aed7510f7.json @@ -0,0 +1,445 @@ +{ + "data": { + "id": "ember-4.11.0-rsvp", + "type": "class", + "attributes": { + "name": "rsvp", + "shortname": "rsvp", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/all-settled.js", + "line": 20, + "description": "

RSVP.allSettled is similar to RSVP.all, but instead of implementing\na fail-fast method, it waits until all the promises have returned and\nshows you all the results. This is useful if you want to handle multiple\npromises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled. The return promise is fulfilled with an array of the states of\nthe promises passed into the promises array argument.

\n

Each state object will either indicate fulfillment or rejection, and\nprovide the corresponding value or reason. The states will take one of\nthe following formats:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{ state: 'fulfilled', value: value }\n  or\n{ state: 'rejected', reason: reason }
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
let promise1 = RSVP.Promise.resolve(1);\nlet promise2 = RSVP.Promise.reject(new Error('2'));\nlet promise3 = RSVP.Promise.reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nRSVP.allSettled(promises).then(function(array){\n  // array == [\n  //   { state: 'fulfilled', value: 1 },\n  //   { state: 'rejected', reason: Error },\n  //   { state: 'rejected', reason: Error }\n  // ]\n  // Note that for the second item, reason.message will be '2', and for the\n  // third item, reason.message will be '3'.\n}, function(error) {\n  // Not run. (This block would only be called if allSettled had failed,\n  // for instance if passed an incorrect argument type.)\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "allSettled", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "entries", + "description": "", + "type": "Array" + }, + { + "name": "label", + "description": "- optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with an array of the settled\nstates of the constituent promises.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/all.js", + "line": 3, + "description": "

This is a convenient alias for Promise.all.

\n", + "itemtype": "method", + "name": "all", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/defer.js", + "line": 3, + "description": "

defer returns an object similar to jQuery's $.Deferred.\ndefer should be used when porting over code reliant on $.Deferred's\ninterface. New code should use the Promise constructor instead.

\n

The object returned from defer is a plain object with three properties:

\n
    \n
  • promise - an Promise.
  • \n
  • reject - a function that causes the promise property on this object to\nbecome rejected
  • \n
  • resolve - a function that causes the promise property on this object to\nbecome fulfilled.
  • \n
\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let deferred = defer();\n\ndeferred.resolve("Success!");\n\ndeferred.promise.then(function(value){\n  // value here is "Success!"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "defer", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 19, + "description": "

EventTarget.mixin extends an object with EventTarget methods. For\nExample:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import EventTarget from 'rsvp';\n\nlet object = {};\n\nEventTarget.mixin(object);\n\nobject.on('finished', function(event) {\n  // handle event\n});\n\nobject.trigger('finished', { detail: value });
\n
\n
\n \n

EventTarget.mixin also works with prototypes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EventTarget from 'rsvp';\n\nlet Person = function() {};\nEventTarget.mixin(Person.prototype);\n\nlet yehuda = new Person();\nlet tom = new Person();\n\nyehuda.on('poke', function(event) {\n  console.log('Yehuda says OW');\n});\n\ntom.on('poke', function(event) {\n  console.log('Tom says OW');\n});\n\nyehuda.trigger('poke');\ntom.trigger('poke');
\n
\n
\n \n", + "itemtype": "method", + "name": "mixin", + "access": "private", + "tagname": "", + "params": [ + { + "name": "object", + "description": "object to extend with EventTarget methods", + "type": "Object" + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 107, + "description": "

You can use off to stop firing a particular callback for an event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function doStuff() { // do stuff! }\nobject.on('stuff', doStuff);\n\nobject.trigger('stuff'); // doStuff will be called\n\n// Unregister ONLY the doStuff callback\nobject.off('stuff', doStuff);\nobject.trigger('stuff'); // doStuff will NOT be called
\n
\n
\n \n

If you don't pass a callback argument to off, ALL callbacks for the\nevent will not be executed when the event fires. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let callback1 = function(){};\nlet callback2 = function(){};\n\nobject.on('stuff', callback1);\nobject.on('stuff', callback2);\n\nobject.trigger('stuff'); // callback1 and callback2 will be executed.\n\nobject.off('stuff');\nobject.trigger('stuff'); // callback1 and callback2 will not be executed!
\n
\n
\n \n", + "itemtype": "method", + "name": "off", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "event to stop listening to", + "type": "String" + }, + { + "name": "callback", + "description": "optional argument. If given, only the function\ngiven will be removed from the event's callback queue. If no `callback`\nargument is given, all callbacks will be removed from the event's callback\nqueue.", + "type": "Function", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 162, + "description": "

Use trigger to fire custom events. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
object.on('foo', function(){\n  console.log('foo event happened!');\n});\nobject.trigger('foo');\n// 'foo event happened!' logged to the console
\n
\n
\n \n

You can also pass a value as a second argument to trigger that will be\npassed as an argument to all event listeners for the event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
object.on('foo', function(value){\n  console.log(value.name);\n});\n\nobject.trigger('foo', { name: 'bar' });\n// 'bar' logged to the console
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "name of the event to be triggered", + "type": "String" + }, + { + "name": "options", + "description": "optional value to be passed to any event handlers for\nthe given `eventName`", + "type": "*", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/filter.js", + "line": 42, + "description": "

filter is similar to JavaScript's native filter method.\nfilterFn is eagerly called meaning that as soon as any promise\n resolves its value will be passed to filterFn. filter returns\n a promise that will become fulfilled with the result of running\n filterFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { filter, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\n\nlet promises = [promise1, promise2, promise3];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(result){\n  // result is [ 2, 3 ]\n});
\n
\n
\n \n

If any of the promises given to filter are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { filter, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

filter will also wait for any promises returned from filterFn.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter, resolve } from 'rsvp';\n\nlet alice = { name: 'alice' };\nlet bob   = { name: 'bob' };\nlet users = [ alice, bob ];\n\nlet promises = users.map(function(user){\n  return resolve(user);\n});\n\nlet filterFn = function(user){\n  // Here, Alice has permissions to create a blog post, but Bob does not.\n  return getPrivilegesForUser(user).then(function(privs){\n    return privs.can_create_blog_post === true;\n  });\n};\nfilter(promises, filterFn).then(function(users){\n  // true, because the server told us only Alice can create a blog post.\n  users.length === 1;\n  // false, because Alice is the only user present in `users`\n  users[0] === bob;\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "filterFn", + "description": "- function to be called on each resolved value to\n filter the final results.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string describing the promise. Useful for\n tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash-settled.js", + "line": 16, + "description": "

hashSettled is similar to allSettled, but takes an object\ninstead of an array for its promises argument.

\n

Unlike all or hash, which implement a fail-fast method,\nbut like allSettled, hashSettled waits until all the\nconstituent promises have returned and then shows you all the results\nwith their states and values/reasons. This is useful if you want to\nhandle multiple promises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled, or rejected if the passed parameters are invalid.

\n

The returned promise is fulfilled with a hash that has the same key names as\nthe promises object argument. If any of the values in the object are not\npromises, they will be copied over to the fulfilled object and marked with state\n'fulfilled'.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: { state: 'fulfilled', value: 1 },\n  //   yourPromise: { state: 'fulfilled', value: 2 },\n  //   theirPromise: { state: 'fulfilled', value: 3 },\n  //   notAPromise: { state: 'fulfilled', value: 4 }\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the state will\nbe set to 'rejected' and the reason for rejection provided.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, reject, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejection')),\n  anotherRejectedPromise: reject(new Error('more rejection')),\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise:              { state: 'fulfilled', value: 1 },\n  //   rejectedPromise:        { state: 'rejected', reason: Error },\n  //   anotherRejectedPromise: { state: 'rejected', reason: Error },\n  // }\n  // Note that for rejectedPromise, reason.message == 'rejection',\n  // and for anotherRejectedPromise, reason.message == 'more rejection'.\n});
\n
\n
\n \n

An important note: hashSettled is intended for plain JavaScript objects that\nare just a set of keys and values. hashSettled will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import Promise, { hashSettled, resolve } from 'rsvp';\n\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: Promise.resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhashSettled(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: { state: 'fulfilled', value: 'Example' }\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hashSettled", + "access": "public", + "tagname": "", + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when when all properties of `promises`\nhave been settled.", + "type": "Promise" + }, + "static": 1, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash.js", + "line": 4, + "description": "

hash is similar to all, but takes an object instead of an array\nfor its promises argument.

\n

Returns a promise that is fulfilled when all the given promises have been\nfulfilled, or rejected if any of them become rejected. The returned promise\nis fulfilled with a hash that has the same key names as the promises object\nargument. If any of the values in the object are not promises, they will\nsimply be copied over to the fulfilled object.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhash(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: 1,\n  //   yourPromise: 2,\n  //   theirPromise: 3,\n  //   notAPromise: 4\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the first promise\nthat is rejected will be given as the reason to the rejection handler.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejectedPromise')),\n  anotherRejectedPromise: reject(new Error('anotherRejectedPromise')),\n};\n\nhash(promises).then(function(hash){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === 'rejectedPromise'\n});
\n
\n
\n \n

An important note: hash is intended for plain JavaScript objects that\nare just a set of keys and values. hash will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { hash, resolve } from 'rsvp';\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhash(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: 'Example'\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all properties of `promises`\nhave been fulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/map.js", + "line": 39, + "description": "

map is similar to JavaScript's native map method. mapFn is eagerly called\n meaning that as soon as any promise resolves its value will be passed to mapFn.\n map returns a promise that will become fulfilled with the result of running\n mapFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(result){\n  // result is [ 2, 3, 4 ]\n});
\n
\n
\n \n

If any of the promises given to map are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { map, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

map will also wait if a promise is returned from mapFn. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first because they contain a url to those comments.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map } from 'rsvp';\n\nlet mapFn = function(blogPost){\n  // getComments does some ajax and returns an Promise that is fulfilled\n  // with some comments data\n  return getComments(blogPost.comments_url);\n};\n\n// getBlogPosts does some ajax and returns an Promise that is fulfilled\n// with some blog post data\nmap(getBlogPosts(), mapFn).then(function(comments){\n  // comments is the result of asking the server for the comments\n  // of all blog posts returned from getBlogPosts()\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "mapFn", + "description": "function to be called on each fulfilled promise.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\n Useful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/node.js", + "line": 44, + "description": "

denodeify takes a 'node-style' function and returns a function that\nwill return an Promise. You can use denodeify in Node.js or the\nbrowser when you'd prefer to use promises over using callbacks. For example,\ndenodeify transforms the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) return handleError(err);\n  handleData(data);\n});
\n
\n
\n \n

into:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\n\nreadFile('myfile.txt').then(handleData, handleError);
\n
\n
\n \n

If the node function has multiple success parameters, then denodeify\njust returns the first one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let request = denodeify(require('request'));\n\nrequest('http://example.com').then(function(res) {\n  // ...\n});
\n
\n
\n \n

However, if you need all success parameters, setting denodeify's\nsecond parameter to true causes it to return all success parameters\nas an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), true);\n\nrequest('http://example.com').then(function(result) {\n  // result[0] -> res\n  // result[1] -> body\n});
\n
\n
\n \n

Or if you pass it an array with names it returns the parameters as a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), ['res', 'body']);\n\nrequest('http://example.com').then(function(result) {\n  // result.res\n  // result.body\n});
\n
\n
\n \n

Sometimes you need to retain the this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let app = require('express')();\nlet render = denodeify(app.render.bind(app));
\n
\n
\n \n

The denodified function inherits from the original function. It works in all\nenvironments, except IE 10 and below. Consequently all properties of the original\nfunction are available to you. However, any properties you change on the\ndenodeified function won't be changed on the original function. Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request')),\n    cookieJar = request.jar(); // <- Inheritance is used here\n\nrequest('http://example.com', {jar: cookieJar}).then(function(res) {\n  // cookieJar.cookies holds now the cookies returned by example.com\n});
\n
\n
\n \n

Using denodeify makes it easier to compose asynchronous operations instead\nof using callbacks. For example, instead of:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) { ... } // Handle error\n  fs.writeFile('myfile2.txt', data, function(err){\n    if (err) { ... } // Handle error\n    console.log('done')\n  });\n});
\n
\n
\n \n

you can chain the operations together using then from the returned promise:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\nlet writeFile = denodeify(fs.writeFile);\n\nreadFile('myfile.txt').then(function(data){\n  return writeFile('myfile2.txt', data);\n}).then(function(){\n  console.log('done')\n}).catch(function(error){\n  // Handle error\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "denodeify", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "nodeFunc", + "description": "a 'node-style' function that takes a callback as\nits last argument. The callback expects an error to be passed as its first\nargument (if an error occurred, otherwise null), and the value from the\noperation as its second argument ('function(err, value){ }').", + "type": "Function" + }, + { + "name": "options", + "description": "An optional paramter that if set\nto `true` causes the promise to fulfill with the callback's success arguments\nas an array. This is useful if the node function has multiple success\nparamters. If you set this paramter to an array with names, the promise will\nfulfill with a hash with these names as keys and the success parameters as\nvalues.", + "type": "Boolean|Array", + "optional": true + } + ], + "return": { + "description": "a function that wraps `nodeFunc` to return a `Promise`", + "type": "Function" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/race.js", + "line": 3, + "description": "

This is a convenient alias for Promise.race.

\n", + "itemtype": "method", + "name": "race", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/reject.js", + "line": 3, + "description": "

This is a convenient alias for Promise.reject.

\n", + "itemtype": "method", + "name": "reject", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/resolve.js", + "line": 3, + "description": "

This is a convenient alias for Promise.resolve.

\n", + "itemtype": "method", + "name": "resolve", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "value", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/rethrow.js", + "line": 1, + "description": "

rethrow will rethrow an error on the next turn of the JavaScript event\nloop in order to aid debugging.

\n

Promises A+ specifies that any exceptions that occur with a promise must be\ncaught by the promises implementation and bubbled to the last handler. For\nthis reason, it is recommended that you always specify a second rejection\nhandler function to then. However, rethrow will throw the exception\noutside of the promise, so it bubbles up to your console if in the browser,\nor domain/cause uncaught exception in Node. rethrow will also throw the\nerror again so the error can be handled by the promise per the spec.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { rethrow } from 'rsvp';\n\nfunction throws(){\n  throw new Error('Whoops!');\n}\n\nlet promise = new Promise(function(resolve, reject){\n  throws();\n});\n\npromise.catch(rethrow).then(function(){\n  // Code here doesn't run because the promise became rejected due to an\n  // error!\n}, function (err){\n  // handle the error here\n});
\n
\n
\n \n

The 'Whoops' error will be thrown on the next turn of the event loop\nand you can watch for it in your console. You can also handle it using a\nrejection handler given to .then or .catch on the returned promise.

\n", + "itemtype": "method", + "name": "rethrow", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "reason the promise became rejected.", + "type": "Error" + } + ], + "throws": { + "description": "Error" + }, + "class": "rsvp", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/modules/ember-4.11.0-@ember/component-00fc10b8a2.json b/json-docs/ember/4.11.0/modules/ember-4.11.0-@ember/component-00fc10b8a2.json new file mode 100644 index 000000000..4efab660c --- /dev/null +++ b/json-docs/ember/4.11.0/modules/ember-4.11.0-@ember/component-00fc10b8a2.json @@ -0,0 +1,89 @@ +{ + "data": { + "id": "ember-4.11.0-@ember/component", + "type": "module", + "attributes": { + "name": "@ember/component", + "submodules": {}, + "elements": {}, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/component": 1, + "Ember.Templates.components": 1, + "@ember/component/helper": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 73, + "description": "

Glimmer is a templating engine used by Ember.js that is compatible with a subset of the Handlebars syntax.

\n

Showing a property

\n

Templates manage the flow of an application's UI, and display state (through\nthe DOM) to a user. For example, given a component with the property "name",\nthat component's template can use the name in several ways:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  name: 'Jill'\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
{{this.name}}\n<div>{{this.name}}</div>\n<span data-name={{this.name}}></span>
\n
\n
\n \n

Any time the "name" property on the component changes, the DOM will be\nupdated.

\n

Properties can be chained as well:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{@aUserModel.name}}\n<div>{{@listOfUsers.firstObject.name}}</div>
\n
\n
\n \n

Using Ember helpers

\n

When content is passed in mustaches {{}}, Ember will first try to find a helper\nor component with that name. For example, the if helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
{{if this.name "I have a name" "I have no name"}}\n<span data-has-name={{if this.name true}}></span>
\n
\n
\n \n

The returned value is placed where the {{}} is called. The above style is\ncalled "inline". A second style of helper usage is called "block". For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#if this.name}}\n  I have a name\n{{else}}\n  I have no name\n{{/if}}
\n
\n
\n \n

The block form of helpers allows you to control how the UI is created based\non the values of properties.\nA third form of helper is called "nested". For example here the concat\nhelper will add " Doe" to a displayed name if the person has no last name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<span data-name={{concat this.firstName (\n  if this.lastName (concat " " this.lastName) "Doe"\n)}}></span>
\n
\n
\n \n

Ember's built-in helpers are described under the Ember.Templates.helpers\nnamespace. Documentation on creating custom helpers can be found under\nhelper (or\nunder Helper if a helper requires access to\ndependency injection).

\n

Invoking a Component

\n

Ember components represent state to the UI of an application. Further\nreading on components can be found under Component.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "Component", + "Helper" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 47, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "allstaticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 47, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "version": "4.11.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/modules/ember-4.11.0-@glimmer/component-bb142d144c.json b/json-docs/ember/4.11.0/modules/ember-4.11.0-@glimmer/component-bb142d144c.json new file mode 100644 index 000000000..40848697f --- /dev/null +++ b/json-docs/ember/4.11.0/modules/ember-4.11.0-@glimmer/component-bb142d144c.json @@ -0,0 +1,36 @@ +{ + "data": { + "id": "ember-4.11.0-@glimmer/component", + "type": "module", + "attributes": { + "name": "@glimmer/component", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts", + "line": 1, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault components for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Template-only and Glimmer components. If you\nare looking for the API documentation for Classic components, it is\navailable here. The source code for\nGlimmer components can be found in @glimmer/component.

\n

Defining a Template-only Component

\n

The simplest way to create a component is to create a template file in\napp/templates/components. For example, if you name a template\napp/templates/components/person-profile.hbs:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
<h1>{{@person.name}}</h1>\n<img src={{@person.avatar}}>\n<p class='signature'>{{@person.signature}}</p>
\n
\n
\n \n

You will be able to use <PersonProfile /> to invoke this component elsewhere\nin your application:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<PersonProfile @person={{this.currentUser}} />
\n
\n
\n \n

Note that component names are capitalized here in order to distinguish them\nfrom regular HTML elements, but they are dasherized in the file system.

\n

While the angle bracket invocation form is generally preferred, it is also\npossible to invoke the same component with the {{person-profile}} syntax:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person-profile person=this.currentUser}}
\n
\n
\n \n

Note that with this syntax, you use dashes in the component name and\narguments are passed without the @ sign.

\n

In both cases, Ember will render the content of the component template we\ncreated above. The end result will be something like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\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 \n

File System Nesting

\n

Components can be nested inside sub-folders for logical groupping. For\nexample, if we placed our template in\napp/templates/components/person/short-profile.hbs, we can invoke it as\n<Person::ShortProfile />:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Person::ShortProfile @person={{this.currentUser}} />
\n
\n
\n \n

Or equivalently, {{person/short-profile}}:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person/short-profile person=this.currentUser}}
\n
\n
\n \n

Using Blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield}}
\n
\n
\n \n

We could then invoke it like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}}>\n  <p>Admin mode</p>\n</PersonProfile>
\n
\n
\n \n

or with curly syntax like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-profile person=this.currentUser}}\n  <p>Admin mode</p>\n{{/person-profile}}
\n
\n
\n \n

And 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

Blocks are executed in their original context, meaning they have access to the\nscope and any in-scope variables where they were defined.

\n

Passing parameters to blocks

\n

You can also pass positional parameters to {{yield}}, which are then made\navailable in the block:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

We can then use this value in the block like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}} as |signature|>\n  {{signature}}\n</PersonProfile>
\n
\n
\n \n

Passing multiple blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield to="title"}}</h1>\n{{yield}}
\n
\n
\n \n

This component could then be invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title>{{this.currentUser.name}}</:title>\n  <:default>{{this.currentUser.signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

When 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

Passing parameters to named blocks

\n

You can also pass parameters to named blocks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield @person.name to="title"}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

These parameters can then be used like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title as |name|>{{name}}</:title>\n  <:default as |signature|>{{signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

Checking to see if a block exists

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\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
\n \n

With this template, we can then optionally pass in one block, both blocks, or\nnone at all:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\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 \n

Checking to see if a block has parameters

\n

We can also check if a block receives parameters using the (has-block-params)\nkeyword, and conditionally yield different values if so.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
{{#if (has-block-params)}}\n  {{yield @person.signature}}\n{{else}}\n  {{yield}}\n{{/if}}
\n
\n
\n \n

Customizing Components With JavaScript

\n

To 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\nPersonProfile component which we defined above, we would create\napp/components/person-profile.js and export our class as the default, like\nso:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n \n

You 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\ndisplayName property of our PersonProfile component instance in the\ntemplate like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

constructor

\n

params: owner object and args object

\n

Constructs 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import 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
\n \n

Service injections and arguments are available in the constructor.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import 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 \n

willDestroy

\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import 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 \n

args

\n

The args property of Glimmer components is an object that contains the\narguments that are passed to the component. For instance, the\nfollowing component usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @fadeIn={{true}} />
\n
\n
\n \n

Would result in the following args object to be passed to the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ fadeIn: true }
\n
\n
\n \n

args can be accessed at any point in the component lifecycle, including\nconstructor and willDestroy. They are also automatically marked as tracked\nproperties, and they can be depended on as computed property dependencies:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import 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 \n

isDestroying

\n

A boolean flag to tell if the component is in the process of destroying. This is set to\ntrue before willDestroy is called.

\n

isDestroyed

\n

A boolean to tell if the component has been fully destroyed. This is set to true\nafter willDestroy is called.

\n", + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "4.11.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/namespaces/ember-4.11.0-AutoLocation-3689d9e585.json b/json-docs/ember/4.11.0/namespaces/ember-4.11.0-AutoLocation-3689d9e585.json new file mode 100644 index 000000000..6ef2bfcb0 --- /dev/null +++ b/json-docs/ember/4.11.0/namespaces/ember-4.11.0-AutoLocation-3689d9e585.json @@ -0,0 +1,129 @@ +{ + "data": { + "id": "ember-4.11.0-AutoLocation", + "type": "namespace", + "attributes": { + "name": "AutoLocation", + "shortname": "AutoLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/auto-location", + "namespace": "", + "file": "packages/@ember/routing/auto-location.ts", + "line": 21, + "description": "

AutoLocation will select the best location option based off browser\nsupport with the priority order: history, hash, none.

\n

Clean pushState paths accessed by hashchange-only browsers will be redirected\nto the hash-equivalent and vice versa so future transitions are consistent.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n

Browsers that support the history API will use HistoryLocation, those that\ndo not, but still support the hashchange event will use HashLocation, and\nin the rare case neither is supported will use NoneLocation.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'auto'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new for modern browsers that\nsupport the history api or /#/posts/new for older ones, like Internet\nExplorer 9 and below.

\n

When a user visits a link to your application, they will be automatically\nupgraded or downgraded to the appropriate Location class, with the URL\ntransformed accordingly, if needed.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n", + "static": 1, + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 353, + "access": "private", + "tagname": "Returns the current path as it should appear for HashLocation supported\nbrowsers. This may very well differ from the real current path.", + "itemtype": "method", + "name": "_getHashPath", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 79, + "access": "private", + "tagname": "Will be pre-pended to path upon state change.", + "since": "1.5.1", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + }, + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 91, + "access": "private", + "tagname": "The browser's `location` object. This is typically equivalent to\n`window.location`, but may be overridden for testing.", + "itemtype": "property", + "name": "location", + "default": "environment.location", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + }, + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 103, + "access": "private", + "tagname": "The browser's `history` object. This is typically equivalent to\n`window.history`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "history", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + }, + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 116, + "access": "private", + "tagname": "The user agent's global variable. In browsers, this will be `window`.", + "since": "1.11", + "itemtype": "property", + "name": "global", + "default": "window", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + }, + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 128, + "access": "private", + "tagname": "The browser's `userAgent`. This is typically equivalent to\n`navigator.userAgent`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "userAgent", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + }, + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 141, + "access": "private", + "tagname": "This property is used by the router to know whether to cancel the routing\nsetup process, which is needed while we redirect the browser.", + "since": "1.5.1", + "itemtype": "property", + "name": "cancelRouterSetup", + "default": "false", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/routing/auto-location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.11.0/namespaces/ember-4.11.0-Instrumentation-2948023931.json b/json-docs/ember/4.11.0/namespaces/ember-4.11.0-Instrumentation-2948023931.json new file mode 100644 index 000000000..7690c773c --- /dev/null +++ b/json-docs/ember/4.11.0/namespaces/ember-4.11.0-Instrumentation-2948023931.json @@ -0,0 +1,46 @@ +{ + "data": { + "id": "ember-4.11.0-Instrumentation", + "type": "namespace", + "attributes": { + "name": "Instrumentation", + "shortname": "Instrumentation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/instrumentation", + "namespace": "", + "file": "packages/@ember/instrumentation/index.ts", + "line": 39, + "description": "

The purpose of the Ember Instrumentation module is\nto provide efficient, general-purpose instrumentation\nfor Ember.

\n

Subscribe to a listener by using subscribe:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { subscribe } from '@ember/instrumentation';\n\nsubscribe("render", {\n  before(name, timestamp, payload) {\n\n  },\n\n  after(name, timestamp, payload) {\n\n  }\n});
\n
\n
\n \n

If you return a value from the before callback, that same\nvalue will be passed as a fourth parameter to the after\ncallback.

\n

Instrument a block of code by using instrument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { instrument } from '@ember/instrumentation';\n\ninstrument("render.handlebars", payload, function() {\n  // rendering logic\n}, binding);
\n
\n
\n \n

Event names passed to instrument are namespaced\nby periods, from more general to more specific. Subscribers\ncan listen for events by whatever level of granularity they\nare interested in.

\n

In the above example, the event is render.handlebars,\nand the subscriber listened for all events beginning with\nrender. It would receive callbacks for events named\nrender, render.handlebars, render.container, or\neven render.handlebars.layout.

\n", + "static": 1, + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.11.0-@ember/instrumentation", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.11.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/application-b0060415b4.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/application-b0060415b4.json new file mode 100644 index 000000000..8ad62f29f --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/application-b0060415b4.json @@ -0,0 +1,89 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/application", + "type": "class", + "attributes": { + "name": "@ember/application", + "shortname": "@ember/application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 14, + "description": "

Detects when a specific package of Ember (e.g. 'Application')\nhas fully loaded and is available for extension.

\n

The provided callback will be called with the name passed\nresolved from a string into the object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { onLoad } from '@ember/application';\n\nonLoad('Ember.Application' function(hbars) {\n  hbars.registerHelper(...);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "onLoad", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "callback", + "description": "callback to be called", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 47, + "description": "

Called when an Ember.js package (e.g Application) has finished\nloading. Triggers any callbacks registered for this event.

\n", + "itemtype": "method", + "name": "runLoadHooks", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "object", + "description": "object to pass to callbacks", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/array-0f6574653d.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/array-77f9d2fa5d.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/array-0f6574653d.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/array-77f9d2fa5d.json index 10495977a..169de6eeb 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/array-0f6574653d.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/array-77f9d2fa5d.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/array", + "id": "ember-4.12.3-@ember/array", "type": "class", "attributes": { "name": "@ember/array", @@ -174,13 +174,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/component-f80a72fc72.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/component-c185c8f0a1.json similarity index 94% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/component-f80a72fc72.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/component-c185c8f0a1.json index 9f2fa0057..4dd0f80b2 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/component-f80a72fc72.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/component-c185c8f0a1.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/component", + "id": "ember-4.12.3-@ember/component", "type": "class", "attributes": { "name": "@ember/component", @@ -54,13 +54,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/component", + "id": "ember-4.12.3-@ember/component", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/component/helper-a4ae953c59.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/component/helper-a4ae953c59.json new file mode 100644 index 000000000..2fef2c287 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/component/helper-a4ae953c59.json @@ -0,0 +1,61 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/component/helper", + "type": "class", + "attributes": { + "name": "@ember/component/helper", + "shortname": "@ember/component/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 47, + "description": "

In many cases it is not necessary to use the full Helper class.\nThe helper method create pure-function helpers without instances.\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n
import { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n  return `${currency}${cents * 0.01}`;\n});
\n
\n
\n \n", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/component/template-only-348f94d828.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/component/template-only-a96fa608b4.json similarity index 94% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/component/template-only-348f94d828.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/component/template-only-a96fa608b4.json index 6e2d1656f..f8c47724c 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/component/template-only-348f94d828.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/component/template-only-a96fa608b4.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/component/template-only", + "id": "ember-4.12.3-@ember/component/template-only", "type": "class", "attributes": { "name": "@ember/component/template-only", @@ -51,13 +51,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/component/template-only", + "id": "ember-4.12.3-@ember/component/template-only", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/debug-10b4bd9991.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/debug-10b4bd9991.json new file mode 100644 index 000000000..e202d9088 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/debug-10b4bd9991.json @@ -0,0 +1,334 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/debug", + "type": "class", + "attributes": { + "name": "@ember/debug", + "shortname": "@ember/debug", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 917, + "description": "

Allows checking if a given property on an object is a computed property. For the most part,\nthis doesn't matter (you would normally just access the property directly and use its value),\nbut for some tooling specific scenarios (e.g. the ember-inspector) it is important to\ndifferentiate if a property is a computed property or a "normal" property.

\n

This will work on either a class's prototype or an instance itself.

\n", + "static": 1, + "itemtype": "method", + "name": "isComputed", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/object" + }, + { + "file": "packages/@ember/debug/lib/capture-render-tree.ts", + "line": 9, + "description": "

Ember Inspector calls this function to capture the current render tree.

\n

In production mode, this requires turning on ENV._DEBUG_RENDER_TREE\nbefore loading Ember.

\n", + "access": "private", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "captureRenderTree", + "params": [ + { + "name": "app", + "description": "An `ApplicationInstance`.", + "type": "ApplicationInstance" + } + ], + "since": "3.14.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 39, + "description": "

Allows for runtime registration of handler functions that override the default deprecation behavior.\nDeprecations are invoked by calls to @ember/debug/deprecate.\nThe following example demonstrates its usage by registering a handler that throws an error if the\nmessage contains the word "should", otherwise defers to the default handler.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { registerDeprecationHandler } from '@ember/debug';\n\nregisterDeprecationHandler((message, options, next) => {\n  if (message.indexOf('should') !== -1) {\n    throw new Error(`Deprecation message with should: ${message}`);\n  } else {\n    // defer to whatever handler was registered before this one\n    next(message, options);\n  }\n});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the deprecation call.
  • \n
  • options - An object passed in with the deprecation call containing additional information including:
  • \n
      \n
    • id - An id of the deprecation in the form of package-name.specific-deprecation.
    • \n
    • until - The Ember version number the feature and deprecation will be removed in.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerDeprecationHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle deprecation calls.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 184, + "description": "

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only).

\n

Ember itself leverages Semantic Versioning to aid\nprojects in keeping up with changes to the framework. Before any\nfunctionality or API is removed, it first flows linearly through a\ndeprecation staging process. The staging process currently contains two\nstages: available and enabled.

\n

Deprecations are initially released into the 'available' stage.\nDeprecations will stay in this stage until the replacement API has been\nmarked as a recommended practice via the RFC process and the addon\necosystem has generally adopted the change.

\n

Once a deprecation meets the above criteria, it will move into the\n'enabled' stage where it will remain until the functionality or API is\neventually removed.

\n

For application and addon developers, "available" deprecations are not\nurgent and "enabled" deprecations require action.

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { deprecate } from '@ember/debug';\n\ndeprecate(\n  'Use of `assign` has been deprecated. Please use `Object.assign` or the spread operator instead.',\n  false,\n  {\n    id: 'ember-polyfills.deprecate-assign',\n    until: '5.0.0',\n    url: 'https://deprecations.emberjs.com/v4.x/#toc_ember-polyfills-deprecate-assign',\n    for: 'ember-source',\n    since: {\n      available: '4.0.0',\n      enabled: '4.0.0',\n    },\n  }\n);
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecate", + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "test", + "description": "A boolean. If falsy, the deprecation will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "", + "type": "Object", + "props": [ + { + "name": "id", + "description": "A unique id for this deprecation. The id can be\n used by Ember debugging tools to change the behavior (raise, log or silence)\n for that specific deprecation. The id should be namespaced by dots, e.g.\n \"view.helper.select\".", + "type": "String" + }, + { + "name": "until", + "description": "The version of Ember when this deprecation\n warning will be removed.", + "type": "String" + }, + { + "name": "for", + "description": "A namespace for the deprecation, usually the package name", + "type": "String" + }, + { + "name": "since", + "description": "Describes when the deprecation became available and enabled.", + "type": "Object" + }, + { + "name": "url", + "description": "An optional url to the transition guide on the\n emberjs.com website.", + "type": "String", + "optional": true + } + ] + } + ], + "static": 1, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/inspect.ts", + "line": 15, + "description": "

Convenience method to inspect an object. This method will attempt to\nconvert the object into a useful string description.

\n

It is a pretty simple implementation. If you want something more robust,\nuse something like JSDump: https://github.com/NV/jsDump

\n", + "itemtype": "method", + "name": "inspect", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object you want to inspect.", + "type": "Object" + } + ], + "return": { + "description": "A description of the object", + "type": "String" + }, + "since": "1.4.0", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 24, + "description": "

Allows for runtime registration of handler functions that override the default warning behavior.\nWarnings are invoked by calls made to @ember/debug/warn.\nThe following example demonstrates its usage by registering a handler that does nothing overriding Ember's\ndefault warning behavior.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { registerWarnHandler } from '@ember/debug';\n\n// next is not called, so no warnings get the default behavior\nregisterWarnHandler(() => {});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the warn call.
  • \n
  • options - An object passed in with the warn call containing additional information including:
  • \n
      \n
    • id - An id of the warning in the form of package-name.specific-warning.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWarnHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle warnings.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 71, + "description": "

Display a warning with the provided message.

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { warn } from '@ember/debug';\nimport tomsterCount from './tomster-counter'; // a module in my project\n\n// Log a warning if we have more than 3 tomsters\nwarn('Too many tomsters!', tomsterCount <= 3, {\n  id: 'ember-debug.too-many-tomsters'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "warn", + "static": 1, + "params": [ + { + "name": "message", + "description": "A warning to display.", + "type": "String" + }, + { + "name": "test", + "description": "An optional boolean. If falsy, the warning\n will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "An object that can be used to pass a unique\n `id` for this warning. The `id` can be used by Ember debugging tools\n to change the behavior (raise, log, or silence) for that specific warning.\n The `id` should be namespaced by dots, e.g. \"ember-debug.feature-flag-with-features-stripped\"", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 134, + "description": "

Verify that a certain expectation is met, or throw a exception otherwise.

\n

This is useful for communicating assumptions in the code to other human\nreaders as well as catching bugs that accidentally violates these\nexpectations.

\n

Assertions are removed from production builds, so they can be freely added\nfor documentation and debugging purposes without worries of incuring any\nperformance penalty. However, because of that, they should not be used for\nchecks that could reasonably fail during normal usage. Furthermore, care\nshould be taken to avoid accidentally relying on side-effects produced from\nevaluating the condition itself, since the code will not run in production.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assert } from '@ember/debug';\n\n// Test for truthiness\nassert('Must pass a string', typeof str === 'string');\n\n// Fail unconditionally\nassert('This code path should never be run');
\n
\n
\n \n", + "itemtype": "method", + "name": "assert", + "static": 1, + "params": [ + { + "name": "description", + "description": "Describes the expectation. This will become the\n text of the Error thrown if the assertion fails.", + "type": "String" + }, + { + "name": "condition", + "description": "Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.", + "type": "Any" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 174, + "description": "

Display a debug notice.

\n

Calls to this function are not invoked in production builds.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { debug } from '@ember/debug';\n\ndebug('I\\'m a debug notice!');
\n
\n
\n \n", + "itemtype": "method", + "name": "debug", + "static": 1, + "params": [ + { + "name": "message", + "description": "A debug message to display.", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 195, + "description": "

Display an info notice.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n", + "itemtype": "method", + "name": "info", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 214, + "description": "

Alias an old, deprecated method with its new counterpart.

\n

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only) when the assigned method is called.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { deprecateFunc } from '@ember/debug';\n\nEmber.oldMethod = deprecateFunc('Please use the new, updated method', options, Ember.newMethod);
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecateFunc", + "static": 1, + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "options", + "description": "The options object for `deprecate`.", + "type": "Object", + "optional": true + }, + { + "name": "func", + "description": "The new function called to replace its deprecated counterpart.", + "type": "Function" + } + ], + "return": { + "description": "A new function that wraps the original function with a deprecation warning", + "type": "Function" + }, + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 259, + "description": "

Run a function meant for debugging.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport { runInDebug } from '@ember/debug';\n\nrunInDebug(() => {\n  Component.reopen({\n    didInsertElement() {\n      console.log("I'm happy");\n    }\n  });\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "runInDebug", + "static": 1, + "params": [ + { + "name": "func", + "description": "The function to be executed.", + "type": "Function" + } + ], + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/destroyable-9c74c9b2d3.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/destroyable-9c74c9b2d3.json new file mode 100644 index 000000000..0683db178 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/destroyable-9c74c9b2d3.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/destroyable", + "type": "class", + "attributes": { + "name": "@ember/destroyable", + "shortname": "@ember/destroyable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/destroyable", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/destroyable/index.ts", + "line": 31, + "description": "

This function is used to associate a destroyable object with a parent. When the parent\nis destroyed, all registered children will also be destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
class CustomSelect extends Component {\n  constructor(...args) {\n    super(...args);\n\n    // obj is now a child of the component. When the component is destroyed,\n    // obj will also be destroyed, and have all of its destructors triggered.\n    this.obj = associateDestroyableChild(this, {});\n  }\n}
\n
\n
\n \n

Returns the associated child for convenience.

\n", + "itemtype": "method", + "name": "associateDestroyableChild", + "params": [ + { + "name": "parent", + "description": "the destroyable to entangle the child destroyables lifetime with", + "type": "Object|Function" + }, + { + "name": "child", + "description": "the destroyable to be entangled with the parents lifetime", + "type": "Object|Function" + } + ], + "return": { + "description": "the child argument", + "type": "Object|Function" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 58, + "description": "

Receives a destroyable, and returns true if the destroyable has begun destroying. Otherwise returns\nfalse.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let obj = {};\nisDestroying(obj); // false\ndestroy(obj);\nisDestroying(obj); // true\n// ...sometime later, after scheduled destruction\nisDestroyed(obj); // true\nisDestroying(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroying", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 80, + "description": "

Receives a destroyable, and returns true if the destroyable has finished destroying. Otherwise\nreturns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let obj = {};\n\nisDestroyed(obj); // false\ndestroy(obj);\n\n// ...sometime later, after scheduled destruction\n\nisDestroyed(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroyed", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 103, + "description": "

Initiates the destruction of a destroyable object. It runs all associated destructors, and then\ndestroys all children recursively.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let obj = {};\n\nregisterDestructor(obj, () => console.log('destroyed!'));\n\ndestroy(obj); // this will schedule the destructor to be called\n\n// ...some time later, during scheduled destruction\n\n// destroyed!
\n
\n
\n \n

Destruction via destroy() follows these steps:

\n

1, Mark the destroyable such that isDestroying(destroyable) returns true\n2, Call destroy() on each of the destroyable's associated children\n3, Schedule calling the destroyable's destructors\n4, Schedule setting destroyable such that isDestroyed(destroyable) returns true

\n

This results in the entire tree of destroyables being first marked as destroying,\nthen having all of their destructors called, and finally all being marked as isDestroyed.\nThere won't be any in between states where some items are marked as isDestroying while\ndestroying, while others are not.

\n", + "itemtype": "method", + "name": "destroy", + "params": [ + { + "name": "destroyable", + "description": "the object to destroy", + "type": "Object|Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 138, + "description": "

This function asserts that all objects which have associated destructors or associated children\nhave been destroyed at the time it is called. It is meant to be a low level hook that testing\nframeworks can use to hook into and validate that all destroyables have in fact been destroyed.

\n

This function requires that enableDestroyableTracking was called previously, and is only\navailable in non-production builds.

\n", + "itemtype": "method", + "name": "assertDestroyablesDestroyed", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 152, + "description": "

This function instructs the destroyable system to keep track of all destroyables (their\nchildren, destructors, etc). This enables a future usage of assertDestroyablesDestroyed\nto be used to ensure that all destroyable tasks (registered destructors and associated children)\nhave completed when assertDestroyablesDestroyed is called.

\n", + "itemtype": "method", + "name": "enableDestroyableTracking", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 164, + "description": "

Receives a destroyable object and a destructor function, and associates the\nfunction with it. When the destroyable is destroyed with destroy, or when its\nparent is destroyed, the destructor function will be called.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, () => this.resize.unregister(this));\n  }\n}
\n
\n
\n \n

Multiple destructors can be associated with a given destroyable, and they can be\nassociated over time, allowing libraries to dynamically add destructors as needed.\nregisterDestructor also returns the associated destructor function, for convenience.

\n

The destructor function is passed a single argument, which is the destroyable itself.\nThis allows the function to be reused multiple times for many destroyables, rather\nthan creating a closure function per destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nfunction unregisterResize(instance) {\n  instance.resize.unregister(instance);\n}\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, unregisterResize);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "registerDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to register the destructor function with", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to run when the destroyable object is destroyed", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 229, + "description": "

Receives a destroyable and a destructor function, and de-associates the destructor\nfrom the destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor, unregisterDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service modals;\n\n  constructor(...args) {\n    super(...args);\n\n    this.modals.add(this);\n\n    this.modalDestructor = registerDestructor(this, () => this.modals.remove(this));\n  }\n\n  @action pinModal() {\n    unregisterDestructor(this, this.modalDestructor);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "unregisterDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to unregister the destructor function from", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to remove from the destroyable", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/destroyable", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/engine-704febb64e.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/engine-db89b1cab5.json similarity index 95% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/engine-704febb64e.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/engine-db89b1cab5.json index 940b5ce18..deb62d4e9 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/engine-704febb64e.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/engine-db89b1cab5.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/engine", + "id": "ember-4.12.3-@ember/engine", "type": "class", "attributes": { "name": "@ember/engine", @@ -72,13 +72,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/engine", + "id": "ember-4.12.3-@ember/engine", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/helper-ef9de90d8d.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/helper-b2c753db35.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/helper-ef9de90d8d.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/helper-b2c753db35.json index 922fc62cf..ddf4ba053 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/helper-ef9de90d8d.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/helper-b2c753db35.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/helper", + "id": "ember-4.12.3-@ember/helper", "type": "class", "attributes": { "name": "@ember/helper", @@ -195,13 +195,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/instrumentation-4652eb7619.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/instrumentation-32792a04ed.json similarity index 96% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/instrumentation-4652eb7619.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/instrumentation-32792a04ed.json index 0ac39de06..21cd5f739 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/instrumentation-4652eb7619.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/instrumentation-32792a04ed.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/instrumentation", + "id": "ember-4.12.3-@ember/instrumentation", "type": "class", "attributes": { "name": "@ember/instrumentation", @@ -123,13 +123,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/instrumentation", + "id": "ember-4.12.3-@ember/instrumentation", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object-6df0b868ac.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object-6df0b868ac.json new file mode 100644 index 000000000..879839d13 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object-6df0b868ac.json @@ -0,0 +1,521 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/object", + "type": "class", + "attributes": { + "name": "@ember/object", + "shortname": "@ember/object", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 729, + "description": "

This helper returns a new property descriptor that wraps the passed\ncomputed property function. You can use this helper to define properties with\nnative decorator syntax, mixins, or via defineProperty().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', function() {\n    return `${this.get('firstName')} ${this.get('lastName')}`;\n  })\n});\n\nlet client = Person.create();\n\nclient.get('fullName'); // 'Betty Jones'\n\nclient.set('lastName', 'Fuller');\nclient.get('fullName'); // 'Betty Fuller'
\n
\n
\n \n

You can also provide a setter, either directly on the class using native class\nsyntax, or by passing a hash with get and set functions.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(/\\s+/);\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n\n    return value;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', {\n    get(key) {\n      return `${this.get('firstName')} ${this.get('lastName')}`;\n    },\n    set(key, value) {\n      let [firstName, lastName] = value.split(/\\s+/);\n      this.setProperties({ firstName, lastName });\n      return value;\n    }\n  })\n});\n\nlet client = Person.create();\nclient.get('firstName'); // 'Betty'\n\nclient.set('fullName', 'Carroll Fuller');\nclient.get('firstName'); // 'Carroll'
\n
\n
\n \n

When passed as an argument, the set function should accept two parameters,\nkey and value. The value returned from set will be the new value of the\nproperty.

\n

Note: This is the preferred way to define computed properties when writing third-party\nlibraries that depend on or use Ember, since there is no guarantee that the user\nwill have prototype Extensions enabled.

\n", + "itemtype": "method", + "name": "computed", + "static": 1, + "params": [ + { + "name": "dependentKeys*", + "description": "Optional dependent keys that trigger this computed property.", + "type": "String", + "optional": true + }, + { + "name": "func", + "description": "The computed property function.", + "type": "Function" + } + ], + "return": { + "description": "property decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/get_properties.ts", + "line": 6, + "description": "

To get multiple properties at once, call getProperties\nwith an object followed by a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, 'firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, ['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + }, + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/properties.ts", + "line": 13, + "description": "

NOTE: This is a low-level method used by other parts of the API. You almost\nnever want to call this method directly. Instead you should use\nmixin() to define new properties.

\n

Defines a property on an object. This method works much like the ES5\nObject.defineProperty() method except that it can also accept computed\nproperties and other special descriptors.

\n

Normally this method takes only three parameters. However if you pass an\ninstance of Descriptor as the third param then you can pass an\noptional value as the fourth parameter. This is often more efficient than\ncreating new descriptor hashes for each property.

\n

Examples

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { defineProperty, computed } from '@ember/object';\n\n// ES5 compatible mode\ndefineProperty(contact, 'firstName', {\n  writable: true,\n  configurable: false,\n  enumerable: true,\n  value: 'Charles'\n});\n\n// define a simple property\ndefineProperty(contact, 'lastName', undefined, 'Jolley');\n\n// define a computed property\ndefineProperty(contact, 'fullName', computed('firstName', 'lastName', function() {\n  return this.firstName+' '+this.lastName;\n}));
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "defineProperty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "the object to define this property on. This may be a prototype.", + "type": "Object" + }, + { + "name": "keyName", + "description": "the name of the property", + "type": "String" + }, + { + "name": "desc", + "description": "an instance of `Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.", + "type": "Descriptor", + "optional": true + }, + { + "name": "data", + "description": "something other than a descriptor, that will\n become the explicit value of this property.", + "type": "*", + "optional": true + } + ], + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 32, + "description": "

This function is called just after an object property has changed.\nIt will notify any observers and clear caches among other things.

\n

Normally you will not need to call this method directly but if for some\nreason you can't directly watch a property you can invoke this method\nmanually.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "obj", + "description": "The object with the property that will change", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key (or path) that will change.", + "type": "String" + }, + { + "name": "_meta", + "description": "The objects meta.", + "type": "Meta", + "optional": true + }, + { + "name": "value", + "description": "The new value to set for the property", + "type": "Unknown", + "optional": true + } + ], + "return": { + "description": "", + "type": "Void" + }, + "since": "3.1.0", + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 83, + "itemtype": "method", + "name": "beginPropertyChanges", + "chainable": 1, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 93, + "itemtype": "method", + "name": "endPropertyChanges", + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 105, + "description": "

Make a series of property changes together in an\nexception-safe way.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
Ember.changeProperties(function() {\n  obj1.set('foo', mayBlowUpWhenSet);\n  obj2.set('bar', baz);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "changeProperties", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_get.ts", + "line": 51, + "description": "

Gets the value of a property on an object. If the property is computed,\nthe function will be invoked. If the property is not defined but the\nobject implements the unknownProperty method then that will be invoked.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { get } from '@ember/object';\nget(obj, "name");
\n
\n
\n \n

If you plan to run on IE8 and older browsers then you should use this\nmethod anytime you want to retrieve a property on an object that you don't\nknow for sure is private. (Properties beginning with an underscore '_'\nare considered private.)

\n

On all newer browsers, you only need to use this method to retrieve\nproperties if the property might not be defined on the object and you want\nto respect the unknownProperty handler. Otherwise you can ignore this\nmethod.

\n

Note that if the object itself is undefined, this method will throw\nan error.

\n", + "itemtype": "method", + "name": "get", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to retrieve from.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to retrieve", + "type": "String" + } + ], + "return": { + "description": "the property value or `null`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 17, + "description": "

Sets the value of a property on an object, respecting computed properties\nand notifying observers and other listeners of the change.\nIf the specified property is not defined on the object and the object\nimplements the setUnknownProperty method, then instead of setting the\nvalue of the property on the object, its setUnknownProperty handler\nwill be invoked with the two parameters keyName and value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { set } from '@ember/object';\nset(obj, "name", value);
\n
\n
\n \n", + "itemtype": "method", + "name": "set", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "return": { + "description": "the passed value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 121, + "description": "

Error-tolerant form of set. Will not blow up if any part of the\nchain is undefined, null, or destroyed.

\n

This is primarily used when syncing bindings, which may try to update after\nan object has been destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { trySet } from '@ember/object';\n\nlet obj = { name: "Zoey" };\ntrySet(obj, "contacts.twitter", "@emberjs");
\n
\n
\n \n", + "itemtype": "method", + "name": "trySet", + "static": 1, + "params": [ + { + "name": "root", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "path", + "description": "The property path to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/set_properties.ts", + "line": 6, + "description": "

Set a list of properties on an object. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nlet anObject = EmberObject.create();\n\nanObject.setProperties({\n  firstName: 'Stanley',\n  lastName: 'Stuart',\n  age: 21\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "properties", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "properties" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 618, + "description": "

Creates a new subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(thing);\n   }\n});
\n
\n
\n \n

This defines a new subclass of EmberObject: Person. It contains one method: say().

\n

You can also create a subclass from any existing class by calling its extend() method.\nFor example, you might want to create a subclass of Ember's built-in Component class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nconst PersonComponent = Component.extend({\n  tagName: 'li',\n  classNameBindings: ['isAdministrator']\n});
\n
\n
\n \n

When defining a subclass, you can override methods but still access the\nimplementation of your parent class by calling the special _super() method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    let name = this.get('name');\n    alert(`${name} says: ${thing}`);\n  }\n});\n\nconst Soldier = Person.extend({\n  say(thing) {\n    this._super(`${thing}, sir!`);\n  },\n  march(numberOfHours) {\n    alert(`${this.get('name')} marches for ${numberOfHours} hours.`);\n  }\n});\n\nlet yehuda = Soldier.create({\n  name: 'Yehuda Katz'\n});\n\nyehuda.say('Yes');  // alerts "Yehuda Katz says: Yes, sir!"
\n
\n
\n \n

The create() on line #17 creates an instance of the Soldier class.\nThe extend() on line #8 creates a subclass of Person. Any instance\nof the Person class will not have the march() method.

\n

You can also pass Mixin classes to add additional properties to the subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import EmberObject from '@ember/object';\nimport Mixin from '@ember/object/mixin';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(`${this.get('name')} says: ${thing}`);\n  }\n});\n\nconst SingingMixin = Mixin.create({\n  sing(thing) {\n    alert(`${this.get('name')} sings: la la la ${thing}`);\n  }\n});\n\nconst BroadwayStar = Person.extend(SingingMixin, {\n  dance() {\n    alert(`${this.get('name')} dances: tap tap tap tap `);\n  }\n});
\n
\n
\n \n

The BroadwayStar class contains three methods: say(), sing(), and dance().

\n", + "itemtype": "method", + "name": "extend", + "static": 1, + "params": [ + { + "name": "mixins", + "description": "One or more Mixin classes", + "type": "Mixin", + "optional": true, + "multiple": true + }, + { + "name": "arguments", + "description": "Object containing values to use within the new class", + "type": "Object", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 722, + "description": "

Creates an instance of a class. Accepts either no arguments, or an object\ncontaining values to initialize the newly instantiated object with.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  helloWorld() {\n    alert(`Hi, my name is ${this.get('name')}`);\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\n\ntom.helloWorld(); // alerts "Hi, my name is Tom Dale".
\n
\n
\n \n

create will call the init function if defined during\nAnyObject.extend

\n

If no arguments are passed to create, it will not set values to the new\ninstance during initialization:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let noName = Person.create();\nnoName.helloWorld(); // alerts undefined
\n
\n
\n \n

NOTE: For performance reasons, you cannot declare methods or computed\nproperties during create. You should instead declare methods and computed\nproperties when using extend.

\n", + "itemtype": "method", + "name": "create", + "static": 1, + "params": [ + { + "name": "arguments", + "description": "", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 797, + "description": "

Augments a constructor's prototype with additional\nproperties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\no = MyObject.create();\no.get('name'); // 'an object'\n\nMyObject.reopen({\n  say(msg) {\n    console.log(msg);\n  }\n});\n\no2 = MyObject.create();\no2.say('hello'); // logs "hello"\n\no.say('goodbye'); // logs "goodbye"
\n
\n
\n \n

To add functions and properties to the constructor itself,\nsee reopenClass

\n", + "itemtype": "method", + "name": "reopen", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 851, + "description": "

Augments a constructor's own properties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\nMyObject.reopenClass({\n  canBuild: false\n});\n\nMyObject.canBuild; // false\no = MyObject.create();
\n
\n
\n \n

In other words, this creates static properties and functions for the class.\nThese are only available on the class and not on any instance of that class.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  name: '',\n  sayHello() {\n    alert(`Hello. My name is ${this.get('name')}`);\n  }\n});\n\nPerson.reopenClass({\n  species: 'Homo sapiens',\n\n  createPerson(name) {\n    return Person.create({ name });\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\nlet yehuda = Person.createPerson('Yehuda Katz');\n\ntom.sayHello(); // "Hello. My name is Tom Dale"\nyehuda.sayHello(); // "Hello. My name is Yehuda Katz"\nalert(Person.species); // "Homo sapiens"
\n
\n
\n \n

Note that species and createPerson are not valid on the tom and yehuda\nvariables. They are only valid on Person.

\n

To add functions and properties to instances of\na constructor by extending the constructor's prototype\nsee reopen

\n", + "itemtype": "method", + "name": "reopenClass", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 934, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For\nexample, computed property functions may close over variables that are then\nno longer available for introspection.

\n

You can pass a hash of these values to a computed property like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { computed } from '@ember/object';\n\nperson: computed(function() {\n  let personId = this.get('personId');\n  return Person.create({ id: personId });\n}).meta({ type: Person })
\n
\n
\n \n

Once you've done this, you can retrieve the values saved to the computed\nproperty from your class like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyClass.metaForProperty('person');
\n
\n
\n \n

This will return the original hash that was passed to meta().

\n", + "static": 1, + "itemtype": "method", + "name": "metaForProperty", + "params": [ + { + "name": "key", + "description": "property name", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 977, + "description": "

Iterate over each computed property for the class, passing its name\nand any associated metadata (see metaForProperty) to the callback.

\n", + "static": 1, + "itemtype": "method", + "name": "eachComputedProperty", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "binding", + "description": "", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 1069, + "description": "

Provides lookup-time type validation for injected properties.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_onLookup", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 1090, + "description": "

Returns a hash of property names and container names that injected\nproperties will lookup on the container lazily.

\n", + "itemtype": "method", + "name": "_lazyInjections", + "return": { + "description": "Hash of all lazy injected property keys to container names", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/index.ts", + "line": 50, + "description": "

Decorator that turns the target function into an Action which can be accessed\ndirectly by reference.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action this.toggleShowing}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

Decorated actions also interop with the string style template actions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action "toggleShowing"}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

It also binds the function directly to the instance, so it can be used in any\ncontext and will correctly refer to the class it came from:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert this.toggleShowing}}\n  {{on "click" this.toggleShowing}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

This can also be used in JavaScript code directly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  constructor() {\n    super(...arguments);\n\n    // this.toggleShowing is still bound correctly when added to\n    // the event listener\n    document.addEventListener('click', this.toggleShowing);\n  }\n\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n

This is considered best practice, since it means that methods will be bound\ncorrectly no matter where they are used. By contrast, the {{action}} helper\nand modifier can also be used to bind context, but it will be required for\nevery usage of the method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert (action this.toggleShowing)}}\n  {{on "click" (action this.toggleShowing)}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

They also do not have equivalents in JavaScript directly, so they cannot be\nused for other situations where binding would be useful.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "action", + "static": 1, + "params": [ + { + "name": "callback", + "description": "The function to turn into an action,\n when used in classic classes", + "type": "Function|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/index.ts", + "line": 288, + "description": "

Specify a method that observes property changes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nimport { observer } from '@ember/object';\n\nexport default EmberObject.extend({\n  valueObserver: observer('value', function() {\n    // Executes whenever the "value" property changes\n  })\n});
\n
\n
\n \n

Also available as Function.prototype.observes if prototype extensions are\nenabled.

\n", + "itemtype": "method", + "name": "observer", + "params": [ + { + "name": "propertyNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "func" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/object", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/compat-f691127b05.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/compat-f691127b05.json new file mode 100644 index 000000000..17e6d5e7d --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/compat-f691127b05.json @@ -0,0 +1,64 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/object/compat", + "type": "class", + "attributes": { + "name": "@ember/object/compat", + "shortname": "@ember/object/compat", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/object/compat.ts", + "line": 40, + "description": "

@dependentKeyCompat is decorator that can be used on native getters that\nuse tracked properties. It exposes the getter to Ember's classic computed\nproperty and observer systems, so they can watch it for changes. It can be\nused in both native and classic classes.

\n

Native Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { computed, set } from '@ember/object';\n\nclass Person {\n  @tracked firstName;\n  @tracked lastName;\n\n  @dependentKeyCompat\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nclass Profile {\n  constructor(person) {\n    set(this, 'person', person);\n  }\n\n  @computed('person.fullName')\n  get helloMessage() {\n    return `Hello, ${this.person.fullName}!`;\n  }\n}
\n
\n
\n \n

Classic Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport EmberObject, { computed, observer, set } from '@ember/object';\n\nconst Person = EmberObject.extend({\n  firstName: tracked(),\n  lastName: tracked(),\n\n  fullName: dependentKeyCompat(function() {\n    return `${this.firstName} ${this.lastName}`;\n  }),\n});\n\nconst Profile = EmberObject.extend({\n  person: null,\n\n  helloMessage: computed('person.fullName', function() {\n    return `Hello, ${this.person.fullName}!`;\n  }),\n\n  onNameUpdated: observer('person.fullName', function() {\n    console.log('person name updated!');\n  }),\n});
\n
\n
\n \n

dependentKeyCompat() can receive a getter function or an object containing\nget/set methods when used in classic classes, like computed properties.

\n

In general, only properties which you expect to be watched by older,\nuntracked clases should be marked as dependency compatible. The decorator is\nmeant as an interop layer for parts of Ember's older classic APIs, and should\nnot be applied to every possible getter/setter in classes. The number of\ndependency compatible getters should be minimized wherever possible. New\napplication code should not need to use @dependentKeyCompat, since it is\nonly for interoperation with older code.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "dependentKeyCompat", + "static": 1, + "params": [ + { + "name": "desc", + "description": "A property descriptor containing\n the getter and setter (when used in\n classic classes)", + "type": "PropertyDescriptor|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object/compat", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/computed-e80eb42511.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/computed-e80eb42511.json new file mode 100644 index 000000000..d9cfec777 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/computed-e80eb42511.json @@ -0,0 +1,903 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/object/computed", + "type": "class", + "attributes": { + "name": "@ember/object/computed", + "shortname": "@ember/object/computed", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/expand_properties.ts", + "line": 9, + "description": "

Expands pattern, invoking callback for each expansion.

\n

The only pattern supported is brace-expansion, anything else will be passed\nonce to callback directly.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { expandProperties } from '@ember/object/computed';\n\nfunction echo(arg){ console.log(arg); }\n\nexpandProperties('foo.bar', echo);              //=> 'foo.bar'\nexpandProperties('{foo,bar}', echo);            //=> 'foo', 'bar'\nexpandProperties('foo.{bar,baz}', echo);        //=> 'foo.bar', 'foo.baz'\nexpandProperties('{foo,bar}.baz', echo);        //=> 'foo.baz', 'bar.baz'\nexpandProperties('foo.{bar,baz}.[]', echo)      //=> 'foo.bar.[]', 'foo.baz.[]'\nexpandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs'\nexpandProperties('{foo}.bar.{baz}')             //=> 'foo.bar.baz'
\n
\n
\n \n", + "itemtype": "method", + "name": "expandProperties", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "pattern", + "description": "The property pattern to expand.", + "type": "String" + }, + { + "name": "callback", + "description": "The callback to invoke. It is invoked once per\nexpansion, and is passed the expansion.", + "type": "Function" + } + ], + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 60, + "description": "

A computed property macro that returns true if the value of the dependent\nproperty is null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { empty } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  @empty('todos') isDone;\n}\n\nlet todoList = new ToDoList(\n  ['Unit Test', 'Documentation', 'Release']\n);\n\ntodoList.isDone; // false\nset(todoList, 'todos', []);\ntodoList.isDone; // true
\n
\n
\n \n", + "since": "1.6.0", + "itemtype": "method", + "name": "empty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if the value\nof the dependent property is null, an empty string, empty array, or empty\nfunction and false if the underlying value is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 109, + "description": "

A computed property that returns true if the value of the dependent property\nis NOT null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { notEmpty } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(backpack) {\n    set(this, 'backpack', backpack);\n  }\n\n  @notEmpty('backpack') hasStuff\n}\n\nlet hamster = new Hamster(\n  ['Food', 'Sleeping Bag', 'Tent']\n);\n\nhamster.hasStuff; // true\nset(hamster, 'backpack', []);\nhamster.hasStuff; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "notEmpty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 155, + "description": "

A computed property that returns true if the value of the dependent property\nis null or undefined. This avoids errors from JSLint complaining about use of\n==, which can be technically confusing.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { none } from '@ember/object/computed';\n\nclass Hamster {\n  @none('food') isHungry;\n}\n\nlet hamster = new Hamster();\n\nhamster.isHungry; // true\n\nset(hamster, 'food', 'Banana');\nhamster.isHungry; // false\n\nset(hamster, 'food', null);\nhamster.isHungry; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "none", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is null or undefined.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 198, + "description": "

A computed property that returns the inverse boolean value of the original\nvalue for the dependent property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { not } from '@ember/object/computed';\n\nclass User {\n  loggedIn = false;\n\n  @not('loggedIn') isAnonymous;\n}\n\nlet user = new User();\n\nuser.isAnonymous; // true\nset(user, 'loggedIn', true);\nuser.isAnonymous; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "not", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns inverse of the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 240, + "description": "

A computed property that converts the provided dependent property into a\nboolean value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { bool } from '@ember/object/computed';\n\n\nclass Hamster {\n  @bool('numBananas') hasBananas\n}\n\nlet hamster = new Hamster();\n\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 0);\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 1);\nhamster.hasBananas; // true\n\nset(hamster, 'numBananas', null);\nhamster.hasBananas; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "bool", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which converts to boolean the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 288, + "description": "

A computed property which matches the original value for the dependent\nproperty against a given RegExp, returning true if the value matches the\nRegExp and false if it does not.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { match } from '@ember/object/computed';\n\nclass User {\n  @match('email', /^.+@.+\\..+$/) hasValidEmail;\n}\n\nlet user = new User();\n\nuser.hasValidEmail; // false\n\nset(user, 'email', '');\nuser.hasValidEmail; // false\n\nset(user, 'email', 'ember_hamster@example.com');\nuser.hasValidEmail; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "match", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "regexp", + "description": "", + "type": "RegExp" + } + ], + "return": { + "description": "computed property which match the original value\nfor property against a given RegExp", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 335, + "description": "

A computed property that returns true if the provided dependent property is\nequal to the given value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { equal } from '@ember/object/computed';\n\nclass Hamster {\n  @equal('percentCarrotsEaten', 100) satisfied;\n}\n\nlet hamster = new Hamster();\n\nhamster.satisfied; // false\n\nset(hamster, 'percentCarrotsEaten', 100);\nhamster.satisfied; // true\n\nset(hamster, 'percentCarrotsEaten', 50);\nhamster.satisfied; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "equal", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "String|Number|Object" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is equal to the given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 380, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gt } from '@ember/object/computed';\n\nclass Hamster {\n  @gt('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 11);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 425, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gte } from '@ember/object/computed';\n\nclass Hamster {\n  @gte('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 10);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater or equal then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 470, + "description": "

A computed property that returns true if the provided dependent property is\nless than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lt } from '@ember/object/computed';\n\nclass Hamster {\n  @lt('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 2);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 515, + "description": "

A computed property that returns true if the provided dependent property is\nless than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lte } from '@ember/object/computed';\n\nclass Hamster {\n  @lte('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 5);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less or equal than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 560, + "description": "

A computed property that performs a logical and on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first falsy value or last\ntruthy value just like JavaScript's && operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { and } from '@ember/object/computed';\n\nclass Hamster {\n  @and('hasTent', 'hasBackpack') readyForCamp;\n  @and('hasWalkingStick', 'hasBackpack') readyForHike;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForCamp; // false\n\nset(tomster, 'hasTent', true);\ntomster.readyForCamp; // false\n\nset(tomster, 'hasBackpack', true);\ntomster.readyForCamp; // true\n\nset(tomster, 'hasBackpack', 'Yes');\ntomster.readyForCamp; // 'Yes'\n\nset(tomster, 'hasWalkingStick', null);\ntomster.readyForHike; // null
\n
\n
\n \n", + "itemtype": "method", + "name": "and", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `and` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 606, + "description": "

A computed property which performs a logical or on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first truthy value or last\nfalsy value just like JavaScript's || operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { or } from '@ember/object/computed';\n\nclass Hamster {\n  @or('hasJacket', 'hasUmbrella') readyForRain;\n  @or('hasSunscreen', 'hasUmbrella') readyForBeach;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForRain; // undefined\n\nset(tomster, 'hasUmbrella', true);\ntomster.readyForRain; // true\n\nset(tomster, 'hasJacket', 'Yes');\ntomster.readyForRain; // 'Yes'\n\nset(tomster, 'hasSunscreen', 'Check');\ntomster.readyForBeach; // 'Check'
\n
\n
\n \n", + "itemtype": "method", + "name": "or", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `or` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 649, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { alias } from '@ember/object/computed';\n\nclass Person {\n  name = 'Alex Matchneer';\n\n  @alias('name') nomen;\n}\n\nlet alex = new Person();\n\nalex.nomen; // 'Alex Matchneer'\nalex.name;  // 'Alex Matchneer'\n\nset(alex, 'nomen', '@machty');\nalex.name;  // '@machty'
\n
\n
\n \n", + "itemtype": "method", + "name": "alias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates an alias to the\noriginal value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 684, + "description": "

Where the alias computed macro aliases get and set, and allows for\nbidirectional data flow, the oneWay computed macro only provides an aliased\nget. The set will not mutate the upstream property, rather causes the\ncurrent property to become the value set. This causes the downstream property\nto permanently diverge from the upstream property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { oneWay }from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @oneWay('firstName') nickName;\n}\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear');\nteddy.firstName; // 'Teddy'\nteddy.nickName; // 'TeddyBear'
\n
\n
\n \n", + "itemtype": "method", + "name": "oneWay", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 732, + "description": "

This is a more semantically meaningful alias of the oneWay computed macro,\nwhose name is somewhat ambiguous as to which direction the data flows.

\n", + "itemtype": "method", + "name": "reads", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\n property to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 745, + "description": "

Where oneWay computed macro provides oneWay bindings, the readOnly\ncomputed macro provides a readOnly one way binding. Very often when using\nthe oneWay macro one does not also want changes to propagate back up, as\nthey will replace the value.

\n

This prevents the reverse flow, and also throws an exception when it occurs.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { readOnly } from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @readOnly('firstName') nickName;\n});\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear'); // throws Exception\n// throw new EmberError('Cannot Set: nickName on: <User:ember27288>' );`\n\nteddy.firstName; // 'Teddy'
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 796, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property, but also print a deprecation warning.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { set } from '@ember/object';\nimport { deprecatingAlias } from '@ember/object/computed';\n\nclass Hamster {\n  @deprecatingAlias('cavendishCount', {\n    id: 'hamster.deprecate-banana',\n    until: '3.0.0'\n  })\n  bananaCount;\n}\n\nlet hamster = new Hamster();\n\nset(hamster, 'bananaCount', 5); // Prints a deprecation warning.\nhamster.cavendishCount; // 5
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecatingAlias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "Options for `deprecate`.", + "type": "Object" + } + ], + "return": { + "description": "computed property which creates an alias with a\ndeprecation to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 76, + "description": "

A computed property that returns the sum of the values in the dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { sum } from '@ember/object/computed';\n\nclass Invoice {\n  lineItems = [1.00, 2.50, 9.99];\n\n  @sum('lineItems') total;\n}\n\nlet invoice = new Invoice();\n\ninvoice.total; // 13.49
\n
\n
\n \n", + "itemtype": "method", + "name": "sum", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the sum of all values in the\ndependentKey's array", + "type": "ComputedProperty" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 113, + "description": "

A computed property that calculates the maximum value in the dependent array.\nThis will return -Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, max } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @max('childAges') maxChildAge;\n}\n\nlet lordByron = new Person();\n\nlordByron.maxChildAge; // -Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.maxChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.maxChildAge; // 8
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe max of a list of Date objects will be the highest timestamp as a Number.\nThis behavior is consistent with Math.max.

\n", + "itemtype": "method", + "name": "max", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the largest value in the dependentKey's\narray", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 177, + "description": "

A computed property that calculates the minimum value in the dependent array.\nThis will return Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, min } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @min('childAges') minChildAge;\n}\n\nlet lordByron = Person.create({ children: [] });\n\nlordByron.minChildAge; // Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.minChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.minChildAge; // 5
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe min of a list of Date objects will be the lowest timestamp as a Number.\nThis behavior is consistent with Math.min.

\n", + "itemtype": "method", + "name": "min", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the smallest value in the dependentKey's array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 240, + "description": "

Returns an array mapped via the callback

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function mapCallback(item, index);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', function(chore, index) {\n    return `${chore.toUpperCase()}!`;\n  })\n  excitingChores;\n});\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n

You can optionally pass an array of additional dependent keys as the second\nparameter to the macro, if your map function relies on any external values:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  shouldUpperCase = false;\n\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', ['shouldUpperCase'], function(chore, index) {\n    if (this.shouldUpperCase) {\n      return `${chore.toUpperCase()}!`;\n    } else {\n      return `${chore}!`;\n    }\n  })\n  excitingChores;\n}\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['clean!', 'write more unit tests!']\n\nset(hamster, 'shouldUpperCase', true);\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional\ndependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "an array mapped via the callback", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 364, + "description": "

Returns an array mapped to the specified key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import { set } from '@ember/object';\nimport { mapBy } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n}\n\nlet lordByron = new Person();\n\nlordByron.childAges; // []\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.childAges; // [7]\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.childAges; // [7, 5, 8]
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "an array mapped to the specified key", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 431, + "description": "

Filters the array by the callback, like the Array.prototype.filter method.

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
  • array is the dependant array itself.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function filterCallback(item, index, array);
\n
\n
\n \n

In the callback, return a truthy value that coerces to true to keep the\nelement, or a falsy to reject it.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = Hamster.create([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]
\n
\n
\n \n

You can also use @each.property in your dependent key, the callback will\nstill use the underlying array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores.@each.done', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n\nset(hamster.chores[2], 'done', true);\nhamster.remainingChores; // []
\n
\n
\n \n

Finally, you can optionally pass an array of additional dependent keys as the\nsecond parameter to the macro, if your filter function relies on any external\nvalues:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  doneKey = 'finished';\n\n  @filter('chores', ['doneKey'], function(chore, index, array) {\n    return !chore[this.doneKey];\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', finished: true },\n  { name: 'clean', finished: true },\n  { name: 'write more unit tests', finished: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', finished: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional dependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 601, + "description": "

Filters the array by the property and value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { filterBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filterBy('chores', 'done', false) remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{ name: 'write more unit tests', done: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "*" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 657, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniq } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniq('fruits') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  'banana',\n  'grape',\n  'kale',\n  'banana'\n]);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale']
\n
\n
\n \n", + "itemtype": "method", + "name": "uniq", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 728, + "description": "

A computed property which returns a new array with all the unique elements\nfrom an array, with uniqueness determined by specific key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniqBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniqBy('fruits', 'id') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  { id: 1, 'banana' },\n  { id: 2, 'grape' },\n  { id: 3, 'peach' },\n  { id: 1, 'banana' }\n]);\n\nhamster.uniqueFruits; // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 782, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { union } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits, vegetables) {\n    set(this, 'fruits', fruits);\n    set(this, 'vegetables', vegetables);\n  }\n\n  @union('fruits', 'vegetables') uniqueFruits;\n});\n\nlet hamster = new, Hamster(\n  [\n    'banana',\n    'grape',\n    'kale',\n    'banana',\n    'tomato'\n  ],\n  [\n    'tomato',\n    'carrot',\n    'lettuce'\n  ]\n);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale', 'tomato', 'carrot', 'lettuce']
\n
\n
\n \n", + "itemtype": "method", + "name": "union", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the unique elements\nfrom one or more dependent arrays.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 829, + "description": "

A computed property which returns a new array with all the elements\ntwo or more dependent arrays have in common.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { intersect } from '@ember/object/computed';\n\nclass FriendGroups {\n  constructor(adaFriends, charlesFriends) {\n    set(this, 'adaFriends', adaFriends);\n    set(this, 'charlesFriends', charlesFriends);\n  }\n\n  @intersect('adaFriends', 'charlesFriends') friendsInCommon;\n}\n\nlet groups = new FriendGroups(\n  ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n  ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock']\n);\n\ngroups.friendsInCommon; // ['William King', 'Mary Somerville']
\n
\n
\n \n", + "itemtype": "method", + "name": "intersect", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the duplicated\nelements from the dependent arrays", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 910, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array that are not in the second dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { setDiff } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(likes, fruits) {\n    set(this, 'likes', likes);\n    set(this, 'fruits', fruits);\n  }\n\n  @setDiff('likes', 'fruits') wants;\n}\n\nlet hamster = new Hamster(\n  [\n    'banana',\n    'grape',\n    'kale'\n  ],\n  [\n    'grape',\n    'kale',\n  ]\n);\n\nhamster.wants; // ['banana']
\n
\n
\n \n", + "itemtype": "method", + "name": "setDiff", + "static": 1, + "params": [ + { + "name": "setAProperty", + "description": "", + "type": "String" + }, + { + "name": "setBProperty", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the items from the\nfirst dependent array that are not in the second dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 980, + "description": "

A computed property that returns the array of values for the provided\ndependent properties.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { collect } from '@ember/object/computed';\n\nclass Hamster {\n  @collect('hat', 'shirt') clothes;\n}\n\nlet hamster = new Hamster();\n\nhamster.clothes; // [null, null]\n\nset(hamster, 'hat', 'Camp Hat');\nset(hamster, 'shirt', 'Camp Shirt');\nhamster.clothes; // ['Camp Hat', 'Camp Shirt']
\n
\n
\n \n", + "itemtype": "method", + "name": "collect", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which maps values of all passed\nin properties to an array.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 1035, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array sorted based on a property or sort function. The sort\nmacro can be used in two different ways:

\n
    \n
  1. By providing a sort callback function
  2. \n
  3. By providing an array of keys to sort the array
  4. \n
\n

In the first form, the callback method you provide should have the following\nsignature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function sortCallback(itemA, itemB);
\n
\n
\n \n
    \n
  • itemA the first item to compare.
  • \n
  • itemB the second item to compare.
  • \n
\n

This function should return negative number (e.g. -1) when itemA should\ncome before itemB. It should return positive number (e.g. 1) when itemA\nshould come after itemB. If the itemA and itemB are equal this function\nshould return 0.

\n

Therefore, if this function is comparing some numeric values, simple itemA - itemB or itemA.get( 'foo' ) - itemB.get( 'foo' ) can be used instead of\nseries of if.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', function(a, b){\n    if (a.priority > b.priority) {\n      return 1;\n    } else if (a.priority < b.priority) {\n      return -1;\n    }\n\n    return 0;\n  })\n  priorityTodos;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

You can also optionally pass an array of additional dependent keys as the\nsecond parameter, if your sort function is dependent on additional values that\ncould changes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n
import EmberObject, { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  sortKey = 'priority';\n\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', ['sortKey'], function(a, b){\n    if (a[this.sortKey] > b[this.sortKey]) {\n      return 1;\n    } else if (a[this.sortKey] < b[this.sortKey]) {\n      return -1;\n    }\n\n    return 0;\n  })\n  sortedTodos;\n});\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

In the second form, you should provide the key of the array of sort values as\nthe second parameter:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using standard ascending sort\n  todosSorting = ['name'];\n  @sort('todos', 'todosSorting') sortedTodos;\n\n  // using descending sort\n  todosSortingDesc = ['name:desc'];\n  @sort('todos', 'todosSortingDesc') sortedTodosDesc;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.sortedTodos; // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\ntodoList.sortedTodosDesc; // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n", + "itemtype": "method", + "name": "sort", + "static": 1, + "params": [ + { + "name": "itemsKey", + "description": "", + "type": "String" + }, + { + "name": "sortDefinitionOrDependentKeys", + "description": "The key of the sort definition (an array of sort properties),\nthe sort function, or an array of additional dependent keys", + "type": "String|Function|Array" + }, + { + "name": "sortDefinition", + "description": "the sort function (when used with additional dependent keys)", + "type": "Function?" + } + ], + "return": { + "description": "computes a new sorted array based on the sort\nproperty array or callback function", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/evented-3974b91ec2.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/evented-3974b91ec2.json new file mode 100644 index 000000000..5a1814b05 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/evented-3974b91ec2.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/object/evented", + "type": "class", + "attributes": { + "name": "@ember/object/evented", + "shortname": "@ember/object/evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 180, + "description": "

Define a property as a function that should be executed when\na specified event or events are triggered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\nimport { on } from '@ember/object/evented';\nimport { sendEvent } from '@ember/object/events';\n\nlet Job = EmberObject.extend({\n  logCompleted: on('completed', function() {\n    console.log('Job completed!');\n  })\n});\n\nlet job = Job.create();\n\nsendEvent(job, 'completed'); // Logs 'Job completed!'
\n
\n
\n \n", + "itemtype": "method", + "name": "on", + "static": 1, + "params": [ + { + "name": "eventNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the listener function, passed as last argument to on(...)", + "type": "Function" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/events-abb640cda3.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/events-74f08070f8.json similarity index 97% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/events-abb640cda3.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/events-74f08070f8.json index ab5b8994e..430b743e1 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/events-abb640cda3.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/events-74f08070f8.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/object/events", + "id": "ember-4.12.3-@ember/object/events", "type": "class", "attributes": { "name": "@ember/object/events", @@ -184,13 +184,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/object", + "id": "ember-4.12.3-@ember/object", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/internals-5d46ce6d31.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/internals-1e5248b86e.json similarity index 96% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/internals-5d46ce6d31.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/internals-1e5248b86e.json index cab4130e1..6ddc5f233 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/internals-5d46ce6d31.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/internals-1e5248b86e.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/object/internals", + "id": "ember-4.12.3-@ember/object/internals", "type": "class", "attributes": { "name": "@ember/object/internals", @@ -79,13 +79,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/object", + "id": "ember-4.12.3-@ember/object", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/mixin-4472f02df3.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/mixin-53e82367d1.json similarity index 95% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/mixin-4472f02df3.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/mixin-53e82367d1.json index 77452934c..c71ff6e6c 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/mixin-4472f02df3.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/mixin-53e82367d1.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/object/mixin", + "id": "ember-4.12.3-@ember/object/mixin", "type": "class", "attributes": { "name": "@ember/object/mixin", @@ -103,13 +103,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/object/mixin", + "id": "ember-4.12.3-@ember/object/mixin", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/observers-9eba8387c2.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/observers-fb02f6c762.json similarity index 95% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/observers-9eba8387c2.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/observers-fb02f6c762.json index 1ebcaeddb..13e06b39a 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/object/observers-9eba8387c2.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/object/observers-fb02f6c762.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/object/observers", + "id": "ember-4.12.3-@ember/object/observers", "type": "class", "attributes": { "name": "@ember/object/observers", @@ -92,13 +92,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/object", + "id": "ember-4.12.3-@ember/object", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/owner-dd510d5f54.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/owner-dd510d5f54.json new file mode 100644 index 000000000..0e53aedbc --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/owner-dd510d5f54.json @@ -0,0 +1,285 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/owner", + "type": "class", + "attributes": { + "name": "@ember/owner", + "shortname": "@ember/owner", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 535, + "description": "

setOwner forces a new owner on a given object instance. This is primarily\nuseful in some testing cases.

\n", + "itemtype": "method", + "name": "setOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object instance.", + "type": "Object" + }, + { + "name": "object", + "description": "The new owner object of the object instance.", + "type": "Owner" + } + ], + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 565, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 597, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 607, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 630, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 640, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 654, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 664, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 674, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 707, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/owner/index.ts", + "line": 41, + "description": "

Framework objects in an Ember application (components, services, routes, etc.)\nare created via a factory and dependency injection system. Each of these\nobjects is the responsibility of an "owner", which handled its\ninstantiation and manages its lifetime.

\n

getOwner fetches the owner object responsible for an instance. This can\nbe used to lookup or resolve other class instances, or register new factories\ninto the owner.

\n

For example, this component dynamically looks up a service based on the\naudioType passed as an argument:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
audio.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getOwner } from '@ember/application';\n\n// Usage:\n//\n//   <PlayAudio @audioType={{@model.audioType}} @audioFile={{@model.file}}/>\n//\nexport default class extends Component {\n  get audioService() {\n    return getOwner(this)?.lookup(`service:${this.args.audioType}`);\n  }\n\n  @action\n  onPlay() {\n    this.audioService?.play(this.args.audioFile);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "getOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object with an owner.", + "type": "Object" + } + ], + "return": { + "description": "An owner object.", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/owner", + "module": "@ember/owner" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/polyfills-899df87a07.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/polyfills-899df87a07.json new file mode 100644 index 000000000..fbbb7fc14 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/polyfills-899df87a07.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/polyfills", + "type": "class", + "attributes": { + "name": "@ember/polyfills", + "shortname": "@ember/polyfills", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/polyfills", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/polyfills/lib/assign.ts", + "line": 11, + "description": "

Copy properties from a source object to a target object. Source arguments remain unchanged.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assign } from '@ember/polyfills';\n\nvar a = { first: 'Yehuda' };\nvar b = { last: 'Katz' };\nvar c = { company: 'Other Company' };\nvar d = { company: 'Tilde Inc.' };\nassign(a, b, c, d); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' };
\n
\n
\n \n", + "itemtype": "method", + "name": "assign", + "params": [ + { + "name": "target", + "description": "The object to assign into", + "type": "Object" + }, + { + "name": "args", + "description": "The objects to copy properties from", + "type": "Object", + "multiple": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/polyfills", + "module": "@ember/polyfills" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/polyfills", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/routing-c17e7697fb.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/routing-348d6e4746.json similarity index 92% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/routing-c17e7697fb.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/routing-348d6e4746.json index 54a2d1410..6c4120cce 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-@ember/routing-c17e7697fb.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/routing-348d6e4746.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/routing", + "id": "ember-4.12.3-@ember/routing", "type": "class", "attributes": { "name": "@ember/routing", @@ -40,13 +40,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/routing", + "id": "ember-4.12.3-@ember/routing", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/runloop-bd9cea2adc.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/runloop-bd9cea2adc.json new file mode 100644 index 000000000..2e76b7342 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/runloop-bd9cea2adc.json @@ -0,0 +1,497 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/runloop", + "type": "class", + "attributes": { + "name": "@ember/runloop", + "shortname": "@ember/runloop", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/runloop", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 105, + "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

Normally 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { run } from '@ember/runloop';\n\nrun(function() {\n  // code to be executed within a RunLoop\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "run", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "return value from invoking the passed function.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 150, + "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

Please note: This is not for normal usage, and should be used sparingly.

\n

If invoked when not within a run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { join } from '@ember/runloop';\n\njoin(function() {\n  // creates a new run-loop\n});
\n
\n
\n \n

Alternatively, if called within an existing run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "join", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Return value from invoking the passed function. Please note,\nwhen called within an existing loop, no return value is possible.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 209, + "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

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

Let'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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import 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
\n \n

In 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.

\n", + "itemtype": "method", + "name": "bind", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "returns a new function that will always have a particular context", + "type": "Function" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 323, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "begin", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 346, + "description": "

Ends a RunLoop. This must be called sometime after you call\nbegin() to flush any deferred actions. This is a lower-level way\nto use a RunLoop instead of using run().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "end", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 369, + "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

At 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "schedule", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'", + "type": "String" + }, + { + "name": "target", + "description": "target object to use as the context when invoking a method.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.", + "type": "String|Function" + }, + { + "name": "arguments*", + "description": "Optional arguments to be passed to the queued method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 442, + "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

You 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "later", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 490, + "description": "

Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling scheduleOnce with the "actions" queue.

\n", + "itemtype": "method", + "name": "once", + "static": 1, + "params": [ + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 521, + "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

Note that although you can pass optional arguments these will not be\nconsidered when looking for duplicates. New arguments will replace previous\ncalls.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Also note that for scheduleOnce to prevent additional calls, you need to\npass the same function instance. The following case works as expected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
function log() {\n  console.log('Logging only once');\n}\n\nfunction scheduleIt() {\n  scheduleOnce('actions', myContext, log);\n}\n\nscheduleIt();\nscheduleIt();
\n
\n
\n \n

But this other case will schedule the function multiple times:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { 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
\n \n

Available queues, and their order, can be found at queues

\n", + "itemtype": "method", + "name": "scheduleOnce", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'.", + "type": "String", + "optional": true + }, + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 615, + "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\nlater with a wait time of 1ms.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { 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
\n \n

Multiple 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

Note 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

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

One 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

The 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.

\n", + "itemtype": "method", + "name": "next", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 700, + "description": "

Cancels a scheduled item. Must be a value returned by later(),\nonce(), scheduleOnce(), next(), debounce(), or\nthrottle().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n
import {\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
\n
\n \n", + "itemtype": "method", + "name": "cancel", + "static": 1, + "params": [ + { + "name": "timer", + "description": "Timer object to cancel", + "type": "Object" + } + ], + "return": { + "description": "true if canceled or false/undefined if it wasn't found", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 771, + "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

This 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n \n

Immediate allows you to run the function immediately, but debounce\nother calls for this function until the wait time has elapsed. If\ndebounce 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "debounce", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to false.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 868, + "description": "

Ensure that the target method is never called more frequently than\nthe specified spacing period. The target method is called immediately.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "throttle", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "spacing", + "description": "Number of milliseconds to space out requests.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to true.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 62, + "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.

\n", + "itemtype": "property", + "name": "queues", + "type": "Array", + "default": "['actions', 'destroy']", + "access": "private", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/routing/transition" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/runloop", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/service-b493a7bf53.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/service-b493a7bf53.json new file mode 100644 index 000000000..cfebd40f6 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/service-b493a7bf53.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/service", + "type": "class", + "attributes": { + "name": "@ember/service", + "shortname": "@ember/service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/service/index.ts", + "line": 10, + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + }, + { + "file": "packages/@ember/service/index.ts", + "line": 30, + "description": "

Creates a property that lazily looks up a service in the container. There are\nno restrictions as to what objects a service can be injected into.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service('auth') authManager;\n\n  model() {\n    return this.authManager.findCurrentUser();\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default Route.extend({\n  authManager: service('auth'),\n\n  model() {\n    return this.get('authManager').findCurrentUser();\n  }\n});
\n
\n
\n \n

This example will create an authManager property on the application route\nthat looks up the auth service in the container, making it easily accessible\nin the model hook.

\n", + "itemtype": "method", + "name": "service", + "static": 1, + "since": "4.1.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/template-ee1199d182.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/template-ee1199d182.json new file mode 100644 index 000000000..0868722c7 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/template-ee1199d182.json @@ -0,0 +1,107 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/template", + "type": "class", + "attributes": { + "name": "@ember/template", + "shortname": "@ember/template", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/template", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/utils/managers.ts", + "line": 9, + "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).

\n", + "itemtype": "method", + "name": "setComponentManager", + "params": [ + { + "name": "factory", + "description": "a function to create the owner for an object", + "type": "Function" + }, + { + "name": "obj", + "description": "the object to associate with the componetn manager", + "type": "Object" + } + ], + "return": { + "description": "the same object passed in", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 121, + "description": "

Use this method to indicate that a string should be rendered as HTML\nwhen the string is used in a template. To say this another way,\nstrings marked with htmlSafe will not be HTML escaped.

\n

A word of warning - The htmlSafe method does not make the string safe;\nit only tells the framework to treat the string as if it is safe to render\nas HTML. If a string contains user inputs or other untrusted\ndata, you must sanitize the string before using the htmlSafe method.\nOtherwise your code is vulnerable to\nCross-Site Scripting.\nThere are many open source sanitization libraries to choose from,\nboth for front end and server-side sanitization.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { htmlSafe } from '@ember/template';\n\nconst someTrustedOrSanitizedString = "<div>Hello!</div>"\n\nhtmlSafe(someTrustedorSanitizedString)
\n
\n
\n \n", + "itemtype": "method", + "name": "htmlSafe", + "params": [ + { + "name": "str", + "description": "The string to treat as trusted.", + "type": "String" + } + ], + "static": 1, + "return": { + "description": "A string that will not be HTML escaped by Handlebars.", + "type": "SafeString" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 159, + "description": "

Detects if a string was decorated using htmlSafe.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { htmlSafe, isHTMLSafe } from '@ember/template';\n\nlet plainString = 'plain string';\nlet safeString = htmlSafe('<div>someValue</div>');\n\nisHTMLSafe(plainString); // false\nisHTMLSafe(safeString);  // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isHTMLSafe", + "static": 1, + "return": { + "description": "`true` if the string was decorated with `htmlSafe`, `false` otherwise.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/template", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/test-3cdbc3de76.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/test-3cdbc3de76.json new file mode 100644 index 000000000..f4500709d --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/test-3cdbc3de76.json @@ -0,0 +1,395 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/test", + "type": "class", + "attributes": { + "name": "@ember/test", + "shortname": "@ember/test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/test", + "namespace": "", + "methods": [ + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 64, + "description": "

This hook defers the readiness of the application, so that you can start\nthe app when your tests are ready to run. It also sets the router's\nlocation to 'none', so that the window's location will not be modified\n(preventing both accidental leaking of state between tests and interference\nwith your testing framework). setupForTesting should only be called after\nsetting a custom router class (for example App.Router = Router.extend().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.setupForTesting();
\n
\n
\n \n", + "itemtype": "method", + "name": "setupForTesting", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 103, + "description": "

This injects the test helpers into the helperContainer object. If an object is provided\nit will be used as the helperContainer. If helperContainer is not set it will default\nto window. If a function of the same name has already been defined it will be cached\n(so that it can be reset if the helper is removed with unregisterHelper or\nremoveTestHelpers).

\n

Any callbacks registered with onInjectHelpers will be called once the\nhelpers have been injected.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.injectTestHelpers();
\n
\n
\n \n", + "itemtype": "method", + "name": "injectTestHelpers", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 148, + "description": "

This removes all helpers that have been registered, and resets and functions\nthat were overridden by the helpers.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.removeTestHelpers();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "removeTestHelpers", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/helpers/current_path.ts", + "line": 9, + "description": "

Returns the current path.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentPath(), 'some.path.index', "correct path was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentPath", + "return": { + "description": "The currently active path.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_route_name.ts", + "line": 8, + "description": "

Returns the currently active route name.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
function validateRouteName() {\nequal(currentRouteName(), 'some.path', "correct route was transitioned into.");\n}\nvisit('/some/path').then(validateRouteName)
\n
\n
\n \n", + "itemtype": "method", + "name": "currentRouteName", + "return": { + "description": "The name of the currently active route.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_url.ts", + "line": 9, + "description": "

Returns the current URL.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentURL(), '/some/path', "correct URL was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentURL", + "return": { + "description": "The currently active URL.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.ts", + "line": 9, + "description": "

Resumes a test paused by pauseTest.

\n", + "itemtype": "method", + "name": "resumeTest", + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.ts", + "line": 22, + "description": "

Pauses the current test - this is useful for debugging while testing or for test-driving.\nIt allows you to inspect the state of your application at any point.\nExample (The test will pause before clicking the button):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('/')\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

You may want to turn off the timeout before pausing.

\n

qunit (timeout available to use as of 2.4.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nassert.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

mocha (timeout happens automatically as of ember-mocha v0.14.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nthis.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n", + "since": "1.9.0", + "itemtype": "method", + "name": "pauseTest", + "return": { + "description": "A promise that will never resolve", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/visit.ts", + "line": 6, + "description": "

Loads a route, sets up any controllers, and renders any templates associated\nwith the route as though a real user had triggered the route change while\nusing your app.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('posts/index').then(function() {\n  // assert something\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/wait.ts", + "line": 12, + "description": "

Causes the run loop to process any pending events. This is used to ensure that\nany async operations from other helpers (or your assertions) have been processed.

\n

This is most often used as the return value for the helper functions (see 'click',\n'fillIn','visit',etc). However, there is a method to register a test helper which\nutilizes this method without the need to actually call wait() in your helpers.

\n

The wait helper is built into registerAsyncHelper by default. You will not need\nto return app.testHelpers.wait(); - the wait behavior is provided for you.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('loginUser', function(app, username, password) {\n  visit('secured/path/here')\n    .fillIn('#username', username)\n    .fillIn('#password', password)\n    .click('.submit');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "wait", + "params": [ + { + "name": "value", + "description": "The value to be returned.", + "type": "Object" + } + ], + "return": { + "description": "Promise that resolves to the passed value.", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 15, + "description": "

registerHelper is used to register a test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

This helper can later be called without arguments because it will be\ncalled with app as the first parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nApp = Application.create();\nApp.injectTestHelpers();\nboot();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 59, + "description": "

registerAsyncHelper is used to register an async test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerAsyncHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterAsyncHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

The advantage of an async helper is that it will not run\nuntil the last async helper has completed. All async helpers\nafter it will wait for it complete before running.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('deletePost', function(app, postId) {\n  click('.delete-' + postId);\n});\n\n// ... in your test\nvisit('/post/2');\ndeletePost(2);\nvisit('/post/3');\ndeletePost(3);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerAsyncHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 112, + "description": "

Remove a previously added helper method.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { unregisterHelper } from '@ember/test';\n\nunregisterHelper('wait');
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregisterHelper", + "static": 1, + "params": [ + { + "name": "name", + "description": "The helper to remove.", + "type": "String" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 7, + "description": "

This allows ember-testing to play nicely with other asynchronous\nevents, such as an application that is waiting for a CSS3\ntransition or an IndexDB transaction. The waiter runs periodically\nafter each async helper (i.e. click, andThen, visit, etc) has executed,\nuntil the returning result is truthy. After the waiters finish, the next async helper\nis executed and the process repeats.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(function() {\n  return myPendingTransactions() === 0;\n});
\n
\n
\n \n

The context argument allows you to optionally specify the this\nwith which your callback will be invoked.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(MyDB, MyDB.hasPendingTransactions);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 66, + "description": "

unregisterWaiter is used to unregister a callback that was\nregistered with registerWaiter.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "unregisterWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 94, + "description": "

Iterates through each registered test waiter, and invokes\nits callback. If any waiter returns false, this method will return\ntrue indicating that the waiters have not settled yet.

\n

This is generally used internally from the acceptance/integration test\ninfrastructure.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "checkWaiters", + "class": "@ember/test", + "module": "@ember/test" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 23, + "description": "

This property contains the testing helpers for the current application. These\nare created once you call injectTestHelpers on your Application\ninstance. The included helpers are also available on the window object by\ndefault, but can be used from this object on the individual application also.

\n", + "itemtype": "property", + "name": "testHelpers", + "type": "{Object}", + "default": "{}", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 36, + "description": "

This property will contain the original methods that were registered\non the helperContainer before injectTestHelpers is called.

\n

When removeTestHelpers is called, these methods are restored to the\nhelperContainer.

\n", + "itemtype": "property", + "name": "originalMethods", + "type": "{Object}", + "default": "{}", + "access": "private", + "tagname": "", + "since": "1.3.0", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 51, + "description": "

This property indicates whether or not this application is currently in\ntesting mode. This is set when setupForTesting is called on the current\napplication.

\n", + "itemtype": "property", + "name": "testing", + "type": "{Boolean}", + "default": "false", + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 91, + "description": "

This will be used as the container to inject the test helpers into. By\ndefault the helpers are injected into window.

\n", + "itemtype": "property", + "name": "helperContainer", + "type": "{Object} The object to be used for test helpers.", + "default": "window", + "since": "1.2.0", + "access": "private", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/test", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/utils-b45b721b3f.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/utils-b45b721b3f.json new file mode 100644 index 000000000..8dc4fa123 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@ember/utils-b45b721b3f.json @@ -0,0 +1,213 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/utils", + "type": "class", + "attributes": { + "name": "@ember/utils", + "shortname": "@ember/utils", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/utils", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/utils/lib/compare.ts", + "line": 53, + "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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { compare } from '@ember/utils';\n\ncompare('hello', 'hello');  // 0\ncompare('abc', 'dfg');      // -1\ncompare(2, 1);              // 1
\n
\n
\n \n

If 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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { compare } from '@ember/utils';\n\ncompare('hello', 50);       // 1\ncompare(50, 'hello');       // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "compare", + "static": 1, + "params": [ + { + "name": "v", + "description": "First value to compare", + "type": "Object" + }, + { + "name": "w", + "description": "Second value to compare", + "type": "Object" + } + ], + "return": { + "description": "-1 if v < w, 0 if v = w and 1 if v > w.", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is-equal.ts", + "line": 4, + "description": "

Compares two objects, returning true if they are equal.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { isEqual } from '@ember/utils';\n\nisEqual('hello', 'hello');                   // true\nisEqual(1, 2);                               // false
\n
\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Due 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { isEqual } from '@ember/utils';\n\nisEqual([4, 2], [4, 2]);                     // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEqual", + "static": 1, + "params": [ + { + "name": "a", + "description": "first object to compare", + "type": "Object" + }, + { + "name": "b", + "description": "second object to compare", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_blank.ts", + "line": 5, + "description": "

A value is blank if it is empty or a whitespace string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "isBlank", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_empty.ts", + "line": 6, + "description": "

Verifies that a value is null or undefined, an empty string, or an empty\narray.

\n

Constrains the rules on isNone by returning true for empty strings and\nempty arrays.

\n

If the value is an object with a size property of type number, it is used\nto check emptiness.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
isEmpty(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
\n
\n \n", + "itemtype": "method", + "name": "isEmpty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_none.ts", + "line": 4, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
isNone(null);          // true\nisNone(undefined);     // true\nisNone('');            // false\nisNone([]);            // false\nisNone(function() {}); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isNone", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_present.ts", + "line": 5, + "description": "

A value is present if it not isBlank.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
isPresent(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
\n
\n \n", + "itemtype": "method", + "name": "isPresent", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.8.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/type-of.ts", + "line": 40, + "description": "

Returns a consistent type for the passed object.

\n

Use 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\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
\n
\n \n

Examples:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "typeOf", + "params": [ + { + "name": "item", + "description": "the item to check" + } + ], + "return": { + "description": "the type", + "type": "String" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/utils", + "module": "@ember/utils" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/utils", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@glimmer/tracking-275ccf5163.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@glimmer/tracking-275ccf5163.json new file mode 100644 index 000000000..08938443c --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@glimmer/tracking-275ccf5163.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.12.3-@glimmer/tracking", + "type": "class", + "attributes": { + "name": "@glimmer/tracking", + "shortname": "@glimmer/tracking", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 22, + "description": "

Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are static, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>Count: {{this.count}}</div>\n<div>Times Ten: {{this.timesTen}}</div>\n<div>\n  <button {{on "click" this.plusOne}}>\n    Plus One\n  </button>\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class CounterComponent extends Component {\n  @tracked count = 0;\n\n  get timesTen() {\n    return this.count * 10;\n  }\n\n  @action\n  plusOne() {\n    this.count += 1;\n  }\n}
\n
\n
\n \n

Both the {{this.count}} and the {{this.timesTen}} properties in the\ntemplate will update whenever the button is clicked. Any tracked properties\nthat are used in any way to calculate a value that is used in the template\nwill cause a rerender when updated - this includes through method calls and\nother means:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nclass Entry {\n  @tracked name;\n  @tracked phoneNumber;\n\n  constructor(name, phoneNumber) {\n    this.name = name;\n    this.phoneNumber = phoneNumber;\n  }\n}\n\nexport default class PhoneBookComponent extends Component {\n  entries = [\n    new Entry('Pizza Palace', 5551234),\n    new Entry('1st Street Cleaners', 5554321),\n    new Entry('Plants R Us', 5552468),\n  ];\n\n  // Any usage of this property will update whenever any of the names in the\n  // entries arrays are updated\n  get names() {\n    return this.entries.map(e => e.name);\n  }\n\n  // Any usage of this property will update whenever any of the numbers in the\n  // entries arrays are updated\n  get numbers() {\n    return this.getFormattedNumbers();\n  }\n\n  getFormattedNumbers() {\n    return this.entries\n      .map(e => e.phoneNumber)\n      .map(number => {\n        let numberString = '' + number;\n\n        return numberString.slice(0, 3) + '-' + numberString.slice(3);\n      });\n  }\n}
\n
\n
\n \n

It's important to note that setting tracked properties will always trigger an\nupdate, even if the property is set to the same value as it was before.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let entry = new Entry('Pizza Palace', 5551234);\n\n// if entry was used when rendering, this would cause a rerender, even though\n// the name is being set to the same value as it was before\nentry.name = entry.name;
\n
\n
\n \n

tracked can also be used with the classic Ember object model in a similar\nmanner to classic computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked(),\n  phoneNumber: tracked()\n});
\n
\n
\n \n

Often this is unnecessary, but to ensure robust auto-tracking behavior it is\nadvisable to mark tracked state appropriately wherever possible.

\n

This form of tracked also accepts an optional configuration object\ncontaining either an initial value or an initializer function (but not\nboth).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked({ value: 'Zoey' }),\n  favoriteSongs: tracked({\n    initializer: () => ['Raspberry Beret', 'Time After Time']\n  })\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "tracked", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 158, + "description": "

Gives the getter a caching behavior. The return value of the getter\nwill be cached until any of the properties it is entangled with\nare invalidated. This is useful when a getter is expensive and\nused very often.

\n

For instance, in this GuestList class, we have the sortedGuests\ngetter that sorts the guests alphabetically:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
  import { tracked } from '@glimmer/tracking';\n\n  class GuestList {\n    @tracked guests = ['Zoey', 'Tomster'];\n\n    get sortedGuests() {\n      return this.guests.slice().sort()\n    }\n  }
\n
\n
\n \n

Every time sortedGuests is accessed, a new array will be created and sorted,\nbecause JavaScript getters do not cache by default. When the guest list\nis small, like the one in the example, this is not a problem. However, if\nthe guest list were to grow very large, it would mean that we would be doing\na large amount of work each time we accessed sortedGuests. With @cached,\nwe can cache the value instead:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
  import { tracked, cached } from '@glimmer/tracking';\n\n  class GuestList {\n    @tracked guests = ['Zoey', 'Tomster'];\n\n    @cached\n    get sortedGuests() {\n      return this.guests.slice().sort()\n    }\n  }
\n
\n
\n \n

Now the sortedGuests getter will be cached based on autotracking.\nIt will only rerun and create a new sorted array when the guests tracked\nproperty is updated.

\n

Tradeoffs

\n

Overuse is discouraged.

\n

In general, you should avoid using @cached unless you have confirmed that\nthe getter you are decorating is computationally expensive, since @cached\nadds a small amount of overhead to the getter.\nWhile the individual costs are small, a systematic use of the @cached\ndecorator can add up to a large impact overall in your app.\nMany getters and tracked properties are only accessed once during rendering,\nand then never rerendered, so adding @cached when unnecessary can\nnegatively impact performance.

\n

Also, @cached may rerun even if the values themselves have not changed,\nsince tracked properties will always invalidate.\nFor example updating an integer value from 5 to an other 5 will trigger\na rerun of the cached properties building from this integer.

\n

Avoiding a cache invalidation in this case is not something that can\nbe achieved on the @cached decorator itself, but rather when updating\nthe underlying tracked values, by applying some diff checking mechanisms:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
if (nextValue !== this.trackedProp) {\n  this.trackedProp = nextValue;\n}
\n
\n
\n \n

Here equal values won't update the property, therefore not triggering\nthe subsequent cache invalidations of the @cached properties who were\nusing this trackedProp.

\n

As a reminder, do not use this piece of code inside a tracked getter,\nas the dependency chain could lead to an infinite loop. Mutating an adjacent\nproperty from a getter is not a good practice anyway, even with a caching\nmechanism reducing reruns.

\n

The cost of these edge-guards adds up to the trade-off calculation of using\na caching strategy, hence requiring a very sensitive and moderate approach\nregarding performance.

\n", + "itemtype": "method", + "name": "cached", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@glimmer/tracking", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-@glimmer/tracking/primitives/cache-e7afa4be71.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-@glimmer/tracking/primitives/cache-e7afa4be71.json new file mode 100644 index 000000000..e930a4973 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-@glimmer/tracking/primitives/cache-e7afa4be71.json @@ -0,0 +1,77 @@ +{ + "data": { + "id": "ember-4.12.3-@glimmer/tracking/primitives/cache", + "type": "class", + "attributes": { + "name": "@glimmer/tracking/primitives/cache", + "shortname": "@glimmer/tracking/primitives/cache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking/primitives/cache", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 14, + "description": "

Receives a function, and returns a wrapped version of it that memoizes based on\nautotracking. The function will only rerun whenever any tracked values used\nwithin it have changed. Otherwise, it will return the previous value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state. Now, `counter` will\n  // only rerun if `state.value` changes.\n  state.value;\n\n  return ++computeCount;\n});\n\ngetValue(counter); // 1\n\n// returns the same value because no tracked state has changed\ngetValue(counter); // 1\n\nstate.value = 'foo';\n\n// reruns because a tracked value used in the function has changed,\n// incermenting the counter\ngetValue(counter); // 2
\n
\n
\n \n", + "itemtype": "method", + "name": "createCache", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 56, + "description": "

Gets the value of a cache created with createCache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  return ++computeCount;\n});\n\ngetValue(counter); // 1
\n
\n
\n \n", + "itemtype": "method", + "name": "getValue", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 78, + "description": "

Can be used to check if a memoized function is constant. If no tracked state\nwas used while running a memoized function, it will never rerun, because nothing\ncan invalidate its result. isConst can be used to determine if a memoized\nfunction is constant or not, in order to optimize code surrounding that\nfunction.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue, isConst } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state\n  state.value;\n\n  return computeCount++;\n});\n\nlet constCounter = createCache(() => {\n  return computeCount++;\n});\n\ngetValue(counter);\ngetValue(constCounter);\n\nisConst(counter); // false\nisConst(constCounter); // true
\n
\n
\n \n

If called on a cache that hasn't been accessed yet, it will throw an\nerror. This is because there's no way to know if the function will be constant\nor not yet, and so this helps prevent missing an optimization opportunity on\naccident.

\n", + "itemtype": "method", + "name": "isConst", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@glimmer/tracking/primitives/cache", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Application-7ce49e55b4.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Application-7ce49e55b4.json new file mode 100644 index 000000000..11048fc03 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Application-7ce49e55b4.json @@ -0,0 +1,604 @@ +{ + "data": { + "id": "ember-4.12.3-Application", + "type": "class", + "attributes": { + "name": "Application", + "shortname": "Application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/index.ts", + "line": 43, + "description": "

An instance of Application is the starting point for every Ember\napplication. It instantiates, initializes and coordinates the\nobjects that make up your app.

\n

Each Ember app has one and only one Application object. Although\nEmber CLI creates this object implicitly, the Application class\nis defined in the app/app.js. You can define a ready method on the\nApplication class, which will be run by Ember when the application is\ninitialized.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
export default class App extends Application {\n  ready() {\n    // your code here\n  }\n}
\n
\n
\n \n

Because Application ultimately inherits from Ember.Namespace, any classes\nyou create will have useful string representations when calling toString().\nSee the Ember.Namespace documentation for more information.

\n

While you can think of your Application as a container that holds the\nother classes in your application, there are several other responsibilities\ngoing on under-the-hood that you may want to understand. It is also important\nto understand that an Application is different from an ApplicationInstance.\nRefer to the Guides to understand the difference between these.

\n

Event Delegation

\n

Ember uses a technique called event delegation. This allows the framework\nto set up a global, shared event listener instead of requiring each view to\ndo it manually. For example, instead of each view registering its own\nmousedown listener on its associated element, Ember sets up a mousedown\nlistener on the body.

\n

If a mousedown event occurs, Ember will look at the target of the event and\nstart walking up the DOM node tree, finding corresponding views and invoking\ntheir mouseDown method as it goes.

\n

Application has a number of default events that it listens for, as\nwell as a mapping from lowercase events to camel-cased view method names. For\nexample, the keypress event causes the keyPress method on the view to be\ncalled, the dblclick event causes doubleClick to be called, and so on.

\n

If there is a bubbling browser event that Ember does not listen for by\ndefault, you can specify custom events and their corresponding view method\nnames by setting the application's customEvents property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nexport default class App extends Application {\n  customEvents = {\n    // add support for the paste event\n    paste: 'paste'\n  }\n}
\n
\n
\n \n

To prevent Ember from setting up a listener for a default event,\nspecify the event name with a null value in the customEvents\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nexport default class App extends Application {\n  customEvents = {\n    // prevent listeners for mouseenter/mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n}
\n
\n
\n \n

By default, the application sets up these event listeners on the document\nbody. However, in cases where you are embedding an Ember application inside\nan existing page, you may want it to set up the listeners on an element\ninside the body.

\n

For example, if only events inside a DOM element with the ID of ember-app\nshould be delegated, set your application's rootElement property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nexport default class App extends Application {\n  rootElement = '#ember-app'\n}
\n
\n
\n \n

The rootElement can be either a DOM element or a CSS selector\nstring. Note that views appended to the DOM outside the root element will\nnot receive events. If you specify a custom root element, make sure you only\nappend views inside it!

\n

To learn more about the events Ember components use, see

\n

components/handling-events.

\n

Initializers

\n

To add behavior to the Application's boot process, you can define initializers in\nthe app/initializers directory, or with ember generate initializer using Ember CLI.\nThese files should export a named initialize function which will receive the created application\nobject as its first argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
export function initialize(application) {\n  // application.inject('route', 'foo', 'service:foo');\n}
\n
\n
\n \n

Application initializers can be used for a variety of reasons including:

\n
    \n
  • setting up external libraries
  • \n
  • injecting dependencies
  • \n
  • setting up event listeners in embedded apps
  • \n
  • deferring the boot process using the deferReadiness and advanceReadiness APIs.
  • \n
\n

Routing

\n

In addition to creating your application's router, Application is\nalso responsible for telling the router when to start routing. Transitions\nbetween routes can be logged with the LOG_TRANSITIONS flag, and more\ndetailed intra-transition logging can be logged with\nthe LOG_TRANSITIONS_INTERNAL flag:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  LOG_TRANSITIONS: true, // basic logging of successful transitions\n  LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n});
\n
\n
\n \n

By default, the router will begin trying to translate the current URL into\napplication state once the browser emits the DOMContentReady event. If you\nneed to defer routing, you can call the application's deferReadiness()\nmethod. Once routing can begin, call the advanceReadiness() method.

\n

If there is any setup required before routing begins, you can implement a\nready() method on your app that will be invoked immediately before routing\nbegins.

\n", + "extends": "Engine", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/application/index.ts", + "line": 197, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 444, + "description": "

Create an ApplicationInstance for this application.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the application instance", + "type": "ApplicationInstance" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 469, + "description": "

Start tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is created.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_watchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 480, + "description": "

Stop tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is about to be destroyed.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_unwatchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 493, + "description": "

Enable the legacy globals mode by allowing this application to act\nas a global namespace. See the docs on the _globalsMode property\nfor details.

\n

Most of these features are already deprecated in 1.x, so we can\nstop using them internally and try to remove them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareForGlobalsMode", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 540, + "description": "

Automatically kick-off the boot process for the application once the\nDOM has become ready.

\n

The initialization itself is scheduled on the actions queue which\nensures that code-loading finishes before booting.

\n

If you are asynchronously loading code, you should call deferReadiness()\nto defer booting, and then call advanceReadiness() once all of your code\nhas finished loading.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "waitForDOMReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 580, + "description": "

This is the autoboot flow:

\n
    \n
  1. Boot the app by calling this.boot()
  2. \n
  3. Create an instance (or use the __deprecatedInstance__ in globals mode)
  4. \n
  5. Boot the instance by calling instance.boot()
  6. \n
  7. Invoke the App.ready() callback
  8. \n
  9. Kick-off routing on the instance
  10. \n
\n

Ideally, this is all we would need to do:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
_autoBoot() {\n  this.boot().then(() => {\n    let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance();\n    return instance.boot();\n  }).then((instance) => {\n    App.ready();\n    instance.startRouting();\n  });\n}
\n
\n
\n \n

Unfortunately, we cannot actually write this because we need to participate\nin the "synchronous" boot process. While the code above would work fine on\nthe initial boot (i.e. DOM ready), when App.reset() is called, we need to\nboot a new instance synchronously (see the documentation on _bootSync()\nfor details).

\n

Because of this restriction, the actual logic of this method is located\ninside didBecomeReady().

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "domReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 625, + "description": "

Use this to defer readiness until some condition is true.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Application from '@ember/application';\n\nlet App = Application.create();\n\nApp.deferReadiness();\n\nfetch('/auth-token')\n.then(response => response.json())\n.then(data => {\n  App.token = data.token;\n  App.advanceReadiness();\n});
\n
\n
\n \n

This allows you to perform asynchronous setup logic and defer\nbooting your application until the setup has finished.

\n

However, if the setup requires a loading UI, it might be better\nto use the router for this purpose.

\n", + "itemtype": "method", + "name": "deferReadiness", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 675, + "description": "

Call advanceReadiness after any asynchronous setup logic has completed.\nEach call to deferReadiness must be matched by a call to advanceReadiness\nor the application will never become ready and routing will not begin.

\n", + "itemtype": "method", + "name": "advanceReadiness", + "see": [ + "{Application#deferReadiness}" + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 714, + "description": "

Initialize the application and return a promise that resolves with the Application\nobject when the boot process is complete.

\n

Run any application initializers and run the application load hook. These hooks may\nchoose to defer readiness. For example, an authentication hook might want to defer\nreadiness until the auth token has been retrieved.

\n

By default, this method is called automatically on "DOM ready"; however, if autoboot\nis disabled, this is automatically called when the first application instance is\ncreated via visit.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 795, + "description": "

Reset the application. This is typically used only in tests. It cleans up\nthe application in the following order:

\n
    \n
  1. Deactivate existing routes
  2. \n
  3. Destroy all objects in the container
  4. \n
  5. Create a new application container
  6. \n
  7. Re-route to the existing url
  8. \n
\n

Typical Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    App.reset();\n  }\n});\n\ntest('first test', function() {\n  // App is freshly reset\n});\n\ntest('second test', function() {\n  // App is again freshly reset\n});
\n
\n
\n \n

Advanced Example:

\n

Occasionally you may want to prevent the app from initializing during\nsetup. This could enable extra configuration, or enable asserting prior\nto the app becoming ready.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    run(function() {\n      App.reset();\n      App.deferReadiness();\n    });\n  }\n});\n\ntest('first test', function() {\n  ok(true, 'something before app is initialized');\n\n  run(function() {\n    App.advanceReadiness();\n  });\n\n  ok(true, 'something after app is initialized');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reset", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 899, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "didBecomeReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 977, + "description": "

Boot a new instance of ApplicationInstance for the current\napplication and navigate it to the given url. Returns a Promise that\nresolves with the instance when the initial routing and rendering is\ncomplete, or rejects with any error that occurred during the boot process.

\n

When autoboot is disabled, calling visit would first cause the\napplication to boot, which runs the application initializers.

\n

This method also takes a hash of boot-time configuration options for\ncustomizing the instance's behavior. See the documentation on\nApplicationInstance.BootOptions for details.

\n

ApplicationInstance.BootOptions is an interface class that exists\npurely to document the available options; you do not need to construct it\nmanually. Simply pass a regular JavaScript object containing of the\ndesired options:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Supported Scenarios

\n

While the BootOptions class exposes a large number of knobs, not all\ncombinations of them are valid; certain incompatible combinations might\nresult in unexpected behavior.

\n

For example, booting the instance in the full browser environment\nwhile specifying a foreign document object (e.g. { isBrowser: true, document: iframe.contentDocument }) does not work correctly today,\nlargely due to Ember's jQuery dependency.

\n

Currently, there are three officially supported scenarios/configurations.\nUsages outside of these scenarios are not guaranteed to work, but please\nfeel free to file bug reports documenting your experience and any issues\nyou encountered to help expand support.

\n

Browser Applications (Manual Boot)

\n

The setup is largely similar to how Ember works out-of-the-box. Normally,\nEmber will boot a default instance for your Application on "DOM ready".\nHowever, you can customize this behavior by disabling autoboot.

\n

For example, this allows you to render a miniture demo of your application\ninto a specific area on your marketing website:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let options = {\n    // Override the router's location adapter to prevent it from updating\n    // the URL in the address bar\n    location: 'none',\n\n    // Override the default `rootElement` on the app to render into a\n    // specific `div` on the page\n    rootElement: '#demo'\n  };\n\n  // Start the app at the special demo URL\n  App.visit('/demo', options);\n});
\n
\n
\n \n

Or perhaps you might want to boot two instances of your app on the same\npage for a split-screen multiplayer experience:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let sessionId = MyApp.generateSessionID();\n\n  let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' });\n  let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' });\n\n  Promise.all([player1, player2]).then(() => {\n    // Both apps have completed the initial render\n    $('#loading').fadeOut();\n  });\n});
\n
\n
\n \n

Do note that each app instance maintains their own registry/container, so\nthey will run in complete isolation by default.

\n

Server-Side Rendering (also known as FastBoot)

\n

This setup allows you to run your Ember app in a server environment using\nNode.js and render its content into static HTML for SEO purposes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap);\n\nfunction renderURL(url) {\n  let dom = new SimpleDOM.Document();\n  let rootElement = dom.body;\n  let options = { isBrowser: false, document: dom, rootElement: rootElement };\n\n  return MyApp.visit(options).then(instance => {\n    try {\n      return HTMLSerializer.serialize(rootElement.firstChild);\n    } finally {\n      instance.destroy();\n    }\n  });\n}
\n
\n
\n \n

In this scenario, because Ember does not have access to a global document\nobject in the Node.js environment, you must provide one explicitly. In practice,\nin the non-browser environment, the stand-in document object only needs to\nimplement a limited subset of the full DOM API. The SimpleDOM library is known\nto work.

\n

Since there is no DOM access in the non-browser environment, you must also\nspecify a DOM Element object in the same document for the rootElement option\n(as opposed to a selector string like "body").

\n

See the documentation on the isBrowser, document and rootElement properties\non ApplicationInstance.BootOptions for details.

\n

Server-Side Resource Discovery

\n

This setup allows you to run the routing layer of your Ember app in a server\nenvironment using Node.js and completely disable rendering. This allows you\nto simulate and discover the resources (i.e. AJAX requests) needed to fulfill\na given request and eagerly "push" these resources to the client.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
service.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import BrowserNetworkService from 'app/services/network/browser';\nimport NodeNetworkService from 'app/services/network/node';\n\n// Inject a (hypothetical) service for abstracting all AJAX calls and use\n// the appropriate implementation on the client/server. This also allows the\n// server to log all the AJAX calls made during a particular request and use\n// that for resource-discovery purpose.\n\nexport function initialize(application) {\n  if (window) { // browser\n    application.register('service:network', BrowserNetworkService);\n  } else { // node\n    application.register('service:network', NodeNetworkService);\n  }\n};\n\nexport default {\n  name: 'network-service',\n  initialize: initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\n// An example of how the (hypothetical) service is used in routes.\n\nexport default class IndexRoute extends Route {\n  @service network;\n\n  model(params) {\n    return this.network.fetch(`/api/posts/${params.post_id}.json`);\n  }\n\n  afterModel(post) {\n    if (post.isExternalContent) {\n      return this.network.fetch(`/api/external/?url=${post.externalURL}`);\n    } else {\n      return post;\n    }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
// Finally, put all the pieces together\n\nfunction discoverResourcesFor(url) {\n  return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => {\n    let networkService = instance.lookup('service:network');\n    return networkService.requests; // => { "/api/posts/123.json": "..." }\n  });\n}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "The initial URL to navigate to", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "ApplicationInstance.BootOptions" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 62, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 209, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 285, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 346, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 359, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 371, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 384, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 392, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 400, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 414, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 448, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Enginer" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 41, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [ + { + "file": "packages/@ember/application/index.ts", + "line": 952, + "description": "

Called when the Application has become ready, immediately before routing\nbegins. The call will be delayed until the DOM has become ready.

\n", + "itemtype": "event", + "name": "ready", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + } + ], + "properties": [ + { + "file": "packages/@ember/application/index.ts", + "line": 242, + "description": "

The root DOM element of the Application. This can be specified as an\nelement or a selector string.

\n

This is the element that will be passed to the Application's,\neventDispatcher, which sets up the listeners for event delegation. Every\nview in your application should be a child of the element you specify here.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 257, + "itemtype": "property", + "name": "_document", + "type": "Document | null", + "default": "'window.document'", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 266, + "description": "

The Ember.EventDispatcher responsible for delegating events to this\napplication's views.

\n

The event dispatcher is created by the application at initialization time\nand sets up event listeners on the DOM element described by the\napplication's rootElement property.

\n

See the documentation for Ember.EventDispatcher for more information.

\n", + "itemtype": "property", + "name": "eventDispatcher", + "type": "Ember.EventDispatcher", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 283, + "description": "

The DOM events for which the event dispatcher should listen.

\n

By default, the application's Ember.EventDispatcher listens\nfor a set of standard DOM events, such as mousedown and\nkeyup, and delegates them to your application's Ember.View\ninstances.

\n

If you would like additional bubbling events to be delegated to your\nviews, set your Application's customEvents property\nto a hash containing the DOM event name as the key and the\ncorresponding view method name as the value. Setting an event to\na value of null will prevent a default event listener from being\nadded for that event.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // add support for the paste event\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // remove support for mouseenter / mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "customEvents", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 331, + "description": "

Whether the application should automatically start routing and render\ntemplates to the rootElement on DOM ready. While default by true,\nother environments such as FastBoot or a testing harness can set this\nproperty to false and control the precise timing and behavior of the boot\nprocess.

\n", + "itemtype": "property", + "name": "autoboot", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 345, + "description": "

Whether the application should be configured for the legacy "globals mode".\nUnder this mode, the Application object serves as a global namespace for all\nclasses.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Application from '@ember/application';\nimport Component from '@ember/component';\n\nlet App = Application.create({\n  ...\n});\n\nApp.Router.reopen({\n  location: 'none'\n});\n\nApp.Router.map({\n  ...\n});\n\nApp.MyComponent = Component.extend({\n  ...\n});
\n
\n
\n \n

This flag also exposes other internal APIs that assumes the existence of\na special "default instance", like App.__container__.lookup(...).

\n

This option is currently not configurable, its value is derived from\nthe autoboot flag – disabling autoboot also implies opting-out of\nglobals mode support, although they are ultimately orthogonal concerns.

\n

Some of the global modes features are already deprecated in 1.x. The\nexistence of this flag is to untangle the globals mode code paths from\nthe autoboot code paths, so that these legacy features can be reviewed\nfor deprecation/removal separately.

\n

Forcing the (autoboot=true, _globalsMode=false) here and running the tests\nwould reveal all the places where we are still relying on these legacy\nbehavior internally (mostly just tests).

\n", + "itemtype": "property", + "name": "_globalsMode", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 394, + "description": "

An array of application instances created by buildInstance(). Used\ninternally to ensure that all instances get destroyed.

\n", + "itemtype": "property", + "name": "_applicationInstances", + "type": "Array", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 325, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 338, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-Engine", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-ApplicationInstance-af788aa2af.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-ApplicationInstance-d387569d70.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-ApplicationInstance-af788aa2af.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-ApplicationInstance-d387569d70.json index 71caa9141..428b34d29 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-ApplicationInstance-af788aa2af.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-ApplicationInstance-d387569d70.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-ApplicationInstance", + "id": "ember-4.12.3-ApplicationInstance", "type": "class", "attributes": { "name": "ApplicationInstance", @@ -810,7 +810,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EngineInstance", + "id": "ember-4.12.3-EngineInstance", "type": "class" } }, @@ -819,13 +819,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/application", + "id": "ember-4.12.3-@ember/application", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-ApplicationInstance.BootOptions-f46f614d20.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-ApplicationInstance.BootOptions-f46f614d20.json new file mode 100644 index 000000000..4e95fc379 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-ApplicationInstance.BootOptions-f46f614d20.json @@ -0,0 +1,143 @@ +{ + "data": { + "id": "ember-4.12.3-ApplicationInstance.BootOptions", + "type": "class", + "attributes": { + "name": "ApplicationInstance.BootOptions", + "shortname": "ApplicationInstance.BootOptions", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "ApplicationInstance", + "file": "packages/@ember/application/instance.ts", + "line": 316, + "description": "

A list of boot-time configuration options for customizing the behavior of\nan ApplicationInstance.

\n

This is an interface class that exists purely to document the available\noptions; you do not need to construct it manually. Simply pass a regular\nJavaScript object containing the desired options into methods that require\none of these options object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Not all combinations of the supported options are valid. See the documentation\non Application#visit for the supported configurations.

\n

Internal, experimental or otherwise unstable flags are marked as private.

\n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 339, + "description": "

Interactive mode: whether we need to set up event delegation and invoke\nlifecycle callbacks on Components.

\n", + "itemtype": "property", + "name": "isInteractive", + "type": "boolean", + "default": "auto-detected", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 350, + "itemtype": "property", + "name": "_renderMode", + "type": "string", + "default": "undefined", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 358, + "description": "

Run in a full browser environment.

\n

When this flag is set to false, it will disable most browser-specific\nand interactive features. Specifically:

\n
    \n
  • It does not use jQuery to append the root view; the rootElement\n(either specified as a subsequent option or on the application itself)\nmust already be an Element in the given document (as opposed to a\nstring selector).

    \n
  • \n
  • It does not set up an EventDispatcher.

    \n
  • \n
  • It does not run any Component lifecycle hooks (such as didInsertElement).

    \n
  • \n
  • It sets the location option to "none". (If you would like to use\nthe location adapter specified in the app's router instead, you can also\nspecify { location: null } to specifically opt-out.)

    \n
  • \n
\n", + "itemtype": "property", + "name": "isBrowser", + "type": "boolean", + "default": "auto-detected", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 384, + "description": "

If present, overrides the router's location property with this\nvalue. This is useful for environments where trying to modify the\nURL would be inappropriate.

\n", + "itemtype": "property", + "name": "location", + "type": "string", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 396, + "description": "

Disable rendering completely.

\n

When this flag is set to false, it will disable the entire rendering\npipeline. Essentially, this puts the app into "routing-only" mode. No\ntemplates will be rendered, and no Components will be created.

\n", + "itemtype": "property", + "name": "shouldRender", + "type": "boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 410, + "description": "

If present, render into the given Document object instead of the\nglobal window.document object.

\n

In practice, this is only useful in non-browser environment or in\nnon-interactive mode, because Ember's jQuery dependency is\nimplicitly bound to the current document, causing event delegation\nto not work properly when the app is rendered into a foreign\ndocument object (such as an iframe's contentDocument).

\n

In non-browser mode, this could be a "Document-like" object as\nEmber only interact with a small subset of the DOM API in non-\ninteractive mode. While the exact requirements have not yet been\nformalized, the SimpleDOM library's implementation is known to\nwork.

\n", + "itemtype": "property", + "name": "document", + "type": "Document", + "default": "the global `document` object", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 433, + "description": "

If present, overrides the application's rootElement property on\nthe instance. This is useful for testing environment, where you\nmight want to append the root view to a fixture area.

\n

In non-browser mode, because Ember does not have access to jQuery,\nthis options must be specified as a DOM Element object instead of\na selector string.

\n

See the documentation on Application's rootElement for\ndetails.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "String|Element", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-ArrayProxy-701dffffbd.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-ArrayProxy-701dffffbd.json new file mode 100644 index 000000000..519d93c4f --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-ArrayProxy-701dffffbd.json @@ -0,0 +1,1834 @@ +{ + "data": { + "id": "ember-4.12.3-ArrayProxy", + "type": "class", + "attributes": { + "name": "ArrayProxy", + "shortname": "ArrayProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/array/proxy", + "namespace": "", + "file": "packages/@ember/array/proxy.ts", + "line": 59, + "description": "

An ArrayProxy wraps any other object that implements Array and/or\nMutableArray, forwarding all requests. This makes it very useful for\na number of binding use cases or other cases where being able to swap\nout the underlying array is useful.

\n

A simple example of usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({ content: A(pets) });\n\nap.get('firstObject');                        // 'dog'\nap.set('content', ['amoeba', 'paramecium']);\nap.get('firstObject');                        // 'amoeba'
\n
\n
\n \n

This class can also be useful as a layer to transform the contents of\nan array, as they are accessed. This can be done by overriding\nobjectAtContent:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({\n    content: A(pets),\n    objectAtContent: function(idx) {\n        return this.get('content').objectAt(idx).toUpperCase();\n    }\n});\n\nap.get('firstObject'); // . 'DOG'
\n
\n
\n \n

When overriding this class, it is important to place the call to\n_super after setting content so the internal observers have\na chance to fire properly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nexport default ArrayProxy.extend({\n  init() {\n    this.set('content', A(['dog', 'cat', 'fish']));\n    this._super(...arguments);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/array/proxy.ts", + "line": 138, + "description": "

Should actually retrieve the object at the specified index from the\ncontent. You can override this method in subclasses to transform the\ncontent item to something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "objectAtContent", + "params": [ + { + "name": "idx", + "description": "The index to retrieve.", + "type": "Number" + } + ], + "return": { + "description": "the value or undefined if none found", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/array/proxy.ts", + "line": 151, + "description": "

Should actually replace the specified objects on the content array.\nYou can override this method in subclasses to transform the content item\ninto something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "replaceContent", + "params": [ + { + "name": "idx", + "description": "The starting index", + "type": "Number" + }, + { + "name": "amt", + "description": "The number of items to remove from the content.", + "type": "Number" + }, + { + "name": "objects", + "description": "Optional array of objects to insert.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1484, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1503, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1520, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1538, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1560, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1577, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1593, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1609, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1625, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1642, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1659, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1668, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1686, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1703, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1712, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1729, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/proxy.ts", + "line": 120, + "description": "

The content array. Must be an object that implements Array and/or\nMutableArray.

\n", + "itemtype": "property", + "name": "content", + "type": "EmberArray", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/array/proxy.ts", + "line": 129, + "description": "

The array that the proxy pretends to be. In the default ArrayProxy\nimplementation, this and content are the same. Subclasses of ArrayProxy\ncan override this property to provide things like sorting and filtering.

\n", + "itemtype": "property", + "name": "arrangedContent", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/array/proxy", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-BasicContainer-a6f6a1c3f3.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-BasicContainer-a6f6a1c3f3.json new file mode 100644 index 000000000..ef10d2d4b --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-BasicContainer-a6f6a1c3f3.json @@ -0,0 +1,102 @@ +{ + "data": { + "id": "ember-4.12.3-BasicContainer", + "type": "class", + "attributes": { + "name": "BasicContainer", + "shortname": "BasicContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Owner" + ], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 180, + "description": "

The common interface for the ability to lookup() or get the factoryFor an\nitem, shared by the Owner and ContainerProxy interfaces.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 189, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "BasicContainer", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 238, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "BasicContainer", + "module": "@ember/owner" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.12.3-ContainerProxy" + } + ] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-BasicRegistry-897c533361.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-BasicRegistry-897c533361.json new file mode 100644 index 000000000..9d8c2cb68 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-BasicRegistry-897c533361.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-4.12.3-BasicRegistry", + "type": "class", + "attributes": { + "name": "BasicRegistry", + "shortname": "BasicRegistry", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Owner" + ], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 89, + "description": "

The common interface for the ability to register() an item, shared by the\nOwner and RegistryProxy interfaces.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "BasicRegistry", + "module": "@ember/owner" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.12.3-RegistryProxy" + } + ] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-BucketCache-b83769154c.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-BucketCache-81e32bfa6d.json similarity index 89% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-BucketCache-b83769154c.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-BucketCache-81e32bfa6d.json index 5dc238c83..bd0008d95 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-BucketCache-b83769154c.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-BucketCache-81e32bfa6d.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-BucketCache", + "id": "ember-4.12.3-BucketCache", "type": "class", "attributes": { "name": "BucketCache", @@ -30,13 +30,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/renderer", + "id": "ember-4.12.3-@ember/renderer", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Component-1ea80e1741.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Component-2955549b6a.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Component-1ea80e1741.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Component-2955549b6a.json index 9ea74c350..5ac2dd018 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Component-1ea80e1741.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Component-2955549b6a.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Component", + "id": "ember-4.12.3-Component", "type": "class", "attributes": { "name": "Component", @@ -1563,7 +1563,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-Ember.CoreView", + "id": "ember-4.12.3-Ember.CoreView", "type": "class" } }, @@ -1572,13 +1572,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/component", + "id": "ember-4.12.3-@ember/component", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-ComponentStateBucket-852941b0a1.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-ComponentStateBucket-a4bbf559ac.json similarity index 89% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-ComponentStateBucket-852941b0a1.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-ComponentStateBucket-a4bbf559ac.json index dee2d8472..f4015a0ad 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-ComponentStateBucket-852941b0a1.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-ComponentStateBucket-a4bbf559ac.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-ComponentStateBucket", + "id": "ember-4.12.3-ComponentStateBucket", "type": "class", "attributes": { "name": "ComponentStateBucket", @@ -30,13 +30,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-ComputedProperty-4fd201aa95.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-ComputedProperty-4fd201aa95.json new file mode 100644 index 000000000..24d76e195 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-ComputedProperty-4fd201aa95.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-4.12.3-ComputedProperty", + "type": "class", + "attributes": { + "name": "ComputedProperty", + "shortname": "ComputedProperty", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 76, + "description": "

@computed is a decorator that turns a JavaScript getter and setter into a\ncomputed property, which is a cached, trackable value. By default the getter\nwill only be called once and the result will be cached. You can specify\nvarious properties that your computed property depends on. This will force the\ncached result to be cleared if the dependencies are modified, and lazily recomputed the next time something asks for it.

\n

In the following example we decorate a getter - fullName - by calling\ncomputed with the property dependencies (firstName and lastName) as\narguments. The fullName getter will be called once (regardless of how many\ntimes it is accessed) as long as its dependencies do not change. Once\nfirstName or lastName are updated any future calls to fullName will\nincorporate the new values, and any watchers of the value such as templates\nwill be updated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet tom = new Person('Tom', 'Dale');\n\ntom.fullName; // 'Tom Dale'
\n
\n
\n \n

You can also provide a setter, which will be used when updating the computed\nproperty. Ember's set function must be used to update the property\nsince it will also notify observers of the property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(' ');\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

You can also pass a getter function or object with get and set functions\nas the last argument to the computed decorator. This allows you to define\ncomputed property macros:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { computed } from '@ember/object';\n\nfunction join(...keys) {\n  return computed(...keys, function() {\n    return keys.map(key => this[key]).join(' ');\n  });\n}\n\nclass Person {\n  @join('firstName', 'lastName')\n  fullName;\n}
\n
\n
\n \n

Note that when defined this way, getters and setters receive the key of the\nproperty they are decorating as the first argument. Setters receive the value\nthey are setting to as the second argument instead. Additionally, setters must\nreturn the value that should be cached:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { computed, set } from '@ember/object';\n\nfunction fullNameMacro(firstNameKey, lastNameKey) {\n  return computed(firstNameKey, lastNameKey, {\n    get() {\n      return `${this[firstNameKey]} ${this[lastNameKey]}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, firstNameKey, firstName);\n      set(this, lastNameKey, lastName);\n\n      return value;\n    }\n  });\n}\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @fullNameMacro('firstName', 'lastName') fullName;\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

Computed properties can also be used in classic classes. To do this, we\nprovide the getter and setter as the last argument like we would for a macro,\nand we assign it to a property on the class definition. This is an anonymous\ncomputed macro:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import EmberObject, { computed, set } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  // these will be supplied by `create`\n  firstName: null,\n  lastName: null,\n\n  fullName: computed('firstName', 'lastName', {\n    get() {\n      return `${this.firstName} ${this.lastName}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, 'firstName', firstName);\n      set(this, 'lastName', lastName);\n\n      return value;\n    }\n  })\n});\n\nlet tom = Person.create({\n  firstName: 'Tom',\n  lastName: 'Dale'\n});\n\ntom.get('fullName') // 'Tom Dale'
\n
\n
\n \n

You can overwrite computed property without setters with a normal property (no\nlonger computed) that won't change if dependencies change. You can also mark\ncomputed property as .readOnly() and block all attempts to set it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName').readOnly()\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet person = new Person();\nperson.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX>
\n
\n
\n \n

Additional resources:

\n\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 606, + "description": "

Call on a computed property to set it into read-only mode. When in this\nmode the computed property will throw an error when set.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  @computed().readOnly()\n  get guid() {\n    return 'guid-guid-guid';\n  }\n}\n\nlet person = new Person();\nset(person, 'guid', 'new-guid'); // will throw an exception
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  guid: computed(function() {\n    return 'guid-guid-guid';\n  }).readOnly()\n});\n\nlet person = Person.create();\nperson.set('guid', 'new-guid'); // will throw an exception
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "return": { + "description": "this", + "type": "ComputedProperty" + }, + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 656, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For example,\ncomputed property functions may close over variables that are then no longer\navailable for introspection. You can pass a hash of these values to a\ncomputed property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nclass Store {\n  @computed().meta({ type: Person })\n  get person() {\n    let personId = this.personId;\n    return Person.create({ id: personId });\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nconst Store = EmberObject.extend({\n  person: computed(function() {\n    let personId = this.get('personId');\n    return Person.create({ id: personId });\n  }).meta({ type: Person })\n});
\n
\n
\n \n

The hash that you pass to the meta() function will be saved on the\ncomputed property descriptor under the _meta key. Ember runtime\nexposes a public API for retrieving these values from classes,\nvia the metaForProperty() function.

\n", + "itemtype": "method", + "name": "meta", + "params": [ + { + "name": "meta", + "description": "", + "type": "Object" + } + ], + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Container-976f9da7fb.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Container-976f9da7fb.json new file mode 100644 index 000000000..184d2ea7c --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Container-976f9da7fb.json @@ -0,0 +1,175 @@ +{ + "data": { + "id": "ember-4.12.3-Container", + "type": "class", + "attributes": { + "name": "Container", + "shortname": "Container", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 60, + "description": "

A container used to instantiate and cache objects.

\n

Every Container must be associated with a Registry, which is referenced\nto determine the factory and options that should be used to instantiate\nobjects.

\n

The public API for Container is still in flux and should not be considered\nstable.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 119, + "description": "

Given a fullName return a corresponding instance.\n The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter');\ntwitter instanceof Twitter; // => true\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted, an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions", + "optional": true + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 161, + "description": "

A depth first traversal, destroying the container, its descendant containers and all\ntheir managed objects.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "destroy", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 178, + "description": "

Clear either the entire cache or just the cache for a particular key.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "params": [ + { + "name": "fullName", + "description": "optional key to reset; if missing, resets everything", + "type": "String" + } + ], + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 195, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "return": { + "description": "", + "type": "Object" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 208, + "description": "

Given a fullName, return the corresponding factory. The consumer of the factory\nis responsible for the destruction of any factory instances, as there is no\nway for the container to ensure instances are destroyed when it itself is\ndestroyed.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 100, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registry", + "type": "Registry", + "since": "1.11.0", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 107, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "cache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 113, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "validationCache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-ContainerDebugAdapter-4f3d85db1d.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-ContainerDebugAdapter-4f3d85db1d.json new file mode 100644 index 000000000..ffb7df43e --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-ContainerDebugAdapter-4f3d85db1d.json @@ -0,0 +1,592 @@ +{ + "data": { + "id": "ember-4.12.3-ContainerDebugAdapter", + "type": "class", + "attributes": { + "name": "ContainerDebugAdapter", + "shortname": "ContainerDebugAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug/container-debug-adapter", + "namespace": "", + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 13, + "description": "

The ContainerDebugAdapter helps the container and resolver interface\nwith tools that debug Ember such as the\nEmber Inspector\nfor Chrome and Firefox.

\n

This class can be extended by a custom resolver implementer\nto override some of the methods with library-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • canCatalogEntriesByType
  • \n
  • catalogEntriesByType
  • \n
\n

The adapter will need to be registered\nin the application's container as container-debug-adapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "containerDebugAdapter",\n\n  initialize(application) {\n    application.register('container-debug-adapter:main', require('app/container-debug-adapter'));\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "since": "1.5.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 64, + "description": "

Returns true if it is possible to catalog a list of available\nclasses in the resolver for a given type.

\n", + "itemtype": "method", + "name": "canCatalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "whether a list is available for this type.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug/container-debug-adapter" + }, + { + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 81, + "description": "

Returns the available classes a given type.

\n", + "itemtype": "method", + "name": "catalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "An array of strings.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug/container-debug-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 54, + "description": "

The resolver instance of the application\nbeing debugged. This property will be injected\non creation.

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug/container-debug-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/debug/container-debug-adapter", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-ContainerProxy-5cbf744615.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-ContainerProxy-5cbf744615.json new file mode 100644 index 000000000..520c7d3c8 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-ContainerProxy-5cbf744615.json @@ -0,0 +1,108 @@ +{ + "data": { + "id": "ember-4.12.3-ContainerProxy", + "type": "class", + "attributes": { + "name": "ContainerProxy", + "shortname": "ContainerProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 554, + "description": "

The interface for a container proxy, which is itself a private API used\nby the private ContainerProxyMixin as part of the base definition of\nEngineInstance.

\n", + "access": "private", + "tagname": "", + "extends": "BasicContainer", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 189, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ContainerProxy", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 238, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ContainerProxy", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-BasicContainer", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.12.3-ContainerProxyMixin" + } + ] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-ContainerProxyMixin-a69e3e8823.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-ContainerProxyMixin-a69e3e8823.json new file mode 100644 index 000000000..926c5e7b5 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-ContainerProxyMixin-a69e3e8823.json @@ -0,0 +1,118 @@ +{ + "data": { + "id": "ember-4.12.3-ContainerProxyMixin", + "type": "class", + "attributes": { + "name": "ContainerProxyMixin", + "shortname": "ContainerProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 12, + "description": "

ContainerProxyMixin is used to provide public access to specific\ncontainer functionality.

\n", + "extends": "ContainerProxy", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 189, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ContainerProxyMixin", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 238, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ContainerProxyMixin", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 25, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ContainerProxyMixin", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-ContainerProxy", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-CoreObject-3f8bc3ffb3.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-CoreObject-3f8bc3ffb3.json new file mode 100644 index 000000000..00cc08aad --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-CoreObject-3f8bc3ffb3.json @@ -0,0 +1,158 @@ +{ + "data": { + "id": "ember-4.12.3-CoreObject", + "type": "class", + "attributes": { + "name": "CoreObject", + "shortname": "CoreObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/core", + "namespace": "", + "file": "packages/@ember/object/core.ts", + "line": 172, + "description": "

CoreObject is the base class for all Ember constructs. It establishes a\nclass system based on Ember's Mixin system, and provides the basis for the\nEmber Object Model. CoreObject should generally not be used directly,\ninstead you should use EmberObject.

\n

Usage

\n

You can define a class by extending from CoreObject using the extend\nmethod:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Person = CoreObject.extend({\n  name: 'Tomster',\n});
\n
\n
\n \n

For detailed usage, see the Object Model\nsection of the guides.

\n

Usage with Native Classes

\n

Native JavaScript class syntax can be used to extend from any CoreObject\nbased class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
class Person extends CoreObject {\n  init() {\n    super.init(...arguments);\n    this.name = 'Tomster';\n  }\n}
\n
\n
\n \n

Some notes about class usage:

\n
    \n
  • new syntax is not currently supported with classes that extend from\nEmberObject or CoreObject. You must continue to use the create method\nwhen making new instances of classes, even if they are defined using native\nclass syntax. If you want to use new syntax, consider creating classes\nwhich do not extend from EmberObject or CoreObject. Ember features,\nsuch as computed properties and decorators, will still work with base-less\nclasses.
  • \n
  • Instead of using this._super(), you must use standard super syntax in\nnative classes. See the MDN docs on classes\nfor more details.
  • \n
  • Native classes support using constructors\nto set up newly-created instances. Ember uses these to, among other things,\nsupport features that need to retrieve other entities by name, like Service\ninjection and getOwner. To ensure your custom instance setup logic takes\nplace after this important work is done, avoid using the constructor in\nfavor of init.
  • \n
  • Properties passed to create will be available on the instance by the time\ninit runs, so any code that requires these values should work at that\ntime.
  • \n
  • Using native classes, and switching back to the old Ember Object model is\nfully supported.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.12.3-Helper" + }, + { + "type": "class", + "id": "ember-4.12.3-EmberObject" + } + ] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/object/core", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-DataAdapter-4a8e940600.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-DataAdapter-4a8e940600.json new file mode 100644 index 000000000..bc918ba7c --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-DataAdapter-4a8e940600.json @@ -0,0 +1,935 @@ +{ + "data": { + "id": "ember-4.12.3-DataAdapter", + "type": "class", + "attributes": { + "name": "DataAdapter", + "shortname": "DataAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug/data-adapter", + "namespace": "", + "file": "packages/@ember/debug/data-adapter.ts", + "line": 173, + "description": "

The DataAdapter helps a data persistence library\ninterface with tools that debug Ember such\nas the Ember Inspector\nfor Chrome and Firefox.

\n

This class will be extended by a persistence library\nwhich will override some of the methods with\nlibrary-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • getFilters
  • \n
  • detect
  • \n
  • columnsForType
  • \n
  • getRecords
  • \n
  • getRecordColumnValues
  • \n
  • getRecordKeywords
  • \n
  • getRecordFilterValues
  • \n
  • getRecordColor
  • \n
\n

The adapter will need to be registered\nin the application's container as dataAdapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "data-adapter",\n\n  initialize: function(application) {\n    application.register('data-adapter:main', DS.DataAdapter);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 300, + "description": "

Specifies how records can be filtered.\nRecords returned will need to have a filterValues\nproperty with a key for every name in the returned array.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getFilters", + "return": { + "description": "List of objects defining filters.\n The object should have a `name` and `desc` property.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 314, + "description": "

Fetch the model types and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchModelTypes", + "params": [ + { + "name": "typesAdded", + "description": "Callback to call to add types.\nTakes an array of objects containing wrapped types (returned from `wrapModelType`).", + "type": "Function" + }, + { + "name": "typesUpdated", + "description": "Callback to call when a type has changed.\nTakes an array of objects containing wrapped types.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 362, + "description": "

Fetch the records of a given type and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchRecords", + "params": [ + { + "name": "modelName", + "description": "The model name.", + "type": "String" + }, + { + "name": "recordsAdded", + "description": "Callback to call to add records.\nTakes an array of objects containing wrapped records.\nThe object should have the following properties:\n columnValues: {Object} The key and value of a table cell.\n object: {Object} The actual record object.", + "type": "Function" + }, + { + "name": "recordsUpdated", + "description": "Callback to call when a record has changed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + }, + { + "name": "recordsRemoved", + "description": "Callback to call when a record has removed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 434, + "description": "

Clear all observers before destruction

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 452, + "description": "

Detect whether a class is a model.

\n

Test that against the model class\nof your persistence library.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "detect", + "return": { + "description": "boolean Whether the class is a model class or not." + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 466, + "description": "

Get the columns for a given model type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "columnsForType", + "return": { + "description": "An array of columns of the following format:\n name: {String} The name of the column.\n desc: {String} Humanized description (what would show in a table column name).", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 479, + "description": "

Adds observers to a model type class.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "observeModelType", + "params": [ + { + "name": "modelName", + "description": "The model type name.", + "type": "String" + }, + { + "name": "typesUpdated", + "description": "Called when a type is modified.", + "type": "Function" + } + ], + "return": { + "description": "The function to call to remove observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 516, + "description": "

Wraps a given model type and observes changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapModelType", + "params": [ + { + "name": "klass", + "description": "A model class.", + "type": "Class" + }, + { + "name": "modelName", + "description": "Name of the class.", + "type": "String" + } + ], + "return": { + "description": "The wrapped type has the following format:\n name: {String} The name of the type.\n count: {Integer} The number of records available.\n columns: {Columns} An array of columns to describe the record.\n object: {Class} The actual Model type class.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 540, + "description": "

Fetches all models defined in the application.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getModelTypes", + "return": { + "description": "Array of model types.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 565, + "description": "

Loops over all namespaces and all objects\nattached to them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getObjectsOnNamespaces", + "return": { + "description": "Array of model type strings.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 594, + "description": "

Fetches all loaded records for a given type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecords", + "return": { + "description": "An array of records.\n This array will be observed for changes,\n so it should update when new records are added/removed.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 607, + "description": "

Wraps a record and observers changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapRecord", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The wrapped record. Format:\ncolumnValues: {Array}\nsearchKeywords: {Array}", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 627, + "description": "

Gets the values for each column.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColumnValues", + "return": { + "description": "Keys should match column names defined\nby the model type.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 639, + "description": "

Returns keywords to match when searching records.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordKeywords", + "return": { + "description": "Relevant keywords for search.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 650, + "description": "

Returns the values of filters defined by getFilters.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordFilterValues", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The filter values.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 662, + "description": "

Each record can have a color that represents its state.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColor", + "params": [ + { + "name": "record", + "description": "The record instance", + "type": "Object" + } + ], + "return": { + "description": "The records color.\n Possible options: black, red, blue, green.", + "type": "String" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 229, + "description": "

The container-debug-adapter which is used\nto list all models.

\n", + "itemtype": "property", + "name": "containerDebugAdapter", + "default": "undefined", + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 239, + "description": "

The number of attributes to send\nas columns. (Enough to make the record\nidentifiable).

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "attributeLimit", + "default": "3", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 251, + "description": "

Ember Data > v1.0.0-beta.18\nrequires string model names to be passed\naround instead of the actual factories.

\n

This is a stamp for the Ember Inspector\nto differentiate between the versions\nto be able to support older versions too.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "acceptsModelName", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 265, + "description": "

Map from records arrays to RecordsWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "recordsWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 273, + "description": "

Map from records arrays to TypeWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "typeWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 281, + "description": "

Callback that is currently scheduled on backburner end to flush and check\nall active watchers.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "flushWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 291, + "description": "

Stores all methods that clear observers.\nThese methods will be called on destruction.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "releaseMethods", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/debug/data-adapter", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Descriptor-88c6183c13.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Descriptor-0259090ac1.json similarity index 96% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Descriptor-88c6183c13.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Descriptor-0259090ac1.json index 7990372af..082fc35f5 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Descriptor-88c6183c13.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Descriptor-0259090ac1.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Descriptor", + "id": "ember-4.12.3-Descriptor", "type": "class", "attributes": { "name": "Descriptor", @@ -98,13 +98,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/object", + "id": "ember-4.12.3-@ember/object", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember-9d704ab923.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember-cf9a032bf3.json similarity index 98% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember-9d704ab923.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Ember-cf9a032bf3.json index 2a14c7a8d..5f5adec28 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember-9d704ab923.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember-cf9a032bf3.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember", + "id": "ember-4.12.3-Ember", "type": "class", "attributes": { "name": "Ember", @@ -181,13 +181,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/utils", + "id": "ember-4.12.3-@ember/utils", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.@ember/controller-d0732a0a6d.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.@ember/controller-2fb1e3560d.json similarity index 96% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.@ember/controller-d0732a0a6d.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.@ember/controller-2fb1e3560d.json index 94be00520..84f832338 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.@ember/controller-d0732a0a6d.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.@ember/controller-2fb1e3560d.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.@ember/controller", + "id": "ember-4.12.3-Ember.@ember/controller", "type": "class", "attributes": { "name": "Ember.@ember/controller", @@ -50,13 +50,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/controller", + "id": "ember-4.12.3-@ember/controller", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ActionHandler-704f4c1f54.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ActionHandler-704f4c1f54.json new file mode 100644 index 000000000..bd7e27756 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ActionHandler-704f4c1f54.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.12.3-Ember.ActionHandler", + "type": "class", + "attributes": { + "name": "Ember.ActionHandler", + "shortname": "Ember.ActionHandler", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.CoreView", + "Ember.ControllerMixin" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 9, + "description": "

Ember.ActionHandler is available on some familiar classes including\nRoute, Component, and Controller.\n(Internally the mixin is used by Ember.CoreView, Ember.ControllerMixin,\nand Route and available to the above classes through\ninheritance.)

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ActionSupport-9fd3130f31.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ActionSupport-341f9b66b9.json similarity index 88% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ActionSupport-9fd3130f31.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ActionSupport-341f9b66b9.json index 09adbad09..df1219fdf 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ActionSupport-9fd3130f31.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ActionSupport-341f9b66b9.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.ActionSupport", + "id": "ember-4.12.3-Ember.ActionSupport", "type": "class", "attributes": { "name": "Ember.ActionSupport", @@ -31,13 +31,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ClassNamesSupport-2eafff586d.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ClassNamesSupport-23c430e31e.json similarity index 98% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ClassNamesSupport-2eafff586d.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ClassNamesSupport-23c430e31e.json index 392184650..6cbb6a919 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ClassNamesSupport-2eafff586d.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ClassNamesSupport-23c430e31e.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.ClassNamesSupport", + "id": "ember-4.12.3-Ember.ClassNamesSupport", "type": "class", "attributes": { "name": "Ember.ClassNamesSupport", @@ -73,13 +73,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Comparable-3afc2de3ee.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Comparable-da46e01091.json similarity index 95% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Comparable-3afc2de3ee.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Comparable-da46e01091.json index fa0ee326e..cd20b4276 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Comparable-3afc2de3ee.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Comparable-da46e01091.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.Comparable", + "id": "ember-4.12.3-Ember.Comparable", "type": "class", "attributes": { "name": "Ember.Comparable", @@ -60,13 +60,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Controller-389d43a0cf.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Controller-a2f9ae6cde.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Controller-389d43a0cf.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Controller-a2f9ae6cde.json index f4715a127..fe43424ae 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Controller-389d43a0cf.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Controller-a2f9ae6cde.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.Controller", + "id": "ember-4.12.3-Ember.Controller", "type": "class", "attributes": { "name": "Ember.Controller", @@ -705,7 +705,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.12.3-EmberObject", "type": "class" } }, @@ -714,13 +714,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/controller", + "id": "ember-4.12.3-@ember/controller", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ControllerMixin-6e4eca0de4.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ControllerMixin-14e882ed75.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ControllerMixin-6e4eca0de4.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ControllerMixin-14e882ed75.json index a71f4249f..c960d9166 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ControllerMixin-6e4eca0de4.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ControllerMixin-14e882ed75.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.ControllerMixin", + "id": "ember-4.12.3-Ember.ControllerMixin", "type": "class", "attributes": { "name": "Ember.ControllerMixin", @@ -213,13 +213,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/controller", + "id": "ember-4.12.3-@ember/controller", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.CoreView-e98e7e5cc7.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.CoreView-e98e7e5cc7.json new file mode 100644 index 000000000..45e61e878 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.CoreView-e98e7e5cc7.json @@ -0,0 +1,933 @@ +{ + "data": { + "id": "ember-4.12.3-Ember.CoreView", + "type": "class", + "attributes": { + "name": "Ember.CoreView", + "shortname": "Ember.CoreView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 9, + "description": "

Ember.CoreView is an abstract class that exists to give view-like behavior\nto both Ember's main view class Component and other classes that don't need\nthe full functionality of Component.

\n

Unless you have specific needs for CoreView, you will use Component\nin your applications.

\n", + "extends": "EmberObject", + "deprecated": true, + "deprecationMessage": "Use `Component` instead.", + "uses": [ + "Evented", + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 36, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 58, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 78, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 110, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 153, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 162, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 177, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 193, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 209, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 77, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 38, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.12.3-Component" + } + ] + }, + "module": { + "data": { + "id": "ember-4.12.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Error-2386d3ba55.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Error-9b4e80b255.json similarity index 90% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Error-2386d3ba55.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Error-9b4e80b255.json index 91b03e451..c07c1b298 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Error-2386d3ba55.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Error-9b4e80b255.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.Error", + "id": "ember-4.12.3-Ember.Error", "type": "class", "attributes": { "name": "Ember.Error", @@ -36,13 +36,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/error", + "id": "ember-4.12.3-@ember/error", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.EventDispatcher-c06bf46659.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.EventDispatcher-c06bf46659.json new file mode 100644 index 000000000..65081ef2b --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.EventDispatcher-c06bf46659.json @@ -0,0 +1,659 @@ +{ + "data": { + "id": "ember-4.12.3-Ember.EventDispatcher", + "type": "class", + "attributes": { + "name": "Ember.EventDispatcher", + "shortname": "Ember.EventDispatcher", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 19, + "description": "

Ember.EventDispatcher handles delegating browser events to their\ncorresponding Ember.Views. For example, when you click on a view,\nEmber.EventDispatcher ensures that that view's mouseDown method gets\ncalled.

\n", + "access": "private", + "tagname": "", + "extends": "EmberObject", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 114, + "description": "

Sets up event listeners for standard browser events.

\n

This will be called after the browser sends a DOMContentReady event. By\ndefault, it will set up all of the listeners on the document body. If you\nwould like to register the listeners on a different element, set the event\ndispatcher's root property.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "params": [ + { + "name": "addedEvents", + "description": "", + "type": "Object" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 208, + "description": "

Setup event listeners for the given browser event name

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForBrowserEvent", + "params": [ + { + "name": "event", + "description": "the name of the event in the browser" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 221, + "description": "

Setup event listeners for the given Ember event name (camel case)

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForEmberEvent", + "params": [ + { + "name": "eventName", + "description": "" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 238, + "description": "

Registers an event listener on the rootElement. If the given event is\ntriggered, the provided event handler will be triggered on the target view.

\n

If the target view does not implement the event handler, or if the handler\nreturns false, the parent view will be called. The event will continue to\nbubble to each successive parent view until it reaches the top.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandler", + "params": [ + { + "name": "rootElement", + "description": "", + "type": "Element" + }, + { + "name": "event", + "description": "the name of the event in the browser", + "type": "String" + }, + { + "name": "eventName", + "description": "the name of the method to call on the view", + "type": "String" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/system/action_manager.ts", + "line": 9, + "description": "

Global action id hash.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registeredActions", + "type": "Object", + "class": "Ember.EventDispatcher", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 31, + "description": "

The set of events names (and associated handler function names) to be setup\nand dispatched by the EventDispatcher. Modifications to this list can be done\nat setup time, generally via the Application.customEvents hash.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "events", + "type": "Object", + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 91, + "description": "

The root DOM element to which event listeners should be attached. Event\nlisteners will be attached to the document unless this is overridden.

\n

Can be specified as a DOMElement or a selector string.

\n

The default body is a string since this may be evaluated before document.body\nexists in the DOM.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.InjectedProperty-a7d658de98.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.InjectedProperty-1d5e957153.json similarity index 92% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.InjectedProperty-a7d658de98.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.InjectedProperty-1d5e957153.json index f0fa4cb2e..c57ab42a0 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.InjectedProperty-a7d658de98.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.InjectedProperty-1d5e957153.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.InjectedProperty", + "id": "ember-4.12.3-Ember.InjectedProperty", "type": "class", "attributes": { "name": "Ember.InjectedProperty", @@ -43,13 +43,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.MutableEnumerable-c496da316d.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.MutableEnumerable-76efe79b36.json similarity index 90% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.MutableEnumerable-c496da316d.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.MutableEnumerable-76efe79b36.json index 12eeb46df..39a2d9f24 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.MutableEnumerable-c496da316d.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.MutableEnumerable-76efe79b36.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.MutableEnumerable", + "id": "ember-4.12.3-Ember.MutableEnumerable", "type": "class", "attributes": { "name": "Ember.MutableEnumerable", @@ -33,13 +33,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.NativeArray-ad6f5979c2.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.NativeArray-ad6f5979c2.json new file mode 100644 index 000000000..989739e1c --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.NativeArray-ad6f5979c2.json @@ -0,0 +1,1636 @@ +{ + "data": { + "id": "ember-4.12.3-Ember.NativeArray", + "type": "class", + "attributes": { + "name": "Ember.NativeArray", + "shortname": "Ember.NativeArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/array/index.ts", + "line": 2062, + "description": "

The NativeArray mixin contains the properties needed to make the native\nArray support MutableArray and all of its dependent APIs. Unless you\nhave EmberENV.EXTEND_PROTOTYPES or EmberENV.EXTEND_PROTOTYPES.Array set to\nfalse, this will be applied automatically. Otherwise you can apply the mixin\nat anytime by calling Ember.NativeArray.apply(Array.prototype).

\n", + "uses": [ + "Observable", + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1484, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1503, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1520, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1538, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1560, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1577, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1593, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1609, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1625, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1642, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1659, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1668, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1686, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1703, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1712, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1729, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ProxyMixin-f3c9f8406c.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ProxyMixin-48486132e0.json similarity index 94% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ProxyMixin-f3c9f8406c.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ProxyMixin-48486132e0.json index 6ce1a397b..df8343622 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.ProxyMixin-f3c9f8406c.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ProxyMixin-48486132e0.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.ProxyMixin", + "id": "ember-4.12.3-Ember.ProxyMixin", "type": "class", "attributes": { "name": "Ember.ProxyMixin", @@ -61,13 +61,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.String-819b180df8.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.String-d46664855b.json similarity index 97% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.String-819b180df8.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.String-d46664855b.json index 1dff29d4b..f286153eb 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.String-819b180df8.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.String-d46664855b.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.String", + "id": "ember-4.12.3-Ember.String", "type": "class", "attributes": { "name": "Ember.String", @@ -77,13 +77,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.TargetActionSupport-20f79aa3b5.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.TargetActionSupport-127139bc9d.json similarity index 97% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.TargetActionSupport-20f79aa3b5.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.TargetActionSupport-127139bc9d.json index 56949bb10..996baa9c0 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.TargetActionSupport-20f79aa3b5.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.TargetActionSupport-127139bc9d.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.TargetActionSupport", + "id": "ember-4.12.3-Ember.TargetActionSupport", "type": "class", "attributes": { "name": "Ember.TargetActionSupport", @@ -77,7 +77,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-Mixin", + "id": "ember-4.12.3-Mixin", "type": "class" } }, @@ -86,13 +86,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Templates.components-687d6d8e13.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Templates.components-687d6d8e13.json new file mode 100644 index 000000000..aa57a2743 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Templates.components-687d6d8e13.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-4.12.3-Ember.Templates.components", + "type": "class", + "attributes": { + "name": "Ember.Templates.components", + "shortname": "Ember.Templates.components", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 66, + "description": "

The Input component lets you create an HTML <input> element.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value="987" />
\n
\n
\n \n

creates an <input> element with type="text" and value set to 987.

\n

Text field

\n

If no type argument is specified, a default of type 'text' is used.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Search:\n<Input @value={{this.searchWord}} />
\n
\n
\n \n

In this example, the initial value in the <input> will be set to the value of\nthis.searchWord. If the user changes the text, the value of this.searchWord will also be\nupdated.

\n

Actions

\n

The Input component takes a number of arguments with callbacks that are invoked in response to\nuser events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-down
  • \n
  • key-press
  • \n
  • key-up
  • \n
\n

These callbacks are passed to Input like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Starting with Ember Octane, we recommend using the {{on}} modifier to call actions\non specific events, such as the input event.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
<label for="input-name">Name:</label>\n<Input\n  @id="input-name"\n  @value={{this.name}}\n  {{on "input" this.validateName}}\n/>
\n
\n
\n \n

The event name (e.g. focusout, input, keydown) always follows the casing\nthat the HTML standard uses.

\n

<input> HTML Attributes to Avoid

\n

In most cases, if you want to pass an attribute to the underlying HTML <input> element, you\ncan pass the attribute directly, just like any other Ember component.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @type="text" size="10" />
\n
\n
\n \n

In this example, the size attribute will be applied to the underlying <input> element in the\noutputted HTML.

\n

However, there are a few attributes where you must use the @ version.

\n
    \n
  • @type: This argument is used to control which Ember component is used under the hood
  • \n
  • @value: The @value argument installs a two-way binding onto the element. If you wanted a\none-way binding, use <input> with the value property and the input event instead.
  • \n
  • @checked (for checkboxes): like @value, the @checked argument installs a two-way binding\nonto the element. If you wanted a one-way binding, use <input type="checkbox"> with\nchecked and the input event instead.
  • \n
\n

Checkbox

\n

To create an <input type="checkbox">:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Emberize Everything:\n<Input @type="checkbox" @checked={{this.isEmberized}} name="isEmberized" />
\n
\n
\n \n

This will bind the checked state of this checkbox to the value of isEmberized -- if either one\nchanges, it will be reflected in the other.

\n", + "itemtype": "method", + "name": "Input", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 42, + "description": "

The LinkTo component renders a link to the supplied routeName passing an optionally\nsupplied model to the route as its model context of the route. The block for LinkTo\nbecomes the contents of the rendered element:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

Disabling the LinkTo component

\n

The LinkTo component can be disabled by using the disabled argument. A disabled link\ndoesn't result in a transition when activated, and adds the disabled class to the <a>\nelement.

\n

(The class name to apply to the element can be overridden by using the disabledClass\nargument)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @disabled={{true}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

Handling href

\n

<LinkTo> will use your application's Router to fill the element's href property with a URL\nthat matches the path to the supplied routeName.

\n

Handling current route

\n

The LinkTo component will apply a CSS class name of 'active' when the application's current\nroute matches the supplied routeName. For example, if the application's current route is\n'photoGallery.recent', then the following invocation of LinkTo:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

will result in

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="active">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

The CSS class used for active classes can be customized by passing an activeClass argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent' @activeClass="current-url">\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="current-url">\n  Great Hamster Photos\n</a>
\n
\n
\n \n\n

If you need a link to be 'active' even when it doesn't match the current route, you can use the\ncurrent-when argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @current-when='photos'>\n  Photo Gallery\n</LinkTo>
\n
\n
\n \n

This may be helpful for keeping links active for:

\n
    \n
  • non-nested routes that are logically related
  • \n
  • some secondary menu approaches
  • \n
  • 'top navigation' with 'sub navigation' scenarios
  • \n
\n

A link will be active if current-when is true or the current\nroute is the route this link would transition to.

\n

To match multiple routes 'space-separate' the routes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='gallery' @current-when='photos drawings paintings'>\n  Art Gallery\n</LinkTo>
\n
\n
\n \n

Supplying a model

\n

An optional model argument can be used for routes whose\npaths contain dynamic segments. This argument will become\nthe model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", {path: "hamster-photos/:photo_id"});\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{this.aPhoto}}>\n  {{aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

Supplying multiple models

\n

For deep-linking to route paths that contain multiple\ndynamic segments, the models argument can be used.

\n

As the router transitions through the route path, each\nsupplied model argument will become the context for the\nroute with the dynamic segments:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() {\n    this.route("comment", {path: "comments/:comment_id"});\n  });\n});
\n
\n
\n \n

This argument will become the model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.comment' @models={{array this.aPhoto this.comment}}>\n  {{comment.body}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42/comments/718">\n  A+++ would snuggle again.\n</a>
\n
\n
\n \n

Supplying an explicit dynamic segment value

\n

If you don't have a model object available to pass to LinkTo,\nan optional string or integer argument can be passed for routes whose\npaths contain dynamic segments. This argument will become the value\nof the dynamic segment:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{aPhotoId}}>\n  {{this.aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

When transitioning into the linked route, the model hook will\nbe triggered with parameters including this passed identifier.

\n

Supplying query parameters

\n

If you need to add optional key-value pairs that appear to the right of the ? in a URL,\nyou can use the query argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @query={{hash page=1 per_page=20}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos?page=1&per_page=20">\n  Great Hamster Photos\n</a>
\n
\n
\n \n", + "itemtype": "method", + "name": "LinkTo", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 9, + "description": "

The Textarea component inserts a new instance of <textarea> tag into the template.

\n

The @value argument provides the content of the <textarea>.

\n

This template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value="A bunch of text" />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  A bunch of text\n</textarea>
\n
\n
\n \n

The @value argument is two-way bound. If the user types text into the textarea, the @value\nargument is updated. If the @value argument is updated, the text in the textarea is updated.

\n

In the following example, the writtenWords property on the component will be updated as the user\ntypes 'Lots of text' into the text area of their browser's window.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class WordEditorComponent extends Component {\n  @tracked writtenWords = "Lots of text that IS bound";\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{writtenWords}} />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  Lots of text that IS bound\n</textarea>
\n
\n
\n \n

If you wanted a one way binding, you could use the <textarea> element directly, and use the\nvalue DOM property and the input event.

\n

Actions

\n

The Textarea component takes a number of arguments with callbacks that are invoked in\nresponse to user events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-press
  • \n
\n

These callbacks are passed to Textarea like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Classic Invocation Syntax

\n

The Textarea component can also be invoked using curly braces, just like any other Ember\ncomponent.

\n

For example, this is an invocation using angle-bracket notation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

You could accomplish the same thing using classic invocation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{textarea value=this.searchWord enter=this.query}}
\n
\n
\n \n

The main difference is that angle-bracket invocation supports any HTML attribute using HTML\nattribute syntax, because attributes and arguments have different syntax when using angle-bracket\ninvocation. Curly brace invocation, on the other hand, only has a single syntax for arguments,\nand components must manually map attributes onto component arguments.

\n

When using classic invocation with {{textarea}}, only the following attributes are mapped onto\narguments:

\n
    \n
  • rows
  • \n
  • cols
  • \n
  • name
  • \n
  • selectionEnd
  • \n
  • selectionStart
  • \n
  • autocomplete
  • \n
  • wrap
  • \n
  • lang
  • \n
  • dir
  • \n
  • value
  • \n
\n

Classic layout and layoutName properties

\n

Because HTML textarea elements do not contain inner HTML the layout and\nlayoutName properties will not be applied.

\n", + "itemtype": "method", + "name": "Textarea", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Templates.helpers-bd36695ee7.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Templates.helpers-7c08d25ebe.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Templates.helpers-bd36695ee7.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Templates.helpers-7c08d25ebe.json index f5228b46c..fc3accfca 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Templates.helpers-bd36695ee7.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Templates.helpers-7c08d25ebe.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.Templates.helpers", + "id": "ember-4.12.3-Ember.Templates.helpers", "type": "class", "attributes": { "name": "Ember.Templates.helpers", @@ -411,13 +411,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Test-8f3fbcf922.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Test-8f3fbcf922.json new file mode 100644 index 000000000..edc11dad3 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Test-8f3fbcf922.json @@ -0,0 +1,147 @@ +{ + "data": { + "id": "ember-4.12.3-Ember.Test", + "type": "class", + "attributes": { + "name": "Ember.Test", + "shortname": "Ember.Test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/ember-testing/lib/test.ts", + "line": 11, + "description": "

This is a container for an assortment of testing related functionality:

\n
    \n
  • Choose your default test adapter (for your framework of choice).
  • \n
  • Register/Unregister additional test helpers.
  • \n
  • Setup callbacks to be fired when the test helpers are injected into\nyour application.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/ember-testing/lib/test/on_inject_helpers.ts", + "line": 5, + "description": "

Used to register callbacks to be fired whenever App.injectTestHelpers\nis called.

\n

The callback will receive the current application as an argument.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import $ from 'jquery';\n\nEmber.Test.onInjectHelpers(function() {\n  $(document).ajaxSend(function() {\n    Test.pendingRequests++;\n  });\n\n  $(document).ajaxComplete(function() {\n    Test.pendingRequests--;\n  });\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "onInjectHelpers", + "params": [ + { + "name": "callback", + "description": "The function to be called.", + "type": "Function" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.ts", + "line": 32, + "description": "

This returns a thenable tailored for testing. It catches failed\nonSuccess callbacks and invokes the Ember.Test.adapter.exception\ncallback in the last chained then.

\n

This method should be returned by async helpers such as wait.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "promise", + "params": [ + { + "name": "resolver", + "description": "The function used to resolve the promise.", + "type": "Function" + }, + { + "name": "label", + "description": "An optional string for identifying the promise.", + "type": "String" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.ts", + "line": 50, + "description": "

Replacement for Ember.RSVP.resolve\nThe only difference is this uses\nan instance of Ember.Test.Promise

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "The", + "description": "value to resolve", + "type": "Mixed" + } + ], + "since": "1.2.0", + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/setup_for_testing.ts", + "line": 8, + "description": "

Sets Ember up for testing. This is useful to perform\nbasic setup steps in order to unit test.

\n

Use App.setupForTesting to perform integration tests (full\napplication testing).

\n", + "itemtype": "method", + "name": "setupForTesting", + "since": "1.5.0", + "access": "private", + "tagname": "", + "class": "Ember.Test", + "module": "@ember/test", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/test.ts", + "line": 24, + "description": "

Hash containing all known test helpers.

\n", + "itemtype": "property", + "name": "_helpers", + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/ember-testing/lib/test.ts", + "line": 45, + "description": "

Used to allow ember-testing to communicate with a specific testing\nframework.

\n

You can manually set it before calling App.setupForTesting().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Ember.Test.adapter = MyCustomAdapter.create()
\n
\n
\n \n

If you do not set it, ember-testing will default to Ember.Test.QUnitAdapter.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "adapter", + "type": "{Class} The adapter to be used.", + "default": "Ember.Test.QUnitAdapter", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Test.QUnitAdapter-8ad90f80b9.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Test.QUnitAdapter-d984751a16.json similarity index 95% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Test.QUnitAdapter-8ad90f80b9.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Test.QUnitAdapter-d984751a16.json index 65a99597d..513989cec 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Ember.Test.QUnitAdapter-8ad90f80b9.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.Test.QUnitAdapter-d984751a16.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Ember.Test.QUnitAdapter", + "id": "ember-4.12.3-Ember.Test.QUnitAdapter", "type": "class", "attributes": { "name": "Ember.Test.QUnitAdapter", @@ -72,7 +72,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-TestAdapter", + "id": "ember-4.12.3-TestAdapter", "type": "class" } }, @@ -81,13 +81,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ViewMixin-a283d3abfb.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ViewMixin-a283d3abfb.json new file mode 100644 index 000000000..6f8fa909a --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Ember.ViewMixin-a283d3abfb.json @@ -0,0 +1,322 @@ +{ + "data": { + "id": "ember-4.12.3-Ember.ViewMixin", + "type": "class", + "attributes": { + "name": "Ember.ViewMixin", + "shortname": "Ember.ViewMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 15, + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 93, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 121, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 141, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 181, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 246, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 331, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 405, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 439, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 300, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 308, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 321, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 345, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 358, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 366, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 35, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 166, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 267, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 378, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-EmberArray-16725cadd3.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-EmberArray-16725cadd3.json new file mode 100644 index 000000000..e84c7126e --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-EmberArray-16725cadd3.json @@ -0,0 +1,836 @@ +{ + "data": { + "id": "ember-4.12.3-EmberArray", + "type": "class", + "attributes": { + "name": "EmberArray", + "shortname": "EmberArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "MutableArray" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/array/index.ts", + "line": 219, + "description": "

This mixin implements Observer-friendly Array-like behavior. It is not a\nconcrete implementation, but it can be used up by other classes that want\nto appear like arrays.

\n

For example, ArrayProxy is a concrete class that can be instantiated to\nimplement array-like behavior. This class uses the Array Mixin by way of\nthe MutableArray mixin, which allows observable changes to be made to the\nunderlying array.

\n

This mixin defines methods specifically for collections that provide\nindex-ordered access to their contents. When you are designing code that\nneeds to accept any kind of Array-like object, you should use these methods\ninstead of Array primitives because these will properly notify observers of\nchanges to the array.

\n

Although these methods are efficient, they do add a layer of indirection to\nyour application so it is a good idea to use them only when you need the\nflexibility of using both true JavaScript arrays and "virtual" arrays such\nas controllers and collections.

\n

You can use the methods defined in this module to access and modify array\ncontents in an observable-friendly way. You can also be notified whenever\nthe membership of an array changes by using .observes('myArray.[]').

\n

To support EmberArray in your own class, you must override two\nprimitives to use it: length() and objectAt().

\n", + "uses": [ + "Enumerable" + ], + "since": "Ember 0.9.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-EmberENV-e94d2c95ab.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-EmberENV-5f5dc8ea0d.json similarity index 98% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-EmberENV-e94d2c95ab.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-EmberENV-5f5dc8ea0d.json index c57d9dcc9..a249e4fb7 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-EmberENV-e94d2c95ab.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-EmberENV-5f5dc8ea0d.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-EmberENV", + "id": "ember-4.12.3-EmberENV", "type": "class", "attributes": { "name": "EmberENV", @@ -136,13 +136,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-rsvp", + "id": "ember-4.12.3-rsvp", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-EmberObject-4e3e58a56d.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-EmberObject-4e3e58a56d.json new file mode 100644 index 000000000..ec4372dca --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-EmberObject-4e3e58a56d.json @@ -0,0 +1,600 @@ +{ + "data": { + "id": "ember-4.12.3-EmberObject", + "type": "class", + "attributes": { + "name": "EmberObject", + "shortname": "EmberObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/object/index.ts", + "line": 30, + "description": "

EmberObject is the main base class for all Ember objects. It is a subclass\nof CoreObject with the Observable mixin applied. For details,\nsee the documentation for each of these.

\n", + "extends": "CoreObject", + "uses": [ + "Observable" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.12.3-Ember.EventDispatcher" + }, + { + "type": "class", + "id": "ember-4.12.3-Ember.CoreView" + }, + { + "type": "class", + "id": "ember-4.12.3-Namespace" + }, + { + "type": "class", + "id": "ember-4.12.3-ArrayProxy" + }, + { + "type": "class", + "id": "ember-4.12.3-Ember.Controller" + }, + { + "type": "class", + "id": "ember-4.12.3-ContainerDebugAdapter" + }, + { + "type": "class", + "id": "ember-4.12.3-DataAdapter" + }, + { + "type": "class", + "id": "ember-4.12.3-EngineInstance" + }, + { + "type": "class", + "id": "ember-4.12.3-ObjectProxy" + }, + { + "type": "class", + "id": "ember-4.12.3-HashLocation" + }, + { + "type": "class", + "id": "ember-4.12.3-HistoryLocation" + }, + { + "type": "class", + "id": "ember-4.12.3-NoneLocation" + }, + { + "type": "class", + "id": "ember-4.12.3-Route" + }, + { + "type": "class", + "id": "ember-4.12.3-EmberRouter" + }, + { + "type": "class", + "id": "ember-4.12.3-Service" + } + ] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-EmberRouter-130fff02b5.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-EmberRouter-130fff02b5.json new file mode 100644 index 000000000..e40ced544 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-EmberRouter-130fff02b5.json @@ -0,0 +1,1192 @@ +{ + "data": { + "id": "ember-4.12.3-EmberRouter", + "type": "class", + "attributes": { + "name": "EmberRouter", + "shortname": "EmberRouter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/router", + "namespace": "", + "file": "packages/@ember/routing/router.ts", + "line": 145, + "description": "

The EmberRouter class manages the application state and URLs. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/router.ts", + "line": 224, + "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

The first parameter is the name of the route which is used by default as the\npath name as well.

\n

The 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\nsegments.
  • \n
  • resetNamespace: false by default; when nesting routes, ember will\ncombine the route names to form the fully-qualified route name, which is\nused with {{link-to}} or manually transitioning to routes. Setting\nresetNamespace: true will cause the route not to inherit from its\nparent route's names. This is handy for preventing extremely long route names.\nKeep in mind that the actual URL path behavior is still retained.
  • \n
\n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
Router.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
\n
\n \n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 559, + "description": "

Initializes the current router instance and sets up the change handling\nevent listeners used by the instances location implementation.

\n

A property named initialURL will be used to determine the initial URL.\nIf no value is found / will be used.

\n", + "itemtype": "method", + "name": "startRouting", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 705, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 750, + "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", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 777, + "description": "

Determines if the supplied route is currently active.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 789, + "description": "

An alternative form of isActive that doesn't require\nmanual concatenation of the arguments into a single\narray.

\n", + "itemtype": "method", + "name": "isActiveIntent", + "params": [ + { + "name": "routeName", + "description": "" + }, + { + "name": "models", + "description": "" + }, + { + "name": "queryParams", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 811, + "description": "

Does this router instance have the given route.

\n", + "itemtype": "method", + "name": "hasRoute", + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 822, + "description": "

Resets the state of the router by clearing the current route\nhandlers and deactivating them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 970, + "description": "

Serializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Arrray" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1000, + "description": "

Serializes the value of a query parameter based on a type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "type", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1018, + "description": "

Deserializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1046, + "description": "

Deserializes the value of a query parameter based on a default type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "defaultType", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1067, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_pruneDefaultQueryParamValues", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1148, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareQueryParams", + "params": [ + { + "name": "targetRouteName", + "description": "", + "type": "String" + }, + { + "name": "models", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + }, + { + "name": "keepDefaultQueryParamValues", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1175, + "description": "

Returns the meta information for the query params of a given route. This\nwill be overridden to allow support for lazy routes.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getQPMeta", + "params": [ + { + "name": "routeInfo", + "description": "", + "type": "RouteInfo" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1189, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_queryParamsFor", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1251, + "description": "

Maps all query param keys to their fully scoped property name of the form\ncontrollerName:propName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_fullyScopeQueryParams", + "params": [ + { + "name": "leafRouteName", + "description": "", + "type": "String" + }, + { + "name": "contexts", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1289, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_hydrateUnsuppliedQueryParams", + "params": [ + { + "name": "state", + "description": "", + "type": "TransitionState" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1460, + "description": "

Handles updating the paths and notifying any listeners of the URL\nchange.

\n

Triggers the router level didTransition hook.

\n

For example, to notify google analytics when the route changes,\nyou could use this hook. (Note: requires also including GA scripts, etc.)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "didTransition", + "access": "private", + "tagname": "", + "since": "1.2.0", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1497, + "description": "

Handles notifying any listeners of an impending URL\nchange.

\n

Triggers the router level willTransition hook.

\n", + "itemtype": "method", + "name": "willTransition", + "access": "private", + "tagname": "", + "since": "1.11.0", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/router.ts", + "line": 155, + "description": "

Represents the URL of the root of the application, often '/'. This prefix is\n assumed on all routes defined on this router.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 166, + "description": "

The location property determines the type of URL's that your\n application will use.

\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 history by the locationType setting of /config/environment.js

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1510, + "description": "

Represents the current URL.

\n", + "itemtype": "property", + "name": "url", + "type": "{String}", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/routing/router", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Engine-cf71feddc8.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Engine-cf71feddc8.json new file mode 100644 index 000000000..8298a9a8b --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Engine-cf71feddc8.json @@ -0,0 +1,304 @@ +{ + "data": { + "id": "ember-4.12.3-Engine", + "type": "class", + "attributes": { + "name": "Engine", + "shortname": "Engine", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/index.ts", + "line": 40, + "description": "

The Engine class contains core functionality for both applications and\nengines.

\n

Each engine manages a registry that's used for dependency injection and\nexposed through RegistryProxy.

\n

Engines also manage initializers and instance initializers.

\n

Engines can spawn EngineInstance instances via buildInstance().

\n", + "extends": "Ember.Namespace", + "uses": [ + "RegistryProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/engine/index.ts", + "line": 62, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 209, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 285, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 346, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 359, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 371, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 384, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 392, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 400, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 414, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 448, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Enginer" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 41, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/index.ts", + "line": 325, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 338, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Engine", + "module": "@ember/engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.Namespace", + "type": "missing" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.12.3-Application" + } + ] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-EngineInstance-9f0950c34b.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-EngineInstance-c21786e656.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-EngineInstance-9f0950c34b.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-EngineInstance-c21786e656.json index 00fb2ace7..ab0558400 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-EngineInstance-9f0950c34b.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-EngineInstance-c21786e656.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-EngineInstance", + "id": "ember-4.12.3-EngineInstance", "type": "class", "attributes": { "name": "EngineInstance", @@ -756,7 +756,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.12.3-EmberObject", "type": "class" } }, @@ -764,19 +764,19 @@ "data": [ { "type": "class", - "id": "ember-4.12.1-ApplicationInstance" + "id": "ember-4.12.3-ApplicationInstance" } ] }, "module": { "data": { - "id": "ember-4.12.1-@ember/engine", + "id": "ember-4.12.3-@ember/engine", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Enumerable-1c3b7ce2a3.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Enumerable-812f883494.json similarity index 90% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Enumerable-1c3b7ce2a3.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Enumerable-812f883494.json index 7546434c0..c23aae58d 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Enumerable-1c3b7ce2a3.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Enumerable-812f883494.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Enumerable", + "id": "ember-4.12.3-Enumerable", "type": "class", "attributes": { "name": "Enumerable", @@ -33,13 +33,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/enumerable", + "id": "ember-4.12.3-@ember/enumerable", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-EventTarget-8bc312f28e.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-EventTarget-fa52075556.json similarity index 95% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-EventTarget-8bc312f28e.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-EventTarget-fa52075556.json index 1a8e52ccd..3129de8b9 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-EventTarget-8bc312f28e.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-EventTarget-fa52075556.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-EventTarget", + "id": "ember-4.12.3-EventTarget", "type": "class", "attributes": { "name": "EventTarget", @@ -53,13 +53,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-rsvp", + "id": "ember-4.12.3-rsvp", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Evented-0baf9ee6ca.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Evented-0baf9ee6ca.json new file mode 100644 index 000000000..e53e8e73c --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Evented-0baf9ee6ca.json @@ -0,0 +1,190 @@ +{ + "data": { + "id": "ember-4.12.3-Evented", + "type": "class", + "attributes": { + "name": "Evented", + "shortname": "Evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.CoreView", + "Route", + "EmberRouter" + ], + "module": "@ember/object/evented", + "namespace": "", + "file": "packages/@ember/object/evented.ts", + "line": 10, + "description": "

This mixin allows for Ember objects to subscribe to and emit events.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/utils/person.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport Evented from '@ember/object/evented';\n\nexport default EmberObject.extend(Evented, {\n  greet() {\n    // ...\n    this.trigger('greet');\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
var person = Person.create();\n\nperson.on('greet', function() {\n  console.log('Our person has greeted');\n});\n\nperson.greet();\n\n// outputs: 'Our person has greeted'
\n
\n
\n \n

You can also chain multiple event subscriptions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
person.on('greet', function() {\n  console.log('Our person has greeted');\n}).one('greet', function() {\n  console.log('Offer one-time special');\n}).off('event', this, forgetThis);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/object/evented", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Factory-725219bfb6.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Factory-a48a43ea55.json similarity index 92% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Factory-725219bfb6.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Factory-a48a43ea55.json index e988d2ba3..07e86391f 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Factory-725219bfb6.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Factory-a48a43ea55.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Factory", + "id": "ember-4.12.3-Factory", "type": "class", "attributes": { "name": "Factory", @@ -53,19 +53,19 @@ "data": [ { "type": "class", - "id": "ember-4.12.1-FactoryManager" + "id": "ember-4.12.3-FactoryManager" } ] }, "module": { "data": { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.12.3-@ember/owner", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-FactoryManager-f4e3846f8a.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-FactoryManager-1d8e4e89d5.json similarity index 94% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-FactoryManager-f4e3846f8a.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-FactoryManager-1d8e4e89d5.json index 86080ca08..2a0e44657 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-FactoryManager-f4e3846f8a.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-FactoryManager-1d8e4e89d5.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-FactoryManager", + "id": "ember-4.12.3-FactoryManager", "type": "class", "attributes": { "name": "FactoryManager", @@ -63,7 +63,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-Factory", + "id": "ember-4.12.3-Factory", "type": "class" } }, @@ -72,13 +72,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.12.3-@ember/owner", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-FullName-c8c6cea4ac.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-FullName-fc1f9753a8.json similarity index 91% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-FullName-c8c6cea4ac.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-FullName-fc1f9753a8.json index 75b33b283..686f015ef 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-FullName-c8c6cea4ac.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-FullName-fc1f9753a8.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-FullName", + "id": "ember-4.12.3-FullName", "type": "class", "attributes": { "name": "FullName", @@ -30,13 +30,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.12.3-@ember/owner", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-HashLocation-c0a25a4587.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-HashLocation-c0a25a4587.json new file mode 100644 index 000000000..3ea623fd9 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-HashLocation-c0a25a4587.json @@ -0,0 +1,641 @@ +{ + "data": { + "id": "ember-4.12.3-HashLocation", + "type": "class", + "attributes": { + "name": "HashLocation", + "shortname": "HashLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/hash-location", + "namespace": "", + "file": "packages/@ember/routing/hash-location.ts", + "line": 10, + "description": "

HashLocation implements the location API using the browser's\nhash. At present, it relies on a hashchange event existing in the\nbrowser.

\n

Using HashLocation results in URLs with a # (hash sign) separating the\nserver side URL portion of the URL from the portion that is used by Ember.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'hash'\n});
\n
\n
\n \n

This will result in a posts.new url of /#/posts/new.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 50, + "access": "private", + "tagname": "Returns normalized location.hash", + "since": "1.5.1", + "itemtype": "method", + "name": "getHash", + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 62, + "description": "

Returns the normalized URL, constructed from location.hash.

\n

e.g. #/foo => /foo as well as #/foo#bar => /foo#bar.

\n

By convention, hashed paths must begin with a forward slash, otherwise they\nare not treated as a path so we can distinguish intent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 92, + "description": "

Set the location.hash and remembers what was set. This prevents\nonUpdateURL callbacks from triggering when the hash was set by\nHashLocation.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 106, + "description": "

Uses location.replace to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 121, + "description": "

Register a callback to be invoked when the hash changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 146, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 161, + "description": "

Cleans up the HashLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/routing/hash-location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Helper-1bd43a0c71.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Helper-1bd43a0c71.json new file mode 100644 index 000000000..e4a83a0b5 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Helper-1bd43a0c71.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.12.3-Helper", + "type": "class", + "attributes": { + "name": "Helper", + "shortname": "Helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 73, + "description": "

Ember Helpers are functions that can compute values, and are used in templates.\nFor example, this code calls a helper named format-currency:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Cost @cents={{230}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/cost.hbs
1\n
<div>{{format-currency @cents currency="$"}}</div>
\n
\n
\n \n

Additionally a helper can be called as a nested helper.\nIn this example, we show the formatted currency value if the showMoney\nnamed argument is truthy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{if @showMoney (format-currency @cents currency="$")}}
\n
\n
\n \n

Helpers defined using a class must provide a compute function. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n6\n7\n
import Helper from '@ember/component/helper';\n\nexport default class extends Helper {\n  compute([cents], { currency }) {\n    return `${currency}${cents * 0.01}`;\n  }\n}
\n
\n
\n \n

Each time the input to a helper changes, the compute function will be\ncalled again.

\n

As instances, these helpers also have access to the container and will accept\ninjected dependencies.

\n

Additionally, class helpers can call recompute to force a new computation.

\n", + "extends": "CoreObject", + "access": "public", + "tagname": "", + "since": "1.13.0", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 119, + "description": "

Override this function when writing a class-based helper.

\n", + "itemtype": "method", + "name": "compute", + "params": [ + { + "name": "params", + "description": "The positional arguments to the helper", + "type": "Array" + }, + { + "name": "hash", + "description": "The named arguments to the helper", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 152, + "description": "

On a class-based helper, it may be useful to force a recomputation of that\nhelpers value. This is akin to rerender on a component.

\n

For example, this component will rerender when the currentUser on a\nsession service changes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
email.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Helper from '@ember/component/helper'\nimport { service } from '@ember/service'\nimport { observer } from '@ember/object'\n\nexport default Helper.extend({\n  session: service(),\n\n  onNewUser: observer('session.currentUser', function() {\n    this.recompute();\n  }),\n\n  compute() {\n    return this.get('session.currentUser.email');\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "recompute", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-HistoryLocation-a619e9b94b.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-HistoryLocation-a619e9b94b.json new file mode 100644 index 000000000..4ceed99ef --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-HistoryLocation-a619e9b94b.json @@ -0,0 +1,707 @@ +{ + "data": { + "id": "ember-4.12.3-HistoryLocation", + "type": "class", + "attributes": { + "name": "HistoryLocation", + "shortname": "HistoryLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/history-location", + "namespace": "", + "file": "packages/@ember/routing/history-location.ts", + "line": 20, + "description": "

HistoryLocation implements the location API using the browser's\nhistory.pushState API.

\n

Using HistoryLocation results in URLs that are indistinguishable from a\nstandard URL. This relies upon the browser's history API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'history'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new.

\n

Keep in mind that your server must serve the Ember app at all the routes you\ndefine.

\n

Using HistoryLocation will also result in location states being recorded by\nthe browser history API with the following schema:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
window.history.state -> { path: '/', uuid: '3552e730-b4a6-46bd-b8bf-d8c3c1a97e0a' }
\n
\n
\n \n

This allows each in-app location state to be tracked uniquely across history\nstate changes via the uuid field.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/history-location.ts", + "line": 78, + "access": "private", + "tagname": "Returns normalized location.hash", + "itemtype": "method", + "name": "getHash", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 104, + "description": "

Used to set state on first call to setURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initState", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 125, + "description": "

Returns the current location.pathname without rootURL or baseURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 152, + "description": "

Uses history.pushState to update the url without a page reload.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 168, + "description": "

Uses history.replaceState to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 185, + "description": "

Pushes a new state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "pushState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 201, + "description": "

Replaces the current state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 217, + "description": "

Register a callback to be invoked whenever the browser\nhistory changes, including using forward and back buttons.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 242, + "description": "

Used when using {{action}} helper. The url is always appended to the rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "formatted url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 266, + "description": "

Cleans up the HistoryLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/history-location.ts", + "line": 70, + "description": "

Will be pre-pended to path upon state change

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/routing/history-location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-InternalFactory-7f1b3783fb.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-InternalFactory-ac20dd88d3.json similarity index 96% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-InternalFactory-7f1b3783fb.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-InternalFactory-ac20dd88d3.json index 0634e1852..1a90673c8 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-InternalFactory-7f1b3783fb.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-InternalFactory-ac20dd88d3.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-InternalFactory", + "id": "ember-4.12.3-InternalFactory", "type": "class", "attributes": { "name": "InternalFactory", @@ -101,13 +101,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.12.3-@ember/owner", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Libraries-51b68c8407.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Libraries-72485f5ef6.json similarity index 90% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Libraries-51b68c8407.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Libraries-72485f5ef6.json index 48349cff6..be0fd6292 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Libraries-51b68c8407.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Libraries-72485f5ef6.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Libraries", + "id": "ember-4.12.3-Libraries", "type": "class", "attributes": { "name": "Libraries", @@ -31,13 +31,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Location-fc9393f301.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Location-fc9393f301.json new file mode 100644 index 000000000..b5281a9ea --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Location-fc9393f301.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.12.3-Location", + "type": "class", + "attributes": { + "name": "Location", + "shortname": "Location", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/location", + "namespace": "", + "file": "packages/@ember/routing/location.ts", + "line": 21, + "description": "

Location returns an instance of the correct implementation of\nthe location API.

\n

Implementations

\n

You can pass an implementation name (hash, history, none, auto) to force a\nparticular implementation to be used in your application.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n

Location API

\n

Each location implementation must provide the following methods:

\n
    \n
  • implementation: returns the string name used to reference the implementation.
  • \n
  • getURL: returns the current URL.
  • \n
  • setURL(path): sets the current URL.
  • \n
  • replaceURL(path): replace the current URL (optional).
  • \n
  • onUpdateURL(callback): triggers the callback when the URL changes.
  • \n
  • formatURL(url): formats url to be placed into href attribute.
  • \n
  • detect() (optional): instructs the location to do any feature detection\n necessary. If the location needs to redirect to a different URL, it\n can cancel routing by setting the cancelRouterSetup property on itself\n to false.
  • \n
\n

Calling setURL or replaceURL will not trigger onUpdateURL callbacks.

\n

Custom implementation

\n

Ember scans app/locations/* for extending the Location API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import HistoryLocation from '@ember/routing/history-location';\n\nexport default class MyHistory {\n  implementation = 'my-custom-history';\n\n  constructor() {\n    this._history = HistoryLocation.create(...arguments);\n  }\n\n  create() {\n    return new this(...arguments);\n  }\n\n  pushState(path) {\n     this._history.pushState(path);\n  }\n}
\n
\n
\n \n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/location.ts", + "line": 82, + "description": "

This is deprecated in favor of using the container to lookup the location\nimplementation as desired.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
// Given a location registered as follows:\ncontainer.register('location:history-test', HistoryTestLocation);\n\n// You could create a new instance via:\ncontainer.lookup('location:history-test');
\n
\n
\n \n", + "itemtype": "method", + "name": "create", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "an instance of an implementation of the `location` API", + "type": "Object" + }, + "deprecated": true, + "deprecationMessage": "Use the container to lookup the location implementation that you\n need.", + "access": "private", + "tagname": "", + "class": "Location", + "module": "@ember/routing/location" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/routing/location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Mixin-56bf58a3a0.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Mixin-3d2c2aed70.json similarity index 98% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Mixin-56bf58a3a0.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Mixin-3d2c2aed70.json index 86b8d008d..cc0e4ffba 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Mixin-56bf58a3a0.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Mixin-3d2c2aed70.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Mixin", + "id": "ember-4.12.3-Mixin", "type": "class", "attributes": { "name": "Mixin", @@ -54,19 +54,19 @@ "data": [ { "type": "class", - "id": "ember-4.12.1-Ember.TargetActionSupport" + "id": "ember-4.12.3-Ember.TargetActionSupport" } ] }, "module": { "data": { - "id": "ember-4.12.1-@ember/object/mixin", + "id": "ember-4.12.3-@ember/object/mixin", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-MutableArray-d65a595923.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-MutableArray-d65a595923.json new file mode 100644 index 000000000..c30d75ce8 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-MutableArray-d65a595923.json @@ -0,0 +1,1240 @@ +{ + "data": { + "id": "ember-4.12.3-MutableArray", + "type": "class", + "attributes": { + "name": "MutableArray", + "shortname": "MutableArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "ArrayProxy" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/array/index.ts", + "line": 1463, + "description": "

This mixin defines the API for modifying array-like objects. These methods\ncan be applied only to a collection that keeps its items in an ordered set.\nIt builds upon the Array mixin and adds methods to modify the array.\nOne concrete implementations of this class include ArrayProxy.

\n

It is important to use the methods in this class to modify arrays so that\nchanges are observable. This allows the binding system in Ember to function\ncorrectly.

\n

Note that an Array can change even if it does not implement this mixin.\nFor example, one might implement a SparseArray that cannot be directly\nmodified, but if its underlying enumerable changes, it will change also.

\n", + "uses": [ + "MutableEnumerable", + "EmberArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/array/index.ts", + "line": 1484, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1503, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1520, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1538, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1560, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1577, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1593, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1609, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1625, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1642, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1659, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1668, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1686, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1703, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1712, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1729, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Namespace-78c4c6fa96.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Namespace-78c4c6fa96.json new file mode 100644 index 000000000..4c54235b8 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Namespace-78c4c6fa96.json @@ -0,0 +1,536 @@ +{ + "data": { + "id": "ember-4.12.3-Namespace", + "type": "class", + "attributes": { + "name": "Namespace", + "shortname": "Namespace", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application/namespace", + "namespace": "", + "file": "packages/@ember/application/namespace.ts", + "line": 20, + "description": "

A Namespace is an object usually used to contain other objects or methods\nsuch as an application or framework. Create a namespace anytime you want\nto define one of these new containers.

\n

Example Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
MyFramework = Ember.Namespace.create({\n  VERSION: '1.0.0'\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/application/namespace", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-NoneLocation-c532184e35.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-NoneLocation-c532184e35.json new file mode 100644 index 000000000..b4172743e --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-NoneLocation-c532184e35.json @@ -0,0 +1,639 @@ +{ + "data": { + "id": "ember-4.12.3-NoneLocation", + "type": "class", + "attributes": { + "name": "NoneLocation", + "shortname": "NoneLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/none-location", + "namespace": "", + "file": "packages/@ember/routing/none-location.ts", + "line": 9, + "description": "

NoneLocation does not interact with the browser. It is useful for\ntesting, or when you need to manage state with your Router, but temporarily\ndon't want it to muck with the URL (for example when you embed your\napplication in a larger page).

\n

Using NoneLocation causes Ember to not store the applications URL state\nin the actual URL. This is generally used for testing purposes, and is one\nof the changes made when calling App.setupForTesting().

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/none-location.ts", + "line": 54, + "description": "

Returns the current path without rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "path", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 71, + "description": "

Set the path and remembers what was set. Using this method\nto change the path will not invoke the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 83, + "description": "

Register a callback to be invoked when the path changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 96, + "description": "

Sets the path and calls the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "handleURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 108, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/none-location.ts", + "line": 30, + "description": "

Will be pre-pended to path.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/routing/none-location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-ObjectProxy-eceaadb77a.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-ObjectProxy-eceaadb77a.json new file mode 100644 index 000000000..8b20e5d1f --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-ObjectProxy-eceaadb77a.json @@ -0,0 +1,571 @@ +{ + "data": { + "id": "ember-4.12.3-ObjectProxy", + "type": "class", + "attributes": { + "name": "ObjectProxy", + "shortname": "ObjectProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/proxy", + "namespace": "", + "file": "packages/@ember/object/proxy.ts", + "line": 8, + "description": "

ObjectProxy forwards all properties not defined by the proxy itself\nto a proxied content object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nlet exampleObject = EmberObject.create({\n  name: 'Foo'\n});\n\nlet exampleProxy = ObjectProxy.create({\n  content: exampleObject\n});\n\n// Access and change existing properties\nexampleProxy.get('name');          // 'Foo'\nexampleProxy.set('name', 'Bar');\nexampleObject.get('name');         // 'Bar'\n\n// Create new 'description' property on `exampleObject`\nexampleProxy.set('description', 'Foo is a whizboo baz');\nexampleObject.get('description');  // 'Foo is a whizboo baz'
\n
\n
\n \n

While content is unset, setting a property to be delegated will throw an\nError.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import ObjectProxy from '@ember/object/proxy';\n\nlet exampleProxy = ObjectProxy.create({\n  content: null,\n  flag: null\n});\nexampleProxy.set('flag', true);\nexampleProxy.get('flag');         // true\nexampleProxy.get('foo');          // undefined\nexampleProxy.set('foo', 'data');  // throws Error
\n
\n
\n \n

Delegated properties can be bound to and will change when content is updated.

\n

Computed properties on the proxy itself can depend on delegated properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { computed } from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nProxyWithComputedProperty = ObjectProxy.extend({\n  fullName: computed('firstName', 'lastName', function() {\n    var firstName = this.get('firstName'),\n        lastName = this.get('lastName');\n    if (firstName && lastName) {\n      return firstName + ' ' + lastName;\n    }\n    return firstName || lastName;\n  })\n});\n\nlet exampleProxy = ProxyWithComputedProperty.create();\n\nexampleProxy.get('fullName');  // undefined\nexampleProxy.set('content', {\n  firstName: 'Tom', lastName: 'Dale'\n}); // triggers property change for fullName on proxy\n\nexampleProxy.get('fullName');  // 'Tom Dale'
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "Ember.ProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 72, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 94, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/object/proxy", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Observable-7750ff3350.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Observable-7750ff3350.json new file mode 100644 index 000000000..6d3b68758 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Observable-7750ff3350.json @@ -0,0 +1,388 @@ +{ + "data": { + "id": "ember-4.12.3-Observable", + "type": "class", + "attributes": { + "name": "Observable", + "shortname": "Observable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "EmberObject" + ], + "module": "@ember/object/observable", + "namespace": "", + "file": "packages/@ember/object/observable.ts", + "line": 22, + "description": "

Overview

\n

This mixin provides properties and property observing functionality, core\nfeatures of the Ember object model.

\n

Properties and observers allow one object to observe changes to a\nproperty on another object. This is one of the fundamental ways that\nmodels, controllers and views communicate with each other in an Ember\napplication.

\n

Any object that has this mixin applied can be used in observer\noperations. That includes EmberObject and most objects you will\ninteract with as you write your Ember application.

\n

Note that you will not generally apply this mixin to classes yourself,\nbut you will use the features provided by this module frequently, so it\nis important to understand how to use it.

\n

Using get() and set()

\n

Because of Ember's support for bindings and observers, you will always\naccess properties using the get method, and set properties using the\nset method. This allows the observing objects to be notified and\ncomputed properties to be handled properly.

\n

More documentation about get and set are below.

\n

Observing Property Changes

\n

You typically observe property changes simply by using the observer\nfunction in classes that you write.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { observer } from '@ember/object';\nimport EmberObject from '@ember/object';\n\nEmberObject.extend({\n  valueObserver: observer('value', function(sender, key, value, rev) {\n    // Executes whenever the "value" property changes\n    // See the addObserver method for more information about the callback arguments\n  })\n});
\n
\n
\n \n

Although this is the most common way to add an observer, this capability\nis actually built into the EmberObject class on top of two methods\ndefined in this mixin: addObserver and removeObserver. You can use\nthese two methods to add and remove observers yourself if you need to\ndo so at runtime.

\n

To add an observer for a property, call:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
object.addObserver('propertyKey', targetObject, targetAction)
\n
\n
\n \n

This will call the targetAction method on the targetObject whenever\nthe value of the propertyKey changes.

\n

Note that if propertyKey is a computed property, the observer will be\ncalled when any of the property dependencies are changed, even if the\nresulting value of the computed property is unchanged. This is necessary\nbecause computed properties are not computed until get is called.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/object/observable", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Owner-f2bae50a77.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Owner-f2bae50a77.json new file mode 100644 index 000000000..6a51c86c9 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Owner-f2bae50a77.json @@ -0,0 +1,134 @@ +{ + "data": { + "id": "ember-4.12.3-Owner", + "type": "class", + "attributes": { + "name": "Owner", + "shortname": "Owner", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 285, + "description": "

Framework objects in an Ember application (components, services, routes,\netc.) are created via a factory and dependency injection system. Each of\nthese objects is the responsibility of an "owner", which handles its\ninstantiation and manages its lifetime.

\n

An Owner is not a class you construct; it is one the framework constructs\nfor you. The normal way to get access to the relevant Owner is using the\ngetOwner function.

\n", + "uses": [ + "BasicContainer", + "BasicRegistry" + ], + "since": "4.10.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 189, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Owner", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 238, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "Owner", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Owner", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Promise-8f7668eb20.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Promise-8f7668eb20.json new file mode 100644 index 000000000..946b55b9e --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Promise-8f7668eb20.json @@ -0,0 +1,246 @@ +{ + "data": { + "id": "ember-4.12.3-Promise", + "type": "class", + "attributes": { + "name": "Promise", + "shortname": "Promise", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 26, + "description": "

Promise objects represent the eventual result of an asynchronous operation. The\nprimary way of interacting with a promise is through its then method, which\nregisters callbacks to receive either a promise’s eventual value or the reason\nwhy the promise cannot be fulfilled.

\n

Terminology

\n
    \n
  • promise is an object or function with a then method whose behavior conforms to this specification.
  • \n
  • thenable is an object or function that defines a then method.
  • \n
  • value is any legal JavaScript value (including undefined, a thenable, or a promise).
  • \n
  • exception is a value that is thrown using the throw statement.
  • \n
  • reason is a value that indicates why a promise was rejected.
  • \n
  • settled the final resting state of a promise, fulfilled or rejected.
  • \n
\n

A promise can be in one of three states: pending, fulfilled, or rejected.

\n

Promises that are fulfilled have a fulfillment value and are in the fulfilled\nstate. Promises that are rejected have a rejection reason and are in the\nrejected state. A fulfillment value is never a thenable.

\n

Promises can also be said to resolve a value. If this value is also a\npromise, then the original promise's settled state will match the value's\nsettled state. So a promise that resolves a promise that rejects will\nitself reject, and a promise that resolves a promise that fulfills will\nitself fulfill.

\n

Basic Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
let promise = new Promise(function(resolve, reject) {\n  // on success\n  resolve(value);\n\n  // on failure\n  reject(reason);\n});\n\npromise.then(function(value) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Advanced Usage:

\n

Promises shine when abstracting away asynchronous interactions such as\nXMLHttpRequests.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
function getJSON(url) {\n  return new Promise(function(resolve, reject){\n    let xhr = new XMLHttpRequest();\n\n    xhr.open('GET', url);\n    xhr.onreadystatechange = handler;\n    xhr.responseType = 'json';\n    xhr.setRequestHeader('Accept', 'application/json');\n    xhr.send();\n\n    function handler() {\n      if (this.readyState === this.DONE) {\n        if (this.status === 200) {\n          resolve(this.response);\n        } else {\n          reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n        }\n      }\n    };\n  });\n}\n\ngetJSON('/posts.json').then(function(json) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Unlike callbacks, promises are great composable primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Promise.all([\n  getJSON('/posts'),\n  getJSON('/comments')\n]).then(function(values){\n  values[0] // => postsJSON\n  values[1] // => commentsJSON\n\n  return values;\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "params": [ + { + "name": "resolver", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "is_constructor": 1, + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/promise/all.js", + "line": 3, + "description": "

Promise.all accepts an array of promises, and returns a new promise which\nis fulfilled with an array of fulfillment values for the passed promises, or\nrejected with the reason of the first passed promise to be rejected. It casts all\nelements of the passed iterable to promises as it runs this algorithm.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Promise, { resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // The array here would be [ 1, 2, 3 ];\n});
\n
\n
\n \n

If any of the promises given to RSVP.all are rejected, the first promise\nthat is rejected will be given as an argument to the returned promises's\nrejection handler. For example:

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Promise, { resolve, reject } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error("2"));\nlet promise3 = reject(new Error("3"));\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(error) {\n  // error.message === "2"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "all", + "params": [ + { + "name": "entries", + "description": "array of promises", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all `promises` have been\nfulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "static": 1, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/race.js", + "line": 9, + "description": "

Promise.race returns a new promise which is settled in the same way as the\nfirst passed promise to settle.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 2');\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // result === 'promise 2' because it was resolved before promise1\n  // was resolved.\n});
\n
\n
\n \n

Promise.race is deterministic in that only the state of the first\nsettled promise matters. For example, even if other promises given to the\npromises array argument are resolved, but the first settled promise has\nbecome rejected before the other promises became fulfilled, the returned\npromise will become rejected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    reject(new Error('promise 2'));\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // Code here never runs\n}, function(reason){\n  // reason.message === 'promise 2' because promise 2 became rejected before\n  // promise 1 became fulfilled\n});
\n
\n
\n \n

An example real-world use case is implementing timeouts:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import Promise from 'rsvp';\n\nPromise.race([ajax('foo.json'), timeout(5000)])
\n
\n
\n \n", + "itemtype": "method", + "name": "race", + "static": 1, + "params": [ + { + "name": "entries", + "description": "array of promises to observe", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for describing the promise returned.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise which settles in the same way as the first passed\npromise to settle.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/reject.js", + "line": 6, + "description": "

Promise.reject returns a promise rejected with the passed reason.\nIt is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  reject(new Error('WHOOPS'));\n});\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = Promise.reject(new Error('WHOOPS'));\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/resolve.js", + "line": 6, + "description": "

Promise.resolve returns a promise that will become resolved with the\npassed value. It is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  resolve(1);\n});\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Promise from 'rsvp';\n\nlet promise = RSVP.Promise.resolve(1);\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "resolve", + "static": 1, + "params": [ + { + "name": "object", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 155, + "description": "

catch is simply sugar for then(undefined, onRejection) which makes it the same\nas the catch block of a try/catch statement.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
function findAuthor(){\n  throw new Error('couldn\\'t find that author');\n}\n\n// synchronous\ntry {\n  findAuthor();\n} catch(reason) {\n  // something went wrong\n}\n\n// async with promises\nfindAuthor().catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 187, + "description": "

finally will be invoked regardless of the promise's fate just as native\ntry/catch/finally behaves

\n

Synchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
findAuthor() {\n  if (Math.random() > 0.5) {\n    throw new Error();\n  }\n  return new Author();\n}\n\ntry {\n  return findAuthor(); // succeed or fail\n} catch(error) {\n  return findOtherAuthor();\n} finally {\n  // always runs\n  // doesn't affect the return value\n}
\n
\n
\n \n

Asynchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findAuthor().catch(function(reason){\n  return findOtherAuthor();\n}).finally(function(){\n  // author was either found, or not\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 248, + "description": "

The primary way of interacting with a promise is through its then method,\nwhich registers callbacks to receive either a promise's eventual value or the\nreason why the promise cannot be fulfilled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function(user){\n  // user is available\n}, function(reason){\n  // user is unavailable, and you are given the reason why\n});
\n
\n
\n \n

Chaining

\n

The return value of then is itself a promise. This second, 'downstream'\npromise is resolved with the return value of the first promise's fulfillment\nor rejection handler, or rejected if the handler throws an exception.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
findUser().then(function (user) {\n  return user.name;\n}, function (reason) {\n  return 'default name';\n}).then(function (userName) {\n  // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n  // will be `'default name'`\n});\n\nfindUser().then(function (user) {\n  throw new Error('Found user, but still unhappy');\n}, function (reason) {\n  throw new Error('`findUser` rejected and we\\'re unhappy');\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n  // If `findUser` rejected, `reason` will be '`findUser` rejected and we\\'re unhappy'.\n});
\n
\n
\n \n

If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
findUser().then(function (user) {\n  throw new PedagogicalException('Upstream error');\n}).then(function (value) {\n  // never reached\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // The `PedgagocialException` is propagated all the way down to here\n});
\n
\n
\n \n

Assimilation

\n

Sometimes the value you want to propagate to a downstream promise can only be\nretrieved asynchronously. This can be achieved by returning a promise in the\nfulfillment or rejection handler. The downstream promise will then be pending\nuntil the returned promise is settled. This is called assimilation.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // The user's comments are now available\n});
\n
\n
\n \n

If the assimliated promise rejects, then the downstream promise will also reject.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // If `findCommentsByAuthor` fulfills, we'll have the value here\n}, function (reason) {\n  // If `findCommentsByAuthor` rejects, we'll have the reason here\n});
\n
\n
\n \n

Simple Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let result;\n\ntry {\n  result = findResult();\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findResult(function(result, err){\n  if (err) {\n    // failure\n  } else {\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findResult().then(function(result){\n  // success\n}, function(reason){\n  // failure\n});
\n
\n
\n \n

Advanced Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let author, books;\n\ntry {\n  author = findAuthor();\n  books  = findBooksByAuthor(author);\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
function foundBooks(books) {\n\n}\n\nfunction failure(reason) {\n\n}\n\nfindAuthor(function(author, err){\n  if (err) {\n    failure(err);\n    // failure\n  } else {\n    try {\n      findBoooksByAuthor(author, function(books, err) {\n        if (err) {\n          failure(err);\n        } else {\n          try {\n            foundBooks(books);\n          } catch(reason) {\n            failure(reason);\n          }\n        }\n      });\n    } catch(error) {\n      failure(err);\n    }\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findAuthor().\n  then(findBooksByAuthor).\n  then(function(books){\n    // found books\n}).catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "onFulfillment", + "description": "", + "type": "Function" + }, + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-PromiseProxyMixin-2662b79cdb.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-PromiseProxyMixin-2662b79cdb.json new file mode 100644 index 000000000..d2c71a30d --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-PromiseProxyMixin-2662b79cdb.json @@ -0,0 +1,186 @@ +{ + "data": { + "id": "ember-4.12.3-PromiseProxyMixin", + "type": "class", + "attributes": { + "name": "PromiseProxyMixin", + "shortname": "PromiseProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/promise-proxy-mixin", + "namespace": "", + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 46, + "description": "

A low level mixin making ObjectProxy promise-aware.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { resolve } from 'rsvp';\nimport $ from 'jquery';\nimport ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nlet ObjectPromiseProxy = ObjectProxy.extend(PromiseProxyMixin);\n\nlet proxy = ObjectPromiseProxy.create({\n  promise: resolve($.getJSON('/some/remote/data.json'))\n});\n\nproxy.then(function(json){\n   // the json\n}, function(reason) {\n   // the reason why you have no json\n});
\n
\n
\n \n

the proxy has bindable attributes which\ntrack the promises life cycle

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> true\nproxy.get('isSettled')  //=> false\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> false
\n
\n
\n \n

When the $.getJSON completes, and the promise is fulfilled\nwith json, the life cycle attributes will update accordingly.\nNote that $.getJSON doesn't return an ECMA specified promise,\nit is useful to wrap this with an RSVP.resolve so that it behaves\nas a spec compliant promise.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> false\nproxy.get('isSettled')   //=> true\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> true
\n
\n
\n \n

As the proxy is an ObjectProxy, and the json now its content,\nall the json properties will be available directly from the proxy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// Assuming the following json:\n{\n  firstName: 'Stefan',\n  lastName: 'Penner'\n}\n\n// both properties will accessible on the proxy\nproxy.get('firstName') //=> 'Stefan'\nproxy.get('lastName')  //=> 'Penner'
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 176, + "description": "

An alias to the proxied promise's then.

\n

See RSVP.Promise.then.

\n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 187, + "description": "

An alias to the proxied promise's catch.

\n

See RSVP.Promise.catch.

\n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 199, + "description": "

An alias to the proxied promise's finally.

\n

See RSVP.Promise.finally.

\n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 110, + "description": "

If the proxied promise is rejected this will contain the reason\nprovided.

\n", + "itemtype": "property", + "name": "reason", + "default": "null", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 120, + "description": "

Once the proxied promise has settled this will become false.

\n", + "itemtype": "property", + "name": "isPending", + "default": "true", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 128, + "description": "

Once the proxied promise has settled this will become true.

\n", + "itemtype": "property", + "name": "isSettled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 137, + "description": "

Will become true if the proxied promise is rejected.

\n", + "itemtype": "property", + "name": "isRejected", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 145, + "description": "

Will become true if the proxied promise is fulfilled.

\n", + "itemtype": "property", + "name": "isFulfilled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 154, + "description": "

The promise whose fulfillment value is being proxied by this object.

\n

This property must be specified upon creation, and should not be\nchanged once created.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nObjectProxy.extend(PromiseProxyMixin).create({\n  promise: <thenable>\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "promise", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/object/promise-proxy-mixin", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-RegisterOptions-196aeb1d1c.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-RegisterOptions-cbf1f2924d.json similarity index 94% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-RegisterOptions-196aeb1d1c.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-RegisterOptions-cbf1f2924d.json index d9210266e..32a141afe 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-RegisterOptions-196aeb1d1c.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-RegisterOptions-cbf1f2924d.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-RegisterOptions", + "id": "ember-4.12.3-RegisterOptions", "type": "class", "attributes": { "name": "RegisterOptions", @@ -59,13 +59,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.12.3-@ember/owner", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Registry-78990188bb.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Registry-78990188bb.json new file mode 100644 index 000000000..4cf7d909f --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Registry-78990188bb.json @@ -0,0 +1,407 @@ +{ + "data": { + "id": "ember-4.12.3-Registry", + "type": "class", + "attributes": { + "name": "Registry", + "shortname": "Registry", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 33, + "description": "

A registry used to store factory and option information keyed\nby type.

\n

A Registry stores the factory and option information needed by a\nContainer to instantiate and cache objects.

\n

The API for Registry is still in flux and should not be considered stable.

\n", + "access": "private", + "tagname": "", + "since": "1.11.0", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 122, + "description": "

Creates a container based on this registry.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "container", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "created container", + "type": "Container" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 134, + "description": "

Registers a factory for later injection.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let registry = new Registry();\n\nregistry.register('model:user', Person, {singleton: false });\nregistry.register('fruit:favorite', Orange);\nregistry.register('communication:main', Email, {singleton: false});
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "factory", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 183, + "description": "

Unregister a fullName

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.register('model:user', User);\n\nregistry.resolve('model:user').create() instanceof User //=> true\n\nregistry.unregister('model:user')\nregistry.resolve('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 211, + "description": "

Given a fullName return the corresponding factory.

\n

By default resolve will retrieve the factory from\nthe registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let registry = new Registry();\nregistry.register('api:twitter', Twitter);\n\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n

Optionally the registry can be provided with a custom resolver.\nIf provided, resolve will first provide the custom resolver\nthe opportunity to resolve the fullName, otherwise it will fallback\nto the registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.resolver = function(fullName) {\n   // lookup via the module system of choice\n };\n\n// the twitter factory is added to the module system\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 252, + "description": "

A hook that can be used to describe how the resolver will\nattempt to find the factory.

\n

For example, the default Ember .describe returns the full\nclass name (including namespace) where Ember's resolver expects\nto find the fullName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "describe", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "described fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 275, + "description": "

A hook to enable custom fullName normalization behavior

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalizeFullName", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 293, + "description": "

Normalize a fullName based on the application's conventions

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalize", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 308, + "itemtype": "method", + "name": "makeToString", + "access": "private", + "tagname": "", + "params": [ + { + "name": "factory", + "description": "", + "type": "Any" + }, + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "toString function", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 326, + "description": "

Given a fullName check if the container is aware of its factory\nor singleton instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "the fullname of the request source (used for local lookups)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 345, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let registry = new Registry();\nlet container = registry.container();\n\n// if all of type `connection` must not be singletons\nregistry.optionsForType('connection', { singleton: false });\n\nregistry.register('connection:twitter', TwitterConnection);\nregistry.register('connection:facebook', FacebookConnection);\n\nlet twitter = container.lookup('connection:twitter');\nlet twitter2 = container.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = container.lookup('connection:facebook');\nlet facebook2 = container.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "optionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 386, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "options", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 458, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "knownForType", + "params": [ + { + "name": "type", + "description": "the type to iterate over", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 72, + "description": "

A backup registry for resolving registrations when no matches can be found.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "fallback", + "type": "Registry", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 80, + "description": "

An object that has a resolve method that resolves a name.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "resolver", + "type": "Resolver", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 88, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registrations", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 94, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_normalizeCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 101, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_resolveCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 108, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_options", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 115, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_typeOptions", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-RegistryProxy-a3d8a2b083.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-RegistryProxy-a3d8a2b083.json new file mode 100644 index 000000000..a8a54c0d0 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-RegistryProxy-a3d8a2b083.json @@ -0,0 +1,84 @@ +{ + "data": { + "id": "ember-4.12.3-RegistryProxy", + "type": "class", + "attributes": { + "name": "RegistryProxy", + "shortname": "RegistryProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 590, + "extends": "BasicRegistry", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "RegistryProxy", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-BasicRegistry", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.12.3-RegistryProxyMixin" + } + ] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-RegistryProxyMixin-5529c2d05f.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-RegistryProxyMixin-5529c2d05f.json new file mode 100644 index 000000000..002a96b4a --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-RegistryProxyMixin-5529c2d05f.json @@ -0,0 +1,112 @@ +{ + "data": { + "id": "ember-4.12.3-RegistryProxyMixin", + "type": "class", + "attributes": { + "name": "RegistryProxyMixin", + "shortname": "RegistryProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Engine", + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 12, + "description": "

RegistryProxyMixin is used to provide public access to specific\nregistry functionality.

\n", + "extends": "RegistryProxy", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 41, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "RegistryProxyMixin", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-RegistryProxy", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Renderer-37c8acf81b.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Renderer-ef9f25c1f4.json similarity index 97% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Renderer-37c8acf81b.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Renderer-ef9f25c1f4.json index b788cef7c..e30ed441d 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Renderer-37c8acf81b.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Renderer-ef9f25c1f4.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Renderer", + "id": "ember-4.12.3-Renderer", "type": "class", "attributes": { "name": "Renderer", @@ -45,13 +45,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/renderer", + "id": "ember-4.12.3-@ember/renderer", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Resolver-3ac28ae637.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Resolver-f43131415d.json similarity index 97% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Resolver-3ac28ae637.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Resolver-f43131415d.json index 1aed034b1..294ae9536 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Resolver-3ac28ae637.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Resolver-f43131415d.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Resolver", + "id": "ember-4.12.3-Resolver", "type": "class", "attributes": { "name": "Resolver", @@ -139,13 +139,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.12.3-@ember/owner", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Route-f37356a011.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Route-5a50fd966f.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Route-f37356a011.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Route-5a50fd966f.json index 0e2ff917d..0866e1f56 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Route-f37356a011.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Route-5a50fd966f.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Route", + "id": "ember-4.12.3-Route", "type": "class", "attributes": { "name": "Route", @@ -1682,7 +1682,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.12.3-EmberObject", "type": "class" } }, @@ -1691,13 +1691,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/routing/route", + "id": "ember-4.12.3-@ember/routing/route", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-RouteInfo-74ccc9cae0.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-RouteInfo-3c6b11f6e3.json similarity index 97% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-RouteInfo-74ccc9cae0.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-RouteInfo-3c6b11f6e3.json index 1a54fa8fd..bc40c7947 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-RouteInfo-74ccc9cae0.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-RouteInfo-3c6b11f6e3.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-RouteInfo", + "id": "ember-4.12.3-RouteInfo", "type": "class", "attributes": { "name": "RouteInfo", @@ -155,19 +155,19 @@ "data": [ { "type": "class", - "id": "ember-4.12.1-RouteInfoWithAttributes" + "id": "ember-4.12.3-RouteInfoWithAttributes" } ] }, "module": { "data": { - "id": "ember-4.12.1-@ember/routing/route-info", + "id": "ember-4.12.3-@ember/routing/route-info", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-RouteInfoWithAttributes-21b8b9330c.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-RouteInfoWithAttributes-fedba4b1b8.json similarity index 98% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-RouteInfoWithAttributes-21b8b9330c.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-RouteInfoWithAttributes-fedba4b1b8.json index c3cd85715..268eea286 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-RouteInfoWithAttributes-21b8b9330c.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-RouteInfoWithAttributes-fedba4b1b8.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-RouteInfoWithAttributes", + "id": "ember-4.12.3-RouteInfoWithAttributes", "type": "class", "attributes": { "name": "RouteInfoWithAttributes", @@ -181,7 +181,7 @@ "relationships": { "parent-class": { "data": { - "id": "ember-4.12.1-RouteInfo", + "id": "ember-4.12.3-RouteInfo", "type": "class" } }, @@ -190,13 +190,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/routing/route-info", + "id": "ember-4.12.3-@ember/routing/route-info", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-RouterService-271bea0a44.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-RouterService-271bea0a44.json new file mode 100644 index 000000000..9405fa5e7 --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-RouterService-271bea0a44.json @@ -0,0 +1,882 @@ +{ + "data": { + "id": "ember-4.12.3-RouterService", + "type": "class", + "attributes": { + "name": "RouterService", + "shortname": "RouterService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/router-service", + "namespace": "", + "file": "packages/@ember/routing/router-service.ts", + "line": 27, + "description": "

The Router service is the public API that provides access to the router.

\n

The immediate benefit of the Router service is that you can inject it into components,\ngiving them a friendly way to initiate transitions and ask questions about the current\nglobal router state.

\n

In this example, the Router service is injected into a component to initiate a transition\nto a dedicated route:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class ExampleComponent extends Component {\n  @service router;\n\n  @action\n  next() {\n    this.router.transitionTo('other.route');\n  }\n}
\n
\n
\n \n

Like any service, it can also be injected into helpers, routes, etc.

\n", + "access": "public", + "tagname": "", + "extends": "Service", + "methods": [ + { + "file": "packages/@ember/routing/router-service.ts", + "line": 85, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n

Calling transitionTo from the Router service will cause default query parameter values to be included in the URL.\nThis behavior is different from calling transitionTo on a route or transitionToRoute on a controller.\nSee the Router Service RFC for more info.

\n

In the following example we use the Router service to navigate to a route with a\nspecific model from a Component in the first action, and in the second we trigger\na query-params only transition.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n  @service router;\n\n  @action\n  goToComments(post) {\n    this.router.transitionTo('comments', post);\n  }\n\n  @action\n  fetchMoreComments(latestComment) {\n    this.router.transitionTo({\n      queryParams: { commentsAfter: latestComment }\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 144, + "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

Calling 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 for more info.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class extends Route {\n  beforeModel() {\n    if (!authorized()){\n      this.replaceWith('unauthorized');\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL of the desired destination", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route i.e. an object of params to pass to the destination route", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 183, + "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

In this example, the URL for the author.books route for a given author\nis copied to the clipboard.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

Just like with transitionTo and replaceWith, urlFor can also handle\nquery parameters.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "urlFor", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) for the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the string representing the generated URL", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 256, + "description": "

Returns true if routeName/models/queryParams is the active route, where models and queryParams are optional.\nSee model and\nqueryParams for more information about these arguments.

\n

In the following example, isActive will return true if the current route is /posts.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

Where 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.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used when determining the active route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "true if the provided routeName/models/queryParams are active", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 360, + "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

See RouteInfo for more info.

\n

In the following example recognize is used to verify if a path belongs to our\napplication before transitioning to it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "recognize", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo | null" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 401, + "description": "

Takes a string URL and returns a promise that resolves to a\nRouteInfoWithAttributes 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.

\n", + "itemtype": "method", + "name": "recognizeAndLoad", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 423, + "description": "

You can register a listener for events emitted by this service with .on():

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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
\n \n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 450, + "description": "

You can unregister a listener for events emitted by this service with .off():

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Route from '@ember/routing';\nimport { service } from '@ember/service';\n\nexport default class ContactFormRoute extends Route {\n  @service router;\n\n  callback = (transition) => {\n    if (!transition.to.find(route => route.name === this.routeName)) {\n      alert('Please save or cancel your changes.');\n      transition.abort();\n    }\n  };\n\n  activate() {\n    this.router.on('routeWillChange', this.callback);\n  }\n\n  deactivate() {\n    this.router.off('routeWillChange', this.callback);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 557, + "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.

\n", + "itemtype": "method", + "name": "refresh", + "params": [ + { + "name": "routeName", + "description": "the route to refresh (along with all child routes)", + "type": "String", + "optional": true + } + ], + "return": { + "description": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/routing/router-service.ts", + "line": 483, + "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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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
\n \n

The 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.

\n", + "itemtype": "event", + "name": "routeWillChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 517, + "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

A good example is sending some analytics when the route has transitioned:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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 \n

routeDidChange will be called after any Route's\ndidTransition\naction has been fired.\nThe updates of properties\ncurrentURL,\ncurrentRouteName\nand\ncurrentRoute\nare completed at the time routeDidChange is called.

\n", + "itemtype": "event", + "name": "routeDidChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + } + ], + "properties": [ + { + "file": "packages/@ember/routing/router-service.ts", + "line": 587, + "description": "

Name of the current route.

\n

This property represents the logical name of the route,\n which is dot separated.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentRouteName", + "type": "{String | null}", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 617, + "description": "

Current URL for the application.

\n

This property represents the URL path for this route.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentURL", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 646, + "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

See Location for more information.

\n

To 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\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
\n \n

The following location types are available by default:\nauto, hash, history, none.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 686, + "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

If you change the rootURL in your environment configuration\nlike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\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
\n \n

This property will return /my-root.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 716, + "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

See RouteInfo for more info.

\n

This 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

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/header.js
1\n2\n3\n4\n5\n6\n7\n8\n9\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
\n
\n \n", + "itemtype": "property", + "name": "currentRoute", + "type": "RouteInfo", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-Service", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/routing/router-service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-RoutingService-4482645bf2.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-RoutingService-bd9a0542e6.json similarity index 91% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-RoutingService-4482645bf2.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-RoutingService-bd9a0542e6.json index 3348339fa..d50e91180 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-RoutingService-4482645bf2.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-RoutingService-bd9a0542e6.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-RoutingService", + "id": "ember-4.12.3-RoutingService", "type": "class", "attributes": { "name": "RoutingService", @@ -30,13 +30,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-SafeString-c2b3cb09f0.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-SafeString-01ff1278b3.json similarity index 96% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-SafeString-c2b3cb09f0.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-SafeString-01ff1278b3.json index 389dfe7d6..98f538c78 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-SafeString-c2b3cb09f0.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-SafeString-01ff1278b3.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-SafeString", + "id": "ember-4.12.3-SafeString", "type": "class", "attributes": { "name": "SafeString", @@ -62,13 +62,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/template", + "id": "ember-4.12.3-@ember/template", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-Service-40844a28a1.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Service-40844a28a1.json new file mode 100644 index 000000000..115d5787b --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Service-40844a28a1.json @@ -0,0 +1,541 @@ +{ + "data": { + "id": "ember-4.12.3-Service", + "type": "class", + "attributes": { + "name": "Service", + "shortname": "Service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "file": "packages/@ember/service/index.ts", + "line": 87, + "extends": "EmberObject", + "since": "1.10.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.12.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.12.3-RouterService" + } + ] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-String-41f2d40414.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-String-08b5bad3c1.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-String-41f2d40414.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-String-08b5bad3c1.json index a2eba27de..79c5a21c8 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-String-41f2d40414.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-String-08b5bad3c1.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-String", + "id": "ember-4.12.3-String", "type": "class", "attributes": { "name": "String", @@ -201,13 +201,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/string", + "id": "ember-4.12.3-@ember/string", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-TestAdapter-c71010b042.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-TestAdapter-0758b2d19b.json similarity index 95% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-TestAdapter-c71010b042.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-TestAdapter-0758b2d19b.json index e5a195f44..d507ffa65 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-TestAdapter-c71010b042.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-TestAdapter-0758b2d19b.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-TestAdapter", + "id": "ember-4.12.3-TestAdapter", "type": "class", "attributes": { "name": "TestAdapter", @@ -70,19 +70,19 @@ "data": [ { "type": "class", - "id": "ember-4.12.1-Ember.Test.QUnitAdapter" + "id": "ember-4.12.3-Ember.Test.QUnitAdapter" } ] }, "module": { "data": { - "id": "ember-4.12.1-@ember/test", + "id": "ember-4.12.3-@ember/test", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/classes/ember-4.12.1-Transition-60184af5dd.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-Transition-960d23580e.json similarity index 99% rename from json-docs/ember/4.12.1/classes/ember-4.12.1-Transition-60184af5dd.json rename to json-docs/ember/4.12.3/classes/ember-4.12.3-Transition-960d23580e.json index 40f87106a..2af5b3b66 100644 --- a/json-docs/ember/4.12.1/classes/ember-4.12.1-Transition-60184af5dd.json +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-Transition-960d23580e.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-Transition", + "id": "ember-4.12.3-Transition", "type": "class", "attributes": { "name": "Transition", @@ -292,13 +292,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/routing/transition", + "id": "ember-4.12.3-@ember/routing/transition", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/classes/ember-4.12.3-rsvp-5dff387a76.json b/json-docs/ember/4.12.3/classes/ember-4.12.3-rsvp-5dff387a76.json new file mode 100644 index 000000000..e9985f39f --- /dev/null +++ b/json-docs/ember/4.12.3/classes/ember-4.12.3-rsvp-5dff387a76.json @@ -0,0 +1,445 @@ +{ + "data": { + "id": "ember-4.12.3-rsvp", + "type": "class", + "attributes": { + "name": "rsvp", + "shortname": "rsvp", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/all-settled.js", + "line": 20, + "description": "

RSVP.allSettled is similar to RSVP.all, but instead of implementing\na fail-fast method, it waits until all the promises have returned and\nshows you all the results. This is useful if you want to handle multiple\npromises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled. The return promise is fulfilled with an array of the states of\nthe promises passed into the promises array argument.

\n

Each state object will either indicate fulfillment or rejection, and\nprovide the corresponding value or reason. The states will take one of\nthe following formats:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{ state: 'fulfilled', value: value }\n  or\n{ state: 'rejected', reason: reason }
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
let promise1 = RSVP.Promise.resolve(1);\nlet promise2 = RSVP.Promise.reject(new Error('2'));\nlet promise3 = RSVP.Promise.reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nRSVP.allSettled(promises).then(function(array){\n  // array == [\n  //   { state: 'fulfilled', value: 1 },\n  //   { state: 'rejected', reason: Error },\n  //   { state: 'rejected', reason: Error }\n  // ]\n  // Note that for the second item, reason.message will be '2', and for the\n  // third item, reason.message will be '3'.\n}, function(error) {\n  // Not run. (This block would only be called if allSettled had failed,\n  // for instance if passed an incorrect argument type.)\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "allSettled", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "entries", + "description": "", + "type": "Array" + }, + { + "name": "label", + "description": "- optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with an array of the settled\nstates of the constituent promises.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/all.js", + "line": 3, + "description": "

This is a convenient alias for Promise.all.

\n", + "itemtype": "method", + "name": "all", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/defer.js", + "line": 3, + "description": "

defer returns an object similar to jQuery's $.Deferred.\ndefer should be used when porting over code reliant on $.Deferred's\ninterface. New code should use the Promise constructor instead.

\n

The object returned from defer is a plain object with three properties:

\n
    \n
  • promise - an Promise.
  • \n
  • reject - a function that causes the promise property on this object to\nbecome rejected
  • \n
  • resolve - a function that causes the promise property on this object to\nbecome fulfilled.
  • \n
\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let deferred = defer();\n\ndeferred.resolve("Success!");\n\ndeferred.promise.then(function(value){\n  // value here is "Success!"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "defer", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 19, + "description": "

EventTarget.mixin extends an object with EventTarget methods. For\nExample:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import EventTarget from 'rsvp';\n\nlet object = {};\n\nEventTarget.mixin(object);\n\nobject.on('finished', function(event) {\n  // handle event\n});\n\nobject.trigger('finished', { detail: value });
\n
\n
\n \n

EventTarget.mixin also works with prototypes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EventTarget from 'rsvp';\n\nlet Person = function() {};\nEventTarget.mixin(Person.prototype);\n\nlet yehuda = new Person();\nlet tom = new Person();\n\nyehuda.on('poke', function(event) {\n  console.log('Yehuda says OW');\n});\n\ntom.on('poke', function(event) {\n  console.log('Tom says OW');\n});\n\nyehuda.trigger('poke');\ntom.trigger('poke');
\n
\n
\n \n", + "itemtype": "method", + "name": "mixin", + "access": "private", + "tagname": "", + "params": [ + { + "name": "object", + "description": "object to extend with EventTarget methods", + "type": "Object" + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 107, + "description": "

You can use off to stop firing a particular callback for an event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function doStuff() { // do stuff! }\nobject.on('stuff', doStuff);\n\nobject.trigger('stuff'); // doStuff will be called\n\n// Unregister ONLY the doStuff callback\nobject.off('stuff', doStuff);\nobject.trigger('stuff'); // doStuff will NOT be called
\n
\n
\n \n

If you don't pass a callback argument to off, ALL callbacks for the\nevent will not be executed when the event fires. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let callback1 = function(){};\nlet callback2 = function(){};\n\nobject.on('stuff', callback1);\nobject.on('stuff', callback2);\n\nobject.trigger('stuff'); // callback1 and callback2 will be executed.\n\nobject.off('stuff');\nobject.trigger('stuff'); // callback1 and callback2 will not be executed!
\n
\n
\n \n", + "itemtype": "method", + "name": "off", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "event to stop listening to", + "type": "String" + }, + { + "name": "callback", + "description": "optional argument. If given, only the function\ngiven will be removed from the event's callback queue. If no `callback`\nargument is given, all callbacks will be removed from the event's callback\nqueue.", + "type": "Function", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 162, + "description": "

Use trigger to fire custom events. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
object.on('foo', function(){\n  console.log('foo event happened!');\n});\nobject.trigger('foo');\n// 'foo event happened!' logged to the console
\n
\n
\n \n

You can also pass a value as a second argument to trigger that will be\npassed as an argument to all event listeners for the event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
object.on('foo', function(value){\n  console.log(value.name);\n});\n\nobject.trigger('foo', { name: 'bar' });\n// 'bar' logged to the console
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "name of the event to be triggered", + "type": "String" + }, + { + "name": "options", + "description": "optional value to be passed to any event handlers for\nthe given `eventName`", + "type": "*", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/filter.js", + "line": 42, + "description": "

filter is similar to JavaScript's native filter method.\nfilterFn is eagerly called meaning that as soon as any promise\n resolves its value will be passed to filterFn. filter returns\n a promise that will become fulfilled with the result of running\n filterFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { filter, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\n\nlet promises = [promise1, promise2, promise3];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(result){\n  // result is [ 2, 3 ]\n});
\n
\n
\n \n

If any of the promises given to filter are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { filter, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

filter will also wait for any promises returned from filterFn.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter, resolve } from 'rsvp';\n\nlet alice = { name: 'alice' };\nlet bob   = { name: 'bob' };\nlet users = [ alice, bob ];\n\nlet promises = users.map(function(user){\n  return resolve(user);\n});\n\nlet filterFn = function(user){\n  // Here, Alice has permissions to create a blog post, but Bob does not.\n  return getPrivilegesForUser(user).then(function(privs){\n    return privs.can_create_blog_post === true;\n  });\n};\nfilter(promises, filterFn).then(function(users){\n  // true, because the server told us only Alice can create a blog post.\n  users.length === 1;\n  // false, because Alice is the only user present in `users`\n  users[0] === bob;\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "filterFn", + "description": "- function to be called on each resolved value to\n filter the final results.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string describing the promise. Useful for\n tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash-settled.js", + "line": 16, + "description": "

hashSettled is similar to allSettled, but takes an object\ninstead of an array for its promises argument.

\n

Unlike all or hash, which implement a fail-fast method,\nbut like allSettled, hashSettled waits until all the\nconstituent promises have returned and then shows you all the results\nwith their states and values/reasons. This is useful if you want to\nhandle multiple promises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled, or rejected if the passed parameters are invalid.

\n

The returned promise is fulfilled with a hash that has the same key names as\nthe promises object argument. If any of the values in the object are not\npromises, they will be copied over to the fulfilled object and marked with state\n'fulfilled'.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: { state: 'fulfilled', value: 1 },\n  //   yourPromise: { state: 'fulfilled', value: 2 },\n  //   theirPromise: { state: 'fulfilled', value: 3 },\n  //   notAPromise: { state: 'fulfilled', value: 4 }\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the state will\nbe set to 'rejected' and the reason for rejection provided.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, reject, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejection')),\n  anotherRejectedPromise: reject(new Error('more rejection')),\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise:              { state: 'fulfilled', value: 1 },\n  //   rejectedPromise:        { state: 'rejected', reason: Error },\n  //   anotherRejectedPromise: { state: 'rejected', reason: Error },\n  // }\n  // Note that for rejectedPromise, reason.message == 'rejection',\n  // and for anotherRejectedPromise, reason.message == 'more rejection'.\n});
\n
\n
\n \n

An important note: hashSettled is intended for plain JavaScript objects that\nare just a set of keys and values. hashSettled will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import Promise, { hashSettled, resolve } from 'rsvp';\n\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: Promise.resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhashSettled(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: { state: 'fulfilled', value: 'Example' }\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hashSettled", + "access": "public", + "tagname": "", + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when when all properties of `promises`\nhave been settled.", + "type": "Promise" + }, + "static": 1, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash.js", + "line": 4, + "description": "

hash is similar to all, but takes an object instead of an array\nfor its promises argument.

\n

Returns a promise that is fulfilled when all the given promises have been\nfulfilled, or rejected if any of them become rejected. The returned promise\nis fulfilled with a hash that has the same key names as the promises object\nargument. If any of the values in the object are not promises, they will\nsimply be copied over to the fulfilled object.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhash(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: 1,\n  //   yourPromise: 2,\n  //   theirPromise: 3,\n  //   notAPromise: 4\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the first promise\nthat is rejected will be given as the reason to the rejection handler.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejectedPromise')),\n  anotherRejectedPromise: reject(new Error('anotherRejectedPromise')),\n};\n\nhash(promises).then(function(hash){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === 'rejectedPromise'\n});
\n
\n
\n \n

An important note: hash is intended for plain JavaScript objects that\nare just a set of keys and values. hash will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { hash, resolve } from 'rsvp';\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhash(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: 'Example'\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all properties of `promises`\nhave been fulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/map.js", + "line": 39, + "description": "

map is similar to JavaScript's native map method. mapFn is eagerly called\n meaning that as soon as any promise resolves its value will be passed to mapFn.\n map returns a promise that will become fulfilled with the result of running\n mapFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(result){\n  // result is [ 2, 3, 4 ]\n});
\n
\n
\n \n

If any of the promises given to map are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { map, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

map will also wait if a promise is returned from mapFn. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first because they contain a url to those comments.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map } from 'rsvp';\n\nlet mapFn = function(blogPost){\n  // getComments does some ajax and returns an Promise that is fulfilled\n  // with some comments data\n  return getComments(blogPost.comments_url);\n};\n\n// getBlogPosts does some ajax and returns an Promise that is fulfilled\n// with some blog post data\nmap(getBlogPosts(), mapFn).then(function(comments){\n  // comments is the result of asking the server for the comments\n  // of all blog posts returned from getBlogPosts()\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "mapFn", + "description": "function to be called on each fulfilled promise.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\n Useful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/node.js", + "line": 44, + "description": "

denodeify takes a 'node-style' function and returns a function that\nwill return an Promise. You can use denodeify in Node.js or the\nbrowser when you'd prefer to use promises over using callbacks. For example,\ndenodeify transforms the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) return handleError(err);\n  handleData(data);\n});
\n
\n
\n \n

into:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\n\nreadFile('myfile.txt').then(handleData, handleError);
\n
\n
\n \n

If the node function has multiple success parameters, then denodeify\njust returns the first one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let request = denodeify(require('request'));\n\nrequest('http://example.com').then(function(res) {\n  // ...\n});
\n
\n
\n \n

However, if you need all success parameters, setting denodeify's\nsecond parameter to true causes it to return all success parameters\nas an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), true);\n\nrequest('http://example.com').then(function(result) {\n  // result[0] -> res\n  // result[1] -> body\n});
\n
\n
\n \n

Or if you pass it an array with names it returns the parameters as a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), ['res', 'body']);\n\nrequest('http://example.com').then(function(result) {\n  // result.res\n  // result.body\n});
\n
\n
\n \n

Sometimes you need to retain the this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let app = require('express')();\nlet render = denodeify(app.render.bind(app));
\n
\n
\n \n

The denodified function inherits from the original function. It works in all\nenvironments, except IE 10 and below. Consequently all properties of the original\nfunction are available to you. However, any properties you change on the\ndenodeified function won't be changed on the original function. Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request')),\n    cookieJar = request.jar(); // <- Inheritance is used here\n\nrequest('http://example.com', {jar: cookieJar}).then(function(res) {\n  // cookieJar.cookies holds now the cookies returned by example.com\n});
\n
\n
\n \n

Using denodeify makes it easier to compose asynchronous operations instead\nof using callbacks. For example, instead of:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) { ... } // Handle error\n  fs.writeFile('myfile2.txt', data, function(err){\n    if (err) { ... } // Handle error\n    console.log('done')\n  });\n});
\n
\n
\n \n

you can chain the operations together using then from the returned promise:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\nlet writeFile = denodeify(fs.writeFile);\n\nreadFile('myfile.txt').then(function(data){\n  return writeFile('myfile2.txt', data);\n}).then(function(){\n  console.log('done')\n}).catch(function(error){\n  // Handle error\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "denodeify", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "nodeFunc", + "description": "a 'node-style' function that takes a callback as\nits last argument. The callback expects an error to be passed as its first\nargument (if an error occurred, otherwise null), and the value from the\noperation as its second argument ('function(err, value){ }').", + "type": "Function" + }, + { + "name": "options", + "description": "An optional paramter that if set\nto `true` causes the promise to fulfill with the callback's success arguments\nas an array. This is useful if the node function has multiple success\nparamters. If you set this paramter to an array with names, the promise will\nfulfill with a hash with these names as keys and the success parameters as\nvalues.", + "type": "Boolean|Array", + "optional": true + } + ], + "return": { + "description": "a function that wraps `nodeFunc` to return a `Promise`", + "type": "Function" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/race.js", + "line": 3, + "description": "

This is a convenient alias for Promise.race.

\n", + "itemtype": "method", + "name": "race", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/reject.js", + "line": 3, + "description": "

This is a convenient alias for Promise.reject.

\n", + "itemtype": "method", + "name": "reject", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/resolve.js", + "line": 3, + "description": "

This is a convenient alias for Promise.resolve.

\n", + "itemtype": "method", + "name": "resolve", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "value", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/rethrow.js", + "line": 1, + "description": "

rethrow will rethrow an error on the next turn of the JavaScript event\nloop in order to aid debugging.

\n

Promises A+ specifies that any exceptions that occur with a promise must be\ncaught by the promises implementation and bubbled to the last handler. For\nthis reason, it is recommended that you always specify a second rejection\nhandler function to then. However, rethrow will throw the exception\noutside of the promise, so it bubbles up to your console if in the browser,\nor domain/cause uncaught exception in Node. rethrow will also throw the\nerror again so the error can be handled by the promise per the spec.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { rethrow } from 'rsvp';\n\nfunction throws(){\n  throw new Error('Whoops!');\n}\n\nlet promise = new Promise(function(resolve, reject){\n  throws();\n});\n\npromise.catch(rethrow).then(function(){\n  // Code here doesn't run because the promise became rejected due to an\n  // error!\n}, function (err){\n  // handle the error here\n});
\n
\n
\n \n

The 'Whoops' error will be thrown on the next turn of the event loop\nand you can watch for it in your console. You can also handle it using a\nrejection handler given to .then or .catch on the returned promise.

\n", + "itemtype": "method", + "name": "rethrow", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "reason the promise became rejected.", + "type": "Error" + } + ], + "throws": { + "description": "Error" + }, + "class": "rsvp", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/missings/Ember.Namespace-13a8cc79d3.json b/json-docs/ember/4.12.3/missings/Ember.Namespace-13a8cc79d3.json similarity index 100% rename from json-docs/ember/4.12.1/missings/Ember.Namespace-13a8cc79d3.json rename to json-docs/ember/4.12.3/missings/Ember.Namespace-13a8cc79d3.json diff --git a/json-docs/ember/4.12.1/missings/Error-158974c414.json b/json-docs/ember/4.12.3/missings/Error-158974c414.json similarity index 100% rename from json-docs/ember/4.12.1/missings/Error-158974c414.json rename to json-docs/ember/4.12.3/missings/Error-158974c414.json diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/application-57400f0f42.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/application-19a35559d4.json similarity index 97% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/application-57400f0f42.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/application-19a35559d4.json index e2fe4b9a2..797f01fdc 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/application-57400f0f42.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/application-19a35559d4.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/application", + "id": "ember-4.12.3-@ember/application", "type": "module", "attributes": { "name": "@ember/application", @@ -100,7 +100,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -108,7 +108,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/application/namespace-df0f3ba35e.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/application/namespace-0b5d64cb9c.json similarity index 85% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/application/namespace-df0f3ba35e.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/application/namespace-0b5d64cb9c.json index 0cca380b5..c241ba0e2 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/application/namespace-df0f3ba35e.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/application/namespace-0b5d64cb9c.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/application/namespace", + "id": "ember-4.12.3-@ember/application/namespace", "type": "module", "attributes": { "name": "@ember/application/namespace", @@ -18,7 +18,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -26,7 +26,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/array-c167d6802e.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/array-979df3651c.json similarity index 98% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/array-c167d6802e.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/array-979df3651c.json index 51c2fa086..c2ad81c4f 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/array-c167d6802e.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/array-979df3651c.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/array", + "id": "ember-4.12.3-@ember/array", "type": "module", "attributes": { "name": "@ember/array", @@ -128,7 +128,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -136,7 +136,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/array/proxy-db3b2da21c.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/array/proxy-d6c4968f23.json similarity index 85% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/array/proxy-db3b2da21c.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/array/proxy-d6c4968f23.json index c4f0ce0f8..55aff1bc8 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/array/proxy-db3b2da21c.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/array/proxy-d6c4968f23.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/array/proxy", + "id": "ember-4.12.3-@ember/array/proxy", "type": "module", "attributes": { "name": "@ember/array/proxy", @@ -18,7 +18,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -26,7 +26,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/canary-features-069bae3d06.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/canary-features-16c264b934.json similarity index 90% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/canary-features-069bae3d06.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/canary-features-16c264b934.json index 0a2d0683a..9888a1c39 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/canary-features-069bae3d06.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/canary-features-16c264b934.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/canary-features", + "id": "ember-4.12.3-@ember/canary-features", "type": "module", "attributes": { "name": "@ember/canary-features", @@ -19,7 +19,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -27,7 +27,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/component-49ea15a340.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/component-49ea15a340.json new file mode 100644 index 000000000..0a296355a --- /dev/null +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/component-49ea15a340.json @@ -0,0 +1,89 @@ +{ + "data": { + "id": "ember-4.12.3-@ember/component", + "type": "module", + "attributes": { + "name": "@ember/component", + "submodules": {}, + "elements": {}, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/component": 1, + "Ember.Templates.components": 1, + "@ember/component/helper": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 73, + "description": "

Glimmer is a templating engine used by Ember.js that is compatible with a subset of the Handlebars syntax.

\n

Showing a property

\n

Templates manage the flow of an application's UI, and display state (through\nthe DOM) to a user. For example, given a component with the property "name",\nthat component's template can use the name in several ways:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  name: 'Jill'\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
{{this.name}}\n<div>{{this.name}}</div>\n<span data-name={{this.name}}></span>
\n
\n
\n \n

Any time the "name" property on the component changes, the DOM will be\nupdated.

\n

Properties can be chained as well:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{@aUserModel.name}}\n<div>{{@listOfUsers.firstObject.name}}</div>
\n
\n
\n \n

Using Ember helpers

\n

When content is passed in mustaches {{}}, Ember will first try to find a helper\nor component with that name. For example, the if helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
{{if this.name "I have a name" "I have no name"}}\n<span data-has-name={{if this.name true}}></span>
\n
\n
\n \n

The returned value is placed where the {{}} is called. The above style is\ncalled "inline". A second style of helper usage is called "block". For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#if this.name}}\n  I have a name\n{{else}}\n  I have no name\n{{/if}}
\n
\n
\n \n

The block form of helpers allows you to control how the UI is created based\non the values of properties.\nA third form of helper is called "nested". For example here the concat\nhelper will add " Doe" to a displayed name if the person has no last name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<span data-name={{concat this.firstName (\n  if this.lastName (concat " " this.lastName) "Doe"\n)}}></span>
\n
\n
\n \n

Ember's built-in helpers are described under the Ember.Templates.helpers\nnamespace. Documentation on creating custom helpers can be found under\nhelper (or\nunder Helper if a helper requires access to\ndependency injection).

\n

Invoking a Component

\n

Ember components represent state to the UI of an application. Further\nreading on components can be found under Component.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "Component", + "Helper" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 47, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "allstaticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 47, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "version": "4.12.3" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/component/template-only-e09c18502f.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/component/template-only-c625d140ca.json similarity index 97% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/component/template-only-e09c18502f.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/component/template-only-c625d140ca.json index 000f021d0..c13eb1e67 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/component/template-only-e09c18502f.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/component/template-only-c625d140ca.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/component/template-only", + "id": "ember-4.12.3-@ember/component/template-only", "type": "module", "attributes": { "name": "@ember/component/template-only", @@ -76,7 +76,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -84,7 +84,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/controller-056ef2f915.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/controller-4c53bb6cd5.json similarity index 97% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/controller-056ef2f915.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/controller-4c53bb6cd5.json index ed6aac838..0eed2acd2 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/controller-056ef2f915.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/controller-4c53bb6cd5.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/controller", + "id": "ember-4.12.3-@ember/controller", "type": "module", "attributes": { "name": "@ember/controller", @@ -79,7 +79,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -87,7 +87,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/debug-245ec65767.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/debug-df4f46a7b4.json similarity index 99% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/debug-245ec65767.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/debug-df4f46a7b4.json index c75fdc51e..dd6e9c584 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/debug-245ec65767.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/debug-df4f46a7b4.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/debug", + "id": "ember-4.12.3-@ember/debug", "type": "module", "attributes": { "name": "@ember/debug", @@ -488,7 +488,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -496,7 +496,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/debug/container-debug-adapter-cb265689c5.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/debug/container-debug-adapter-dd1126f7a8.json similarity index 84% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/debug/container-debug-adapter-cb265689c5.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/debug/container-debug-adapter-dd1126f7a8.json index ce2ff81b6..f20ed644e 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/debug/container-debug-adapter-cb265689c5.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/debug/container-debug-adapter-dd1126f7a8.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/debug/container-debug-adapter", + "id": "ember-4.12.3-@ember/debug/container-debug-adapter", "type": "module", "attributes": { "name": "@ember/debug/container-debug-adapter", @@ -18,7 +18,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -26,7 +26,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/debug/data-adapter-49c4b28104.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/debug/data-adapter-afdc96146e.json similarity index 85% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/debug/data-adapter-49c4b28104.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/debug/data-adapter-afdc96146e.json index 8f86cebf3..e6a36cde8 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/debug/data-adapter-49c4b28104.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/debug/data-adapter-afdc96146e.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/debug/data-adapter", + "id": "ember-4.12.3-@ember/debug/data-adapter", "type": "module", "attributes": { "name": "@ember/debug/data-adapter", @@ -18,7 +18,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -26,7 +26,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/destroyable-532511959e.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/destroyable-f3eeb6e830.json similarity index 99% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/destroyable-532511959e.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/destroyable-f3eeb6e830.json index ae7ae5ce0..279451b74 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/destroyable-532511959e.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/destroyable-f3eeb6e830.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/destroyable", + "id": "ember-4.12.3-@ember/destroyable", "type": "module", "attributes": { "name": "@ember/destroyable", @@ -357,7 +357,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -365,7 +365,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/engine-a6e6ef870b.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/engine-5660bceb34.json similarity index 96% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/engine-a6e6ef870b.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/engine-5660bceb34.json index abfbcf20a..2d9a7ecd1 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/engine-a6e6ef870b.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/engine-5660bceb34.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/engine", + "id": "ember-4.12.3-@ember/engine", "type": "module", "attributes": { "name": "@ember/engine", @@ -72,7 +72,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -80,7 +80,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/enumerable-e932195429.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/enumerable-8fff8a907f.json similarity index 86% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/enumerable-e932195429.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/enumerable-8fff8a907f.json index 35fdfce05..ea042bfda 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/enumerable-e932195429.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/enumerable-8fff8a907f.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/enumerable", + "id": "ember-4.12.3-@ember/enumerable", "type": "module", "attributes": { "name": "@ember/enumerable", @@ -20,7 +20,7 @@ ], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -28,7 +28,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/error-d624fe1f49.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/error-0b41d1dd35.json similarity index 90% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/error-d624fe1f49.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/error-0b41d1dd35.json index 6de3a7396..321d23b04 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/error-d624fe1f49.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/error-0b41d1dd35.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/error", + "id": "ember-4.12.3-@ember/error", "type": "module", "attributes": { "name": "@ember/error", @@ -21,7 +21,7 @@ ], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -29,7 +29,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/helper-40c49fd4b6.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/helper-fa7b3fe76d.json similarity index 99% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/helper-40c49fd4b6.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/helper-fa7b3fe76d.json index aec7e0db0..5da80bb8b 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/helper-40c49fd4b6.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/helper-fa7b3fe76d.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/helper", + "id": "ember-4.12.3-@ember/helper", "type": "module", "attributes": { "name": "@ember/helper", @@ -198,7 +198,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -206,7 +206,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/instrumentation-fe2dba7365.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/instrumentation-ae03844038.json similarity index 97% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/instrumentation-fe2dba7365.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/instrumentation-ae03844038.json index 8dca7e347..93a3789f9 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/instrumentation-fe2dba7365.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/instrumentation-ae03844038.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/instrumentation", + "id": "ember-4.12.3-@ember/instrumentation", "type": "module", "attributes": { "name": "@ember/instrumentation", @@ -120,7 +120,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -128,7 +128,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object-df7d456228.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object-d62a557a66.json similarity index 99% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object-df7d456228.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object-d62a557a66.json index 5545084ed..f53190c3f 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object-df7d456228.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object-d62a557a66.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/object", + "id": "ember-4.12.3-@ember/object", "type": "module", "attributes": { "name": "@ember/object", @@ -2889,7 +2889,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -2897,7 +2897,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/core-792bc42d55.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/core-f8a649d859.json similarity index 99% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/core-792bc42d55.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/core-f8a649d859.json index cdfe67faf..a21a040d7 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/core-792bc42d55.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/core-f8a649d859.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/object/core", + "id": "ember-4.12.3-@ember/object/core", "type": "module", "attributes": { "name": "@ember/object/core", @@ -213,7 +213,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -221,7 +221,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/evented-84a6839f92.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/evented-2ac97828ae.json similarity index 85% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/evented-84a6839f92.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/evented-2ac97828ae.json index 622f45bc1..b839cbb82 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/evented-84a6839f92.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/evented-2ac97828ae.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/object/evented", + "id": "ember-4.12.3-@ember/object/evented", "type": "module", "attributes": { "name": "@ember/object/evented", @@ -18,7 +18,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -26,7 +26,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/mixin-6cd1ccee01.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/mixin-05dc33dff2.json similarity index 94% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/mixin-6cd1ccee01.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/mixin-05dc33dff2.json index 95606388e..67cb7772b 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/mixin-6cd1ccee01.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/mixin-05dc33dff2.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/object/mixin", + "id": "ember-4.12.3-@ember/object/mixin", "type": "module", "attributes": { "name": "@ember/object/mixin", @@ -62,7 +62,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -70,7 +70,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/observable-a55837e659.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/observable-0aa2e2e798.json similarity index 85% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/observable-a55837e659.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/observable-0aa2e2e798.json index a17e9ef89..837681231 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/observable-a55837e659.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/observable-0aa2e2e798.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/object/observable", + "id": "ember-4.12.3-@ember/object/observable", "type": "module", "attributes": { "name": "@ember/object/observable", @@ -18,7 +18,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -26,7 +26,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/promise-proxy-mixin-46b6520087.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/promise-proxy-mixin-f711c33df5.json similarity index 84% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/promise-proxy-mixin-46b6520087.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/promise-proxy-mixin-f711c33df5.json index d9adff7c0..50fcd5b13 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/promise-proxy-mixin-46b6520087.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/promise-proxy-mixin-f711c33df5.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/object/promise-proxy-mixin", + "id": "ember-4.12.3-@ember/object/promise-proxy-mixin", "type": "module", "attributes": { "name": "@ember/object/promise-proxy-mixin", @@ -18,7 +18,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -26,7 +26,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/proxy-45895b596c.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/proxy-86054b78d5.json similarity index 85% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/proxy-45895b596c.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/proxy-86054b78d5.json index d368f7171..dd38a243c 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/object/proxy-45895b596c.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/object/proxy-86054b78d5.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/object/proxy", + "id": "ember-4.12.3-@ember/object/proxy", "type": "module", "attributes": { "name": "@ember/object/proxy", @@ -18,7 +18,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -26,7 +26,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/owner-b1ec9934cb.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/owner-5b2efe8012.json similarity index 98% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/owner-b1ec9934cb.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/owner-5b2efe8012.json index 5d7d63d17..bae3dfe69 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/owner-b1ec9934cb.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/owner-5b2efe8012.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.12.3-@ember/owner", "type": "module", "attributes": { "name": "@ember/owner", @@ -162,7 +162,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -170,7 +170,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/polyfills-3e97a51770.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/polyfills-2d444577e7.json similarity index 96% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/polyfills-3e97a51770.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/polyfills-2d444577e7.json index 4c80dfc93..bdc3d6487 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/polyfills-3e97a51770.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/polyfills-2d444577e7.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/polyfills", + "id": "ember-4.12.3-@ember/polyfills", "type": "module", "attributes": { "name": "@ember/polyfills", @@ -82,7 +82,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -90,7 +90,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/renderer-0308badd1d.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/renderer-888b061c86.json similarity index 87% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/renderer-0308badd1d.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/renderer-888b061c86.json index 052cb946f..bf733efa0 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/renderer-0308badd1d.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/renderer-888b061c86.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/renderer", + "id": "ember-4.12.3-@ember/renderer", "type": "module", "attributes": { "name": "@ember/renderer", @@ -22,7 +22,7 @@ ], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -30,7 +30,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing-453023ea1b.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing-ecd61d86ea.json similarity index 87% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing-453023ea1b.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing-ecd61d86ea.json index b63712b0d..bfba606e6 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing-453023ea1b.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing-ecd61d86ea.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/routing", + "id": "ember-4.12.3-@ember/routing", "type": "module", "attributes": { "name": "@ember/routing", @@ -19,7 +19,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -27,7 +27,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/auto-location-16551661ec.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/auto-location-7da46b7731.json similarity index 84% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/auto-location-16551661ec.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/auto-location-7da46b7731.json index ed7ba4686..2b432c8af 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/auto-location-16551661ec.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/auto-location-7da46b7731.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/routing/auto-location", + "id": "ember-4.12.3-@ember/routing/auto-location", "type": "module", "attributes": { "name": "@ember/routing/auto-location", @@ -16,7 +16,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -24,7 +24,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/hash-location-2f69885701.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/hash-location-48a69a8ad7.json similarity index 85% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/hash-location-2f69885701.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/hash-location-48a69a8ad7.json index 24ea14bed..e4438af9d 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/hash-location-2f69885701.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/hash-location-48a69a8ad7.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/routing/hash-location", + "id": "ember-4.12.3-@ember/routing/hash-location", "type": "module", "attributes": { "name": "@ember/routing/hash-location", @@ -18,7 +18,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -26,7 +26,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/history-location-0a4793b8b8.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/history-location-f8c29255b0.json similarity index 84% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/history-location-0a4793b8b8.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/history-location-f8c29255b0.json index a193df875..e895e9a1d 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/history-location-0a4793b8b8.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/history-location-f8c29255b0.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/routing/history-location", + "id": "ember-4.12.3-@ember/routing/history-location", "type": "module", "attributes": { "name": "@ember/routing/history-location", @@ -18,7 +18,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -26,7 +26,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/location-f23c0262ca.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/location-58acaededa.json similarity index 85% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/location-f23c0262ca.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/location-58acaededa.json index 8b5f6c0db..3435295c1 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/location-f23c0262ca.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/location-58acaededa.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/routing/location", + "id": "ember-4.12.3-@ember/routing/location", "type": "module", "attributes": { "name": "@ember/routing/location", @@ -18,7 +18,7 @@ ], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -26,7 +26,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/none-location-17b09544e3.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/none-location-98052e015b.json similarity index 85% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/none-location-17b09544e3.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/none-location-98052e015b.json index 2ff50c365..4b23ebcd0 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/none-location-17b09544e3.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/none-location-98052e015b.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/routing/none-location", + "id": "ember-4.12.3-@ember/routing/none-location", "type": "module", "attributes": { "name": "@ember/routing/none-location", @@ -18,7 +18,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -26,7 +26,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/route-173cfaf337.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/route-c8258097d9.json similarity index 86% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/route-173cfaf337.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/route-c8258097d9.json index 909c44b95..7a16619a2 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/route-173cfaf337.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/route-c8258097d9.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/routing/route", + "id": "ember-4.12.3-@ember/routing/route", "type": "module", "attributes": { "name": "@ember/routing/route", @@ -20,7 +20,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -28,7 +28,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/route-info-f7e76b8e3c.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/route-info-e7a8af6cd3.json similarity index 90% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/route-info-f7e76b8e3c.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/route-info-e7a8af6cd3.json index 8ebed0bcf..7de2fb3cf 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/route-info-f7e76b8e3c.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/route-info-e7a8af6cd3.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/routing/route-info", + "id": "ember-4.12.3-@ember/routing/route-info", "type": "module", "attributes": { "name": "@ember/routing/route-info", @@ -20,7 +20,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -28,7 +28,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/router-1a60cd1a33.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/router-b571c7a719.json similarity index 85% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/router-1a60cd1a33.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/router-b571c7a719.json index e9d1afcbe..aa34ba104 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/router-1a60cd1a33.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/router-b571c7a719.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/routing/router", + "id": "ember-4.12.3-@ember/routing/router", "type": "module", "attributes": { "name": "@ember/routing/router", @@ -18,7 +18,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -26,7 +26,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/router-service-2f3cce023f.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/router-service-d0f8b25eae.json similarity index 85% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/router-service-2f3cce023f.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/router-service-d0f8b25eae.json index 15b6bf348..2beaf13ee 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/router-service-2f3cce023f.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/router-service-d0f8b25eae.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/routing/router-service", + "id": "ember-4.12.3-@ember/routing/router-service", "type": "module", "attributes": { "name": "@ember/routing/router-service", @@ -18,7 +18,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -26,7 +26,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/transition-c7f7552260.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/transition-c25f8278c5.json similarity index 89% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/transition-c7f7552260.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/transition-c25f8278c5.json index 3422f7be5..869991471 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/routing/transition-c7f7552260.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/routing/transition-c25f8278c5.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/routing/transition", + "id": "ember-4.12.3-@ember/routing/transition", "type": "module", "attributes": { "name": "@ember/routing/transition", @@ -19,7 +19,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -27,7 +27,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/runloop-e62a37f5ee.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/runloop-9ebea7933c.json similarity index 99% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/runloop-e62a37f5ee.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/runloop-9ebea7933c.json index 4cb372e58..ed2dd786b 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/runloop-e62a37f5ee.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/runloop-9ebea7933c.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/runloop", + "id": "ember-4.12.3-@ember/runloop", "type": "module", "attributes": { "name": "@ember/runloop", @@ -908,7 +908,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -916,7 +916,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/service-7ed5b7958d.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/service-29051f6013.json similarity index 98% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/service-7ed5b7958d.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/service-29051f6013.json index 38a49a523..9f7612e66 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/service-7ed5b7958d.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/service-29051f6013.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/service", + "id": "ember-4.12.3-@ember/service", "type": "module", "attributes": { "name": "@ember/service", @@ -122,7 +122,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -130,7 +130,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/string-ea4ac6dc50.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/string-94fb39470a.json similarity index 89% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/string-ea4ac6dc50.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/string-94fb39470a.json index e3eb01057..d2271ac95 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/string-ea4ac6dc50.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/string-94fb39470a.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/string", + "id": "ember-4.12.3-@ember/string", "type": "module", "attributes": { "name": "@ember/string", @@ -19,7 +19,7 @@ ], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -27,7 +27,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/template-d4ddc419da.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/template-0549980fe7.json similarity index 98% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/template-d4ddc419da.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/template-0549980fe7.json index 5888e5013..f03761d0e 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/template-d4ddc419da.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/template-0549980fe7.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/template", + "id": "ember-4.12.3-@ember/template", "type": "module", "attributes": { "name": "@ember/template", @@ -104,7 +104,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -112,7 +112,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/test-6aaddcc6b9.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/test-617a0faf0e.json similarity index 99% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/test-6aaddcc6b9.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/test-617a0faf0e.json index 8ef2e021b..53e97eca5 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/test-6aaddcc6b9.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/test-617a0faf0e.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/test", + "id": "ember-4.12.3-@ember/test", "type": "module", "attributes": { "name": "@ember/test", @@ -249,7 +249,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -257,7 +257,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/utils-4cbbce5ae6.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/utils-28ac183b1d.json similarity index 99% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/utils-4cbbce5ae6.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/utils-28ac183b1d.json index 1999ac468..287cdd59f 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@ember/utils-4cbbce5ae6.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@ember/utils-28ac183b1d.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@ember/utils", + "id": "ember-4.12.3-@ember/utils", "type": "module", "attributes": { "name": "@ember/utils", @@ -369,7 +369,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -377,7 +377,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/modules/ember-4.12.3-@glimmer/component-771578a395.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@glimmer/component-771578a395.json new file mode 100644 index 000000000..974506451 --- /dev/null +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@glimmer/component-771578a395.json @@ -0,0 +1,36 @@ +{ + "data": { + "id": "ember-4.12.3-@glimmer/component", + "type": "module", + "attributes": { + "name": "@glimmer/component", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts", + "line": 1, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault components for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Template-only and Glimmer components. If you\nare looking for the API documentation for Classic components, it is\navailable here. The source code for\nGlimmer components can be found in @glimmer/component.

\n

Defining a Template-only Component

\n

The simplest way to create a component is to create a template file in\napp/templates/components. For example, if you name a template\napp/templates/components/person-profile.hbs:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
<h1>{{@person.name}}</h1>\n<img src={{@person.avatar}}>\n<p class='signature'>{{@person.signature}}</p>
\n
\n
\n \n

You will be able to use <PersonProfile /> to invoke this component elsewhere\nin your application:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<PersonProfile @person={{this.currentUser}} />
\n
\n
\n \n

Note that component names are capitalized here in order to distinguish them\nfrom regular HTML elements, but they are dasherized in the file system.

\n

While the angle bracket invocation form is generally preferred, it is also\npossible to invoke the same component with the {{person-profile}} syntax:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person-profile person=this.currentUser}}
\n
\n
\n \n

Note that with this syntax, you use dashes in the component name and\narguments are passed without the @ sign.

\n

In both cases, Ember will render the content of the component template we\ncreated above. The end result will be something like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\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 \n

File System Nesting

\n

Components can be nested inside sub-folders for logical groupping. For\nexample, if we placed our template in\napp/templates/components/person/short-profile.hbs, we can invoke it as\n<Person::ShortProfile />:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Person::ShortProfile @person={{this.currentUser}} />
\n
\n
\n \n

Or equivalently, {{person/short-profile}}:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person/short-profile person=this.currentUser}}
\n
\n
\n \n

Using Blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield}}
\n
\n
\n \n

We could then invoke it like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}}>\n  <p>Admin mode</p>\n</PersonProfile>
\n
\n
\n \n

or with curly syntax like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-profile person=this.currentUser}}\n  <p>Admin mode</p>\n{{/person-profile}}
\n
\n
\n \n

And 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

Blocks are executed in their original context, meaning they have access to the\nscope and any in-scope variables where they were defined.

\n

Passing parameters to blocks

\n

You can also pass positional parameters to {{yield}}, which are then made\navailable in the block:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

We can then use this value in the block like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}} as |signature|>\n  {{signature}}\n</PersonProfile>
\n
\n
\n \n

Passing multiple blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield to="title"}}</h1>\n{{yield}}
\n
\n
\n \n

This component could then be invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title>{{this.currentUser.name}}</:title>\n  <:default>{{this.currentUser.signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

When 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

Passing parameters to named blocks

\n

You can also pass parameters to named blocks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield @person.name to="title"}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

These parameters can then be used like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title as |name|>{{name}}</:title>\n  <:default as |signature|>{{signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

Checking to see if a block exists

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\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
\n \n

With this template, we can then optionally pass in one block, both blocks, or\nnone at all:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\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 \n

Checking to see if a block has parameters

\n

We can also check if a block receives parameters using the (has-block-params)\nkeyword, and conditionally yield different values if so.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
{{#if (has-block-params)}}\n  {{yield @person.signature}}\n{{else}}\n  {{yield}}\n{{/if}}
\n
\n
\n \n

Customizing Components With JavaScript

\n

To 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\nPersonProfile component which we defined above, we would create\napp/components/person-profile.js and export our class as the default, like\nso:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n \n

You 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\ndisplayName property of our PersonProfile component instance in the\ntemplate like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

constructor

\n

params: owner object and args object

\n

Constructs 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import 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
\n \n

Service injections and arguments are available in the constructor.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import 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 \n

willDestroy

\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import 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 \n

args

\n

The args property of Glimmer components is an object that contains the\narguments that are passed to the component. For instance, the\nfollowing component usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @fadeIn={{true}} />
\n
\n
\n \n

Would result in the following args object to be passed to the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ fadeIn: true }
\n
\n
\n \n

args can be accessed at any point in the component lifecycle, including\nconstructor and willDestroy. They are also automatically marked as tracked\nproperties, and they can be depended on as computed property dependencies:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import 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 \n

isDestroying

\n

A boolean flag to tell if the component is in the process of destroying. This is set to\ntrue before willDestroy is called.

\n

isDestroyed

\n

A boolean to tell if the component has been fully destroyed. This is set to true\nafter willDestroy is called.

\n", + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "4.12.3" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@glimmer/tracking-5eedc88056.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@glimmer/tracking-fa2e1c51e3.json similarity index 99% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@glimmer/tracking-5eedc88056.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@glimmer/tracking-fa2e1c51e3.json index a1ab689bf..ac3bf1c48 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@glimmer/tracking-5eedc88056.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@glimmer/tracking-fa2e1c51e3.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@glimmer/tracking", + "id": "ember-4.12.3-@glimmer/tracking", "type": "module", "attributes": { "name": "@glimmer/tracking", @@ -75,7 +75,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -83,7 +83,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-@glimmer/tracking/primitives/cache-f7675fd721.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-@glimmer/tracking/primitives/cache-7dcae8144c.json similarity index 98% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-@glimmer/tracking/primitives/cache-f7675fd721.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-@glimmer/tracking/primitives/cache-7dcae8144c.json index fc91f148a..cadba02b7 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-@glimmer/tracking/primitives/cache-f7675fd721.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-@glimmer/tracking/primitives/cache-7dcae8144c.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-@glimmer/tracking/primitives/cache", + "id": "ember-4.12.3-@glimmer/tracking/primitives/cache", "type": "module", "attributes": { "name": "@glimmer/tracking/primitives/cache", @@ -99,7 +99,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -107,7 +107,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-ember-1360ed6169.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-ember-ef16cc3892.json similarity index 94% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-ember-1360ed6169.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-ember-ef16cc3892.json index 6c02bacf7..a9d172088 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-ember-1360ed6169.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-ember-ef16cc3892.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module", "attributes": { "name": "ember", @@ -50,7 +50,7 @@ ], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -58,7 +58,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-ember/routing-d1ae3422cb.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-ember/routing-24e75ed7ed.json similarity index 86% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-ember/routing-d1ae3422cb.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-ember/routing-24e75ed7ed.json index 7c41bf04d..2d0d4dd0f 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-ember/routing-d1ae3422cb.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-ember/routing-24e75ed7ed.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-ember/routing", + "id": "ember-4.12.3-ember/routing", "type": "module", "attributes": { "name": "ember/routing", @@ -18,7 +18,7 @@ "privateclasses": [], "staticfunctions": {}, "allstaticfunctions": {}, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -26,7 +26,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.1/modules/ember-4.12.1-rsvp-00ae08689e.json b/json-docs/ember/4.12.3/modules/ember-4.12.3-rsvp-675afaac7d.json similarity index 99% rename from json-docs/ember/4.12.1/modules/ember-4.12.1-rsvp-00ae08689e.json rename to json-docs/ember/4.12.3/modules/ember-4.12.3-rsvp-675afaac7d.json index b46e928e6..2a2fe497e 100644 --- a/json-docs/ember/4.12.1/modules/ember-4.12.1-rsvp-00ae08689e.json +++ b/json-docs/ember/4.12.3/modules/ember-4.12.3-rsvp-675afaac7d.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-rsvp", + "id": "ember-4.12.3-rsvp", "type": "module", "attributes": { "name": "rsvp", @@ -711,7 +711,7 @@ } ] }, - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { @@ -719,7 +719,7 @@ }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/namespaces/ember-4.12.3-AutoLocation-50f7cb4523.json b/json-docs/ember/4.12.3/namespaces/ember-4.12.3-AutoLocation-50f7cb4523.json new file mode 100644 index 000000000..9dd65eda2 --- /dev/null +++ b/json-docs/ember/4.12.3/namespaces/ember-4.12.3-AutoLocation-50f7cb4523.json @@ -0,0 +1,129 @@ +{ + "data": { + "id": "ember-4.12.3-AutoLocation", + "type": "namespace", + "attributes": { + "name": "AutoLocation", + "shortname": "AutoLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/auto-location", + "namespace": "", + "file": "packages/@ember/routing/auto-location.ts", + "line": 21, + "description": "

AutoLocation will select the best location option based off browser\nsupport with the priority order: history, hash, none.

\n

Clean pushState paths accessed by hashchange-only browsers will be redirected\nto the hash-equivalent and vice versa so future transitions are consistent.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n

Browsers that support the history API will use HistoryLocation, those that\ndo not, but still support the hashchange event will use HashLocation, and\nin the rare case neither is supported will use NoneLocation.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'auto'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new for modern browsers that\nsupport the history api or /#/posts/new for older ones, like Internet\nExplorer 9 and below.

\n

When a user visits a link to your application, they will be automatically\nupgraded or downgraded to the appropriate Location class, with the URL\ntransformed accordingly, if needed.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n", + "static": 1, + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 353, + "access": "private", + "tagname": "Returns the current path as it should appear for HashLocation supported\nbrowsers. This may very well differ from the real current path.", + "itemtype": "method", + "name": "_getHashPath", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 79, + "access": "private", + "tagname": "Will be pre-pended to path upon state change.", + "since": "1.5.1", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + }, + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 91, + "access": "private", + "tagname": "The browser's `location` object. This is typically equivalent to\n`window.location`, but may be overridden for testing.", + "itemtype": "property", + "name": "location", + "default": "environment.location", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + }, + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 103, + "access": "private", + "tagname": "The browser's `history` object. This is typically equivalent to\n`window.history`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "history", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + }, + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 116, + "access": "private", + "tagname": "The user agent's global variable. In browsers, this will be `window`.", + "since": "1.11", + "itemtype": "property", + "name": "global", + "default": "window", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + }, + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 128, + "access": "private", + "tagname": "The browser's `userAgent`. This is typically equivalent to\n`navigator.userAgent`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "userAgent", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + }, + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 141, + "access": "private", + "tagname": "This property is used by the router to know whether to cancel the routing\nsetup process, which is needed while we redirect the browser.", + "since": "1.5.1", + "itemtype": "property", + "name": "cancelRouterSetup", + "default": "false", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/routing/auto-location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/namespaces/ember-4.12.1-FEATURES-0042eb5583.json b/json-docs/ember/4.12.3/namespaces/ember-4.12.3-FEATURES-28cc85d11f.json similarity index 94% rename from json-docs/ember/4.12.1/namespaces/ember-4.12.1-FEATURES-0042eb5583.json rename to json-docs/ember/4.12.3/namespaces/ember-4.12.3-FEATURES-28cc85d11f.json index 975f3e74f..64a2424f9 100644 --- a/json-docs/ember/4.12.1/namespaces/ember-4.12.1-FEATURES-0042eb5583.json +++ b/json-docs/ember/4.12.3/namespaces/ember-4.12.3-FEATURES-28cc85d11f.json @@ -1,6 +1,6 @@ { "data": { - "id": "ember-4.12.1-FEATURES", + "id": "ember-4.12.3-FEATURES", "type": "namespace", "attributes": { "name": "FEATURES", @@ -56,13 +56,13 @@ }, "module": { "data": { - "id": "ember-4.12.1-@ember/canary-features", + "id": "ember-4.12.3-@ember/canary-features", "type": "module" } }, "project-version": { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version" } } diff --git a/json-docs/ember/4.12.3/namespaces/ember-4.12.3-Instrumentation-71b987bb60.json b/json-docs/ember/4.12.3/namespaces/ember-4.12.3-Instrumentation-71b987bb60.json new file mode 100644 index 000000000..77f63466a --- /dev/null +++ b/json-docs/ember/4.12.3/namespaces/ember-4.12.3-Instrumentation-71b987bb60.json @@ -0,0 +1,46 @@ +{ + "data": { + "id": "ember-4.12.3-Instrumentation", + "type": "namespace", + "attributes": { + "name": "Instrumentation", + "shortname": "Instrumentation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/instrumentation", + "namespace": "", + "file": "packages/@ember/instrumentation/index.ts", + "line": 39, + "description": "

The purpose of the Ember Instrumentation module is\nto provide efficient, general-purpose instrumentation\nfor Ember.

\n

Subscribe to a listener by using subscribe:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { subscribe } from '@ember/instrumentation';\n\nsubscribe("render", {\n  before(name, timestamp, payload) {\n\n  },\n\n  after(name, timestamp, payload) {\n\n  }\n});
\n
\n
\n \n

If you return a value from the before callback, that same\nvalue will be passed as a fourth parameter to the after\ncallback.

\n

Instrument a block of code by using instrument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { instrument } from '@ember/instrumentation';\n\ninstrument("render.handlebars", payload, function() {\n  // rendering logic\n}, binding);
\n
\n
\n \n

Event names passed to instrument are namespaced\nby periods, from more general to more specific. Subscribers\ncan listen for events by whatever level of granularity they\nare interested in.

\n

In the above example, the event is render.handlebars,\nand the subscriber listened for all events beginning with\nrender. It would receive callbacks for events named\nrender, render.handlebars, render.container, or\neven render.handlebars.layout.

\n", + "static": 1, + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.12.3-@ember/instrumentation", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.12.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.12.1/project-versions/ember-4.12.1.json b/json-docs/ember/4.12.3/project-versions/ember-4.12.3.json similarity index 53% rename from json-docs/ember/4.12.1/project-versions/ember-4.12.1.json rename to json-docs/ember/4.12.3/project-versions/ember-4.12.3.json index e90439763..7e7c7583f 100644 --- a/json-docs/ember/4.12.1/project-versions/ember-4.12.1.json +++ b/json-docs/ember/4.12.3/project-versions/ember-4.12.3.json @@ -1,327 +1,327 @@ { "data": { - "id": "ember-4.12.1", + "id": "ember-4.12.3", "type": "project-version", "attributes": { - "version": "4.12.1" + "version": "4.12.3" }, "relationships": { "classes": { "data": [ { - "id": "ember-4.12.1-Promise", + "id": "ember-4.12.3-Promise", "type": "class" }, { - "id": "ember-4.12.1-EventTarget", + "id": "ember-4.12.3-EventTarget", "type": "class" }, { - "id": "ember-4.12.1-Container", + "id": "ember-4.12.3-Container", "type": "class" }, { - "id": "ember-4.12.1-Registry", + "id": "ember-4.12.3-Registry", "type": "class" }, { - "id": "ember-4.12.1-EmberENV", + "id": "ember-4.12.3-EmberENV", "type": "class" }, { - "id": "ember-4.12.1-Ember.Templates.helpers", + "id": "ember-4.12.3-Ember.Templates.helpers", "type": "class" }, { - "id": "ember-4.12.1-ComponentStateBucket", + "id": "ember-4.12.3-ComponentStateBucket", "type": "class" }, { - "id": "ember-4.12.1-SafeString", + "id": "ember-4.12.3-SafeString", "type": "class" }, { - "id": "ember-4.12.1-Component", + "id": "ember-4.12.3-Component", "type": "class" }, { - "id": "ember-4.12.1-Helper", + "id": "ember-4.12.3-Helper", "type": "class" }, { - "id": "ember-4.12.1-ComputedProperty", + "id": "ember-4.12.3-ComputedProperty", "type": "class" }, { - "id": "ember-4.12.1-Descriptor", + "id": "ember-4.12.3-Descriptor", "type": "class" }, { - "id": "ember-4.12.1-Ember.InjectedProperty", + "id": "ember-4.12.3-Ember.InjectedProperty", "type": "class" }, { - "id": "ember-4.12.1-Libraries", + "id": "ember-4.12.3-Libraries", "type": "class" }, { - "id": "ember-4.12.1-FullName", + "id": "ember-4.12.3-FullName", "type": "class" }, { - "id": "ember-4.12.1-BasicRegistry", + "id": "ember-4.12.3-BasicRegistry", "type": "class" }, { - "id": "ember-4.12.1-BasicContainer", + "id": "ember-4.12.3-BasicContainer", "type": "class" }, { - "id": "ember-4.12.1-Owner", + "id": "ember-4.12.3-Owner", "type": "class" }, { - "id": "ember-4.12.1-RegisterOptions", + "id": "ember-4.12.3-RegisterOptions", "type": "class" }, { - "id": "ember-4.12.1-Factory", + "id": "ember-4.12.3-Factory", "type": "class" }, { - "id": "ember-4.12.1-FactoryManager", + "id": "ember-4.12.3-FactoryManager", "type": "class" }, { - "id": "ember-4.12.1-Resolver", + "id": "ember-4.12.3-Resolver", "type": "class" }, { - "id": "ember-4.12.1-InternalFactory", + "id": "ember-4.12.3-InternalFactory", "type": "class" }, { - "id": "ember-4.12.1-ContainerProxy", + "id": "ember-4.12.3-ContainerProxy", "type": "class" }, { - "id": "ember-4.12.1-RegistryProxy", + "id": "ember-4.12.3-RegistryProxy", "type": "class" }, { - "id": "ember-4.12.1-Ember.ProxyMixin", + "id": "ember-4.12.3-Ember.ProxyMixin", "type": "class" }, { - "id": "ember-4.12.1-Ember.ActionHandler", + "id": "ember-4.12.3-Ember.ActionHandler", "type": "class" }, { - "id": "ember-4.12.1-Ember.Comparable", + "id": "ember-4.12.3-Ember.Comparable", "type": "class" }, { - "id": "ember-4.12.1-ContainerProxyMixin", + "id": "ember-4.12.3-ContainerProxyMixin", "type": "class" }, { - "id": "ember-4.12.1-RegistryProxyMixin", + "id": "ember-4.12.3-RegistryProxyMixin", "type": "class" }, { - "id": "ember-4.12.1-Ember.TargetActionSupport", + "id": "ember-4.12.3-Ember.TargetActionSupport", "type": "class" }, { - "id": "ember-4.12.1-Ember.String", + "id": "ember-4.12.3-Ember.String", "type": "class" }, { - "id": "ember-4.12.1-Ember.ActionSupport", + "id": "ember-4.12.3-Ember.ActionSupport", "type": "class" }, { - "id": "ember-4.12.1-Ember.ClassNamesSupport", + "id": "ember-4.12.3-Ember.ClassNamesSupport", "type": "class" }, { - "id": "ember-4.12.1-Ember.ViewMixin", + "id": "ember-4.12.3-Ember.ViewMixin", "type": "class" }, { - "id": "ember-4.12.1-Ember.EventDispatcher", + "id": "ember-4.12.3-Ember.EventDispatcher", "type": "class" }, { - "id": "ember-4.12.1-Ember.CoreView", + "id": "ember-4.12.3-Ember.CoreView", "type": "class" }, { - "id": "ember-4.12.1-Application", + "id": "ember-4.12.3-Application", "type": "class" }, { - "id": "ember-4.12.1-ApplicationInstance", + "id": "ember-4.12.3-ApplicationInstance", "type": "class" }, { - "id": "ember-4.12.1-ApplicationInstance.BootOptions", + "id": "ember-4.12.3-ApplicationInstance.BootOptions", "type": "class" }, { - "id": "ember-4.12.1-Namespace", + "id": "ember-4.12.3-Namespace", "type": "class" }, { - "id": "ember-4.12.1-EmberArray", + "id": "ember-4.12.3-EmberArray", "type": "class" }, { - "id": "ember-4.12.1-MutableArray", + "id": "ember-4.12.3-MutableArray", "type": "class" }, { - "id": "ember-4.12.1-Ember.NativeArray", + "id": "ember-4.12.3-Ember.NativeArray", "type": "class" }, { - "id": "ember-4.12.1-ArrayProxy", + "id": "ember-4.12.3-ArrayProxy", "type": "class" }, { - "id": "ember-4.12.1-Ember.ControllerMixin", + "id": "ember-4.12.3-Ember.ControllerMixin", "type": "class" }, { - "id": "ember-4.12.1-Ember.Controller", + "id": "ember-4.12.3-Ember.Controller", "type": "class" }, { - "id": "ember-4.12.1-ContainerDebugAdapter", + "id": "ember-4.12.3-ContainerDebugAdapter", "type": "class" }, { - "id": "ember-4.12.1-DataAdapter", + "id": "ember-4.12.3-DataAdapter", "type": "class" }, { - "id": "ember-4.12.1-Engine", + "id": "ember-4.12.3-Engine", "type": "class" }, { - "id": "ember-4.12.1-EngineInstance", + "id": "ember-4.12.3-EngineInstance", "type": "class" }, { - "id": "ember-4.12.1-Enumerable", + "id": "ember-4.12.3-Enumerable", "type": "class" }, { - "id": "ember-4.12.1-Ember.MutableEnumerable", + "id": "ember-4.12.3-Ember.MutableEnumerable", "type": "class" }, { - "id": "ember-4.12.1-Ember.Error", + "id": "ember-4.12.3-Ember.Error", "type": "class" }, { - "id": "ember-4.12.1-CoreObject", + "id": "ember-4.12.3-CoreObject", "type": "class" }, { - "id": "ember-4.12.1-Evented", + "id": "ember-4.12.3-Evented", "type": "class" }, { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.12.3-EmberObject", "type": "class" }, { - "id": "ember-4.12.1-Mixin", + "id": "ember-4.12.3-Mixin", "type": "class" }, { - "id": "ember-4.12.1-Observable", + "id": "ember-4.12.3-Observable", "type": "class" }, { - "id": "ember-4.12.1-PromiseProxyMixin", + "id": "ember-4.12.3-PromiseProxyMixin", "type": "class" }, { - "id": "ember-4.12.1-ObjectProxy", + "id": "ember-4.12.3-ObjectProxy", "type": "class" }, { - "id": "ember-4.12.1-Renderer", + "id": "ember-4.12.3-Renderer", "type": "class" }, { - "id": "ember-4.12.1-BucketCache", + "id": "ember-4.12.3-BucketCache", "type": "class" }, { - "id": "ember-4.12.1-RoutingService", + "id": "ember-4.12.3-RoutingService", "type": "class" }, { - "id": "ember-4.12.1-HashLocation", + "id": "ember-4.12.3-HashLocation", "type": "class" }, { - "id": "ember-4.12.1-HistoryLocation", + "id": "ember-4.12.3-HistoryLocation", "type": "class" }, { - "id": "ember-4.12.1-Location", + "id": "ember-4.12.3-Location", "type": "class" }, { - "id": "ember-4.12.1-NoneLocation", + "id": "ember-4.12.3-NoneLocation", "type": "class" }, { - "id": "ember-4.12.1-RouteInfo", + "id": "ember-4.12.3-RouteInfo", "type": "class" }, { - "id": "ember-4.12.1-RouteInfoWithAttributes", + "id": "ember-4.12.3-RouteInfoWithAttributes", "type": "class" }, { - "id": "ember-4.12.1-Route", + "id": "ember-4.12.3-Route", "type": "class" }, { - "id": "ember-4.12.1-RouterService", + "id": "ember-4.12.3-RouterService", "type": "class" }, { - "id": "ember-4.12.1-EmberRouter", + "id": "ember-4.12.3-EmberRouter", "type": "class" }, { - "id": "ember-4.12.1-Transition", + "id": "ember-4.12.3-Transition", "type": "class" }, { - "id": "ember-4.12.1-Service", + "id": "ember-4.12.3-Service", "type": "class" }, { - "id": "ember-4.12.1-String", + "id": "ember-4.12.3-String", "type": "class" }, { - "id": "ember-4.12.1-TestAdapter", + "id": "ember-4.12.3-TestAdapter", "type": "class" }, { - "id": "ember-4.12.1-Ember.Test.QUnitAdapter", + "id": "ember-4.12.3-Ember.Test.QUnitAdapter", "type": "class" }, { - "id": "ember-4.12.1-Ember.Test", + "id": "ember-4.12.3-Ember.Test", "type": "class" } ] @@ -329,15 +329,15 @@ "namespaces": { "data": [ { - "id": "ember-4.12.1-FEATURES", + "id": "ember-4.12.3-FEATURES", "type": "namespace" }, { - "id": "ember-4.12.1-Instrumentation", + "id": "ember-4.12.3-Instrumentation", "type": "namespace" }, { - "id": "ember-4.12.1-AutoLocation", + "id": "ember-4.12.3-AutoLocation", "type": "namespace" } ] @@ -345,203 +345,203 @@ "modules": { "data": [ { - "id": "ember-4.12.1-rsvp", + "id": "ember-4.12.3-rsvp", "type": "module" }, { - "id": "ember-4.12.1-@ember/component", + "id": "ember-4.12.3-@ember/component", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing", + "id": "ember-4.12.3-@ember/routing", "type": "module" }, { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" }, { - "id": "ember-4.12.1-@ember/template", + "id": "ember-4.12.3-@ember/template", "type": "module" }, { - "id": "ember-4.12.1-@glimmer/component", + "id": "ember-4.12.3-@glimmer/component", "type": "module" }, { - "id": "ember-4.12.1-@glimmer/tracking", + "id": "ember-4.12.3-@glimmer/tracking", "type": "module" }, { - "id": "ember-4.12.1-@glimmer/tracking/primitives/cache", + "id": "ember-4.12.3-@glimmer/tracking/primitives/cache", "type": "module" }, { - "id": "ember-4.12.1-@ember/object", + "id": "ember-4.12.3-@ember/object", "type": "module" }, { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.12.3-@ember/owner", "type": "module" }, { - "id": "ember-4.12.1-@ember/utils", + "id": "ember-4.12.3-@ember/utils", "type": "module" }, { - "id": "ember-4.12.1-@ember/application", + "id": "ember-4.12.3-@ember/application", "type": "module" }, { - "id": "ember-4.12.1-@ember/application/namespace", + "id": "ember-4.12.3-@ember/application/namespace", "type": "module" }, { - "id": "ember-4.12.1-@ember/array", + "id": "ember-4.12.3-@ember/array", "type": "module" }, { - "id": "ember-4.12.1-@ember/array/proxy", + "id": "ember-4.12.3-@ember/array/proxy", "type": "module" }, { - "id": "ember-4.12.1-@ember/canary-features", + "id": "ember-4.12.3-@ember/canary-features", "type": "module" }, { - "id": "ember-4.12.1-@ember/component/template-only", + "id": "ember-4.12.3-@ember/component/template-only", "type": "module" }, { - "id": "ember-4.12.1-@ember/controller", + "id": "ember-4.12.3-@ember/controller", "type": "module" }, { - "id": "ember-4.12.1-@ember/debug", + "id": "ember-4.12.3-@ember/debug", "type": "module" }, { - "id": "ember-4.12.1-@ember/debug/container-debug-adapter", + "id": "ember-4.12.3-@ember/debug/container-debug-adapter", "type": "module" }, { - "id": "ember-4.12.1-@ember/debug/data-adapter", + "id": "ember-4.12.3-@ember/debug/data-adapter", "type": "module" }, { - "id": "ember-4.12.1-@ember/destroyable", + "id": "ember-4.12.3-@ember/destroyable", "type": "module" }, { - "id": "ember-4.12.1-@ember/engine", + "id": "ember-4.12.3-@ember/engine", "type": "module" }, { - "id": "ember-4.12.1-@ember/enumerable", + "id": "ember-4.12.3-@ember/enumerable", "type": "module" }, { - "id": "ember-4.12.1-@ember/error", + "id": "ember-4.12.3-@ember/error", "type": "module" }, { - "id": "ember-4.12.1-@ember/helper", + "id": "ember-4.12.3-@ember/helper", "type": "module" }, { - "id": "ember-4.12.1-@ember/instrumentation", + "id": "ember-4.12.3-@ember/instrumentation", "type": "module" }, { - "id": "ember-4.12.1-@ember/object/core", + "id": "ember-4.12.3-@ember/object/core", "type": "module" }, { - "id": "ember-4.12.1-@ember/object/evented", + "id": "ember-4.12.3-@ember/object/evented", "type": "module" }, { - "id": "ember-4.12.1-@ember/object/mixin", + "id": "ember-4.12.3-@ember/object/mixin", "type": "module" }, { - "id": "ember-4.12.1-@ember/object/observable", + "id": "ember-4.12.3-@ember/object/observable", "type": "module" }, { - "id": "ember-4.12.1-@ember/object/promise-proxy-mixin", + "id": "ember-4.12.3-@ember/object/promise-proxy-mixin", "type": "module" }, { - "id": "ember-4.12.1-@ember/object/proxy", + "id": "ember-4.12.3-@ember/object/proxy", "type": "module" }, { - "id": "ember-4.12.1-@ember/polyfills", + "id": "ember-4.12.3-@ember/polyfills", "type": "module" }, { - "id": "ember-4.12.1-@ember/renderer", + "id": "ember-4.12.3-@ember/renderer", "type": "module" }, { - "id": "ember-4.12.1-ember/routing", + "id": "ember-4.12.3-ember/routing", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/auto-location", + "id": "ember-4.12.3-@ember/routing/auto-location", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/hash-location", + "id": "ember-4.12.3-@ember/routing/hash-location", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/history-location", + "id": "ember-4.12.3-@ember/routing/history-location", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/location", + "id": "ember-4.12.3-@ember/routing/location", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/none-location", + "id": "ember-4.12.3-@ember/routing/none-location", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/route-info", + "id": "ember-4.12.3-@ember/routing/route-info", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/route", + "id": "ember-4.12.3-@ember/routing/route", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/router-service", + "id": "ember-4.12.3-@ember/routing/router-service", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/router", + "id": "ember-4.12.3-@ember/routing/router", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/transition", + "id": "ember-4.12.3-@ember/routing/transition", "type": "module" }, { - "id": "ember-4.12.1-@ember/runloop", + "id": "ember-4.12.3-@ember/runloop", "type": "module" }, { - "id": "ember-4.12.1-@ember/service", + "id": "ember-4.12.3-@ember/service", "type": "module" }, { - "id": "ember-4.12.1-@ember/string", + "id": "ember-4.12.3-@ember/string", "type": "module" }, { - "id": "ember-4.12.1-@ember/test", + "id": "ember-4.12.3-@ember/test", "type": "module" } ] @@ -555,127 +555,127 @@ "private-classes": { "data": [ { - "id": "ember-4.12.1-Container", + "id": "ember-4.12.3-Container", "type": "class" }, { - "id": "ember-4.12.1-Registry", + "id": "ember-4.12.3-Registry", "type": "class" }, { - "id": "ember-4.12.1-ComponentStateBucket", + "id": "ember-4.12.3-ComponentStateBucket", "type": "class" }, { - "id": "ember-4.12.1-Descriptor", + "id": "ember-4.12.3-Descriptor", "type": "class" }, { - "id": "ember-4.12.1-Ember.InjectedProperty", + "id": "ember-4.12.3-Ember.InjectedProperty", "type": "class" }, { - "id": "ember-4.12.1-Libraries", + "id": "ember-4.12.3-Libraries", "type": "class" }, { - "id": "ember-4.12.1-BasicRegistry", + "id": "ember-4.12.3-BasicRegistry", "type": "class" }, { - "id": "ember-4.12.1-BasicContainer", + "id": "ember-4.12.3-BasicContainer", "type": "class" }, { - "id": "ember-4.12.1-InternalFactory", + "id": "ember-4.12.3-InternalFactory", "type": "class" }, { - "id": "ember-4.12.1-ContainerProxy", + "id": "ember-4.12.3-ContainerProxy", "type": "class" }, { - "id": "ember-4.12.1-RegistryProxy", + "id": "ember-4.12.3-RegistryProxy", "type": "class" }, { - "id": "ember-4.12.1-Ember.ProxyMixin", + "id": "ember-4.12.3-Ember.ProxyMixin", "type": "class" }, { - "id": "ember-4.12.1-Ember.ActionHandler", + "id": "ember-4.12.3-Ember.ActionHandler", "type": "class" }, { - "id": "ember-4.12.1-Ember.Comparable", + "id": "ember-4.12.3-Ember.Comparable", "type": "class" }, { - "id": "ember-4.12.1-ContainerProxyMixin", + "id": "ember-4.12.3-ContainerProxyMixin", "type": "class" }, { - "id": "ember-4.12.1-RegistryProxyMixin", + "id": "ember-4.12.3-RegistryProxyMixin", "type": "class" }, { - "id": "ember-4.12.1-Ember.TargetActionSupport", + "id": "ember-4.12.3-Ember.TargetActionSupport", "type": "class" }, { - "id": "ember-4.12.1-Ember.String", + "id": "ember-4.12.3-Ember.String", "type": "class" }, { - "id": "ember-4.12.1-Ember.ActionSupport", + "id": "ember-4.12.3-Ember.ActionSupport", "type": "class" }, { - "id": "ember-4.12.1-Ember.ClassNamesSupport", + "id": "ember-4.12.3-Ember.ClassNamesSupport", "type": "class" }, { - "id": "ember-4.12.1-Ember.ViewMixin", + "id": "ember-4.12.3-Ember.ViewMixin", "type": "class" }, { - "id": "ember-4.12.1-Ember.EventDispatcher", + "id": "ember-4.12.3-Ember.EventDispatcher", "type": "class" }, { - "id": "ember-4.12.1-Ember.CoreView", + "id": "ember-4.12.3-Ember.CoreView", "type": "class" }, { - "id": "ember-4.12.1-Ember.ControllerMixin", + "id": "ember-4.12.3-Ember.ControllerMixin", "type": "class" }, { - "id": "ember-4.12.1-Enumerable", + "id": "ember-4.12.3-Enumerable", "type": "class" }, { - "id": "ember-4.12.1-Ember.MutableEnumerable", + "id": "ember-4.12.3-Ember.MutableEnumerable", "type": "class" }, { - "id": "ember-4.12.1-Ember.Error", + "id": "ember-4.12.3-Ember.Error", "type": "class" }, { - "id": "ember-4.12.1-BucketCache", + "id": "ember-4.12.3-BucketCache", "type": "class" }, { - "id": "ember-4.12.1-RoutingService", + "id": "ember-4.12.3-RoutingService", "type": "class" }, { - "id": "ember-4.12.1-Location", + "id": "ember-4.12.3-Location", "type": "class" }, { - "id": "ember-4.12.1-String", + "id": "ember-4.12.3-String", "type": "class" } ] @@ -683,195 +683,195 @@ "public-classes": { "data": [ { - "id": "ember-4.12.1-Promise", + "id": "ember-4.12.3-Promise", "type": "class" }, { - "id": "ember-4.12.1-EventTarget", + "id": "ember-4.12.3-EventTarget", "type": "class" }, { - "id": "ember-4.12.1-EmberENV", + "id": "ember-4.12.3-EmberENV", "type": "class" }, { - "id": "ember-4.12.1-Ember.Templates.helpers", + "id": "ember-4.12.3-Ember.Templates.helpers", "type": "class" }, { - "id": "ember-4.12.1-SafeString", + "id": "ember-4.12.3-SafeString", "type": "class" }, { - "id": "ember-4.12.1-Component", + "id": "ember-4.12.3-Component", "type": "class" }, { - "id": "ember-4.12.1-Helper", + "id": "ember-4.12.3-Helper", "type": "class" }, { - "id": "ember-4.12.1-ComputedProperty", + "id": "ember-4.12.3-ComputedProperty", "type": "class" }, { - "id": "ember-4.12.1-FullName", + "id": "ember-4.12.3-FullName", "type": "class" }, { - "id": "ember-4.12.1-Owner", + "id": "ember-4.12.3-Owner", "type": "class" }, { - "id": "ember-4.12.1-RegisterOptions", + "id": "ember-4.12.3-RegisterOptions", "type": "class" }, { - "id": "ember-4.12.1-Factory", + "id": "ember-4.12.3-Factory", "type": "class" }, { - "id": "ember-4.12.1-FactoryManager", + "id": "ember-4.12.3-FactoryManager", "type": "class" }, { - "id": "ember-4.12.1-Resolver", + "id": "ember-4.12.3-Resolver", "type": "class" }, { - "id": "ember-4.12.1-Application", + "id": "ember-4.12.3-Application", "type": "class" }, { - "id": "ember-4.12.1-ApplicationInstance", + "id": "ember-4.12.3-ApplicationInstance", "type": "class" }, { - "id": "ember-4.12.1-ApplicationInstance.BootOptions", + "id": "ember-4.12.3-ApplicationInstance.BootOptions", "type": "class" }, { - "id": "ember-4.12.1-Namespace", + "id": "ember-4.12.3-Namespace", "type": "class" }, { - "id": "ember-4.12.1-EmberArray", + "id": "ember-4.12.3-EmberArray", "type": "class" }, { - "id": "ember-4.12.1-MutableArray", + "id": "ember-4.12.3-MutableArray", "type": "class" }, { - "id": "ember-4.12.1-Ember.NativeArray", + "id": "ember-4.12.3-Ember.NativeArray", "type": "class" }, { - "id": "ember-4.12.1-ArrayProxy", + "id": "ember-4.12.3-ArrayProxy", "type": "class" }, { - "id": "ember-4.12.1-Ember.Controller", + "id": "ember-4.12.3-Ember.Controller", "type": "class" }, { - "id": "ember-4.12.1-ContainerDebugAdapter", + "id": "ember-4.12.3-ContainerDebugAdapter", "type": "class" }, { - "id": "ember-4.12.1-DataAdapter", + "id": "ember-4.12.3-DataAdapter", "type": "class" }, { - "id": "ember-4.12.1-Engine", + "id": "ember-4.12.3-Engine", "type": "class" }, { - "id": "ember-4.12.1-EngineInstance", + "id": "ember-4.12.3-EngineInstance", "type": "class" }, { - "id": "ember-4.12.1-CoreObject", + "id": "ember-4.12.3-CoreObject", "type": "class" }, { - "id": "ember-4.12.1-Evented", + "id": "ember-4.12.3-Evented", "type": "class" }, { - "id": "ember-4.12.1-EmberObject", + "id": "ember-4.12.3-EmberObject", "type": "class" }, { - "id": "ember-4.12.1-Mixin", + "id": "ember-4.12.3-Mixin", "type": "class" }, { - "id": "ember-4.12.1-Observable", + "id": "ember-4.12.3-Observable", "type": "class" }, { - "id": "ember-4.12.1-PromiseProxyMixin", + "id": "ember-4.12.3-PromiseProxyMixin", "type": "class" }, { - "id": "ember-4.12.1-ObjectProxy", + "id": "ember-4.12.3-ObjectProxy", "type": "class" }, { - "id": "ember-4.12.1-Renderer", + "id": "ember-4.12.3-Renderer", "type": "class" }, { - "id": "ember-4.12.1-HashLocation", + "id": "ember-4.12.3-HashLocation", "type": "class" }, { - "id": "ember-4.12.1-HistoryLocation", + "id": "ember-4.12.3-HistoryLocation", "type": "class" }, { - "id": "ember-4.12.1-NoneLocation", + "id": "ember-4.12.3-NoneLocation", "type": "class" }, { - "id": "ember-4.12.1-RouteInfo", + "id": "ember-4.12.3-RouteInfo", "type": "class" }, { - "id": "ember-4.12.1-RouteInfoWithAttributes", + "id": "ember-4.12.3-RouteInfoWithAttributes", "type": "class" }, { - "id": "ember-4.12.1-Route", + "id": "ember-4.12.3-Route", "type": "class" }, { - "id": "ember-4.12.1-RouterService", + "id": "ember-4.12.3-RouterService", "type": "class" }, { - "id": "ember-4.12.1-EmberRouter", + "id": "ember-4.12.3-EmberRouter", "type": "class" }, { - "id": "ember-4.12.1-Transition", + "id": "ember-4.12.3-Transition", "type": "class" }, { - "id": "ember-4.12.1-Service", + "id": "ember-4.12.3-Service", "type": "class" }, { - "id": "ember-4.12.1-TestAdapter", + "id": "ember-4.12.3-TestAdapter", "type": "class" }, { - "id": "ember-4.12.1-Ember.Test.QUnitAdapter", + "id": "ember-4.12.3-Ember.Test.QUnitAdapter", "type": "class" }, { - "id": "ember-4.12.1-Ember.Test", + "id": "ember-4.12.3-Ember.Test", "type": "class" } ] @@ -879,7 +879,7 @@ "private-namespaces": { "data": [ { - "id": "ember-4.12.1-Instrumentation", + "id": "ember-4.12.3-Instrumentation", "type": "namespace" } ] @@ -887,11 +887,11 @@ "public-namespaces": { "data": [ { - "id": "ember-4.12.1-FEATURES", + "id": "ember-4.12.3-FEATURES", "type": "namespace" }, { - "id": "ember-4.12.1-AutoLocation", + "id": "ember-4.12.3-AutoLocation", "type": "namespace" } ] @@ -899,15 +899,15 @@ "private-modules": { "data": [ { - "id": "ember-4.12.1-ember", + "id": "ember-4.12.3-ember", "type": "module" }, { - "id": "ember-4.12.1-@ember/enumerable", + "id": "ember-4.12.3-@ember/enumerable", "type": "module" }, { - "id": "ember-4.12.1-@ember/instrumentation", + "id": "ember-4.12.3-@ember/instrumentation", "type": "module" } ] @@ -915,191 +915,191 @@ "public-modules": { "data": [ { - "id": "ember-4.12.1-rsvp", + "id": "ember-4.12.3-rsvp", "type": "module" }, { - "id": "ember-4.12.1-@ember/component", + "id": "ember-4.12.3-@ember/component", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing", + "id": "ember-4.12.3-@ember/routing", "type": "module" }, { - "id": "ember-4.12.1-@ember/template", + "id": "ember-4.12.3-@ember/template", "type": "module" }, { - "id": "ember-4.12.1-@glimmer/component", + "id": "ember-4.12.3-@glimmer/component", "type": "module" }, { - "id": "ember-4.12.1-@glimmer/tracking", + "id": "ember-4.12.3-@glimmer/tracking", "type": "module" }, { - "id": "ember-4.12.1-@glimmer/tracking/primitives/cache", + "id": "ember-4.12.3-@glimmer/tracking/primitives/cache", "type": "module" }, { - "id": "ember-4.12.1-@ember/object", + "id": "ember-4.12.3-@ember/object", "type": "module" }, { - "id": "ember-4.12.1-@ember/owner", + "id": "ember-4.12.3-@ember/owner", "type": "module" }, { - "id": "ember-4.12.1-@ember/utils", + "id": "ember-4.12.3-@ember/utils", "type": "module" }, { - "id": "ember-4.12.1-@ember/application", + "id": "ember-4.12.3-@ember/application", "type": "module" }, { - "id": "ember-4.12.1-@ember/application/namespace", + "id": "ember-4.12.3-@ember/application/namespace", "type": "module" }, { - "id": "ember-4.12.1-@ember/array", + "id": "ember-4.12.3-@ember/array", "type": "module" }, { - "id": "ember-4.12.1-@ember/array/proxy", + "id": "ember-4.12.3-@ember/array/proxy", "type": "module" }, { - "id": "ember-4.12.1-@ember/canary-features", + "id": "ember-4.12.3-@ember/canary-features", "type": "module" }, { - "id": "ember-4.12.1-@ember/component/template-only", + "id": "ember-4.12.3-@ember/component/template-only", "type": "module" }, { - "id": "ember-4.12.1-@ember/controller", + "id": "ember-4.12.3-@ember/controller", "type": "module" }, { - "id": "ember-4.12.1-@ember/debug", + "id": "ember-4.12.3-@ember/debug", "type": "module" }, { - "id": "ember-4.12.1-@ember/debug/container-debug-adapter", + "id": "ember-4.12.3-@ember/debug/container-debug-adapter", "type": "module" }, { - "id": "ember-4.12.1-@ember/debug/data-adapter", + "id": "ember-4.12.3-@ember/debug/data-adapter", "type": "module" }, { - "id": "ember-4.12.1-@ember/destroyable", + "id": "ember-4.12.3-@ember/destroyable", "type": "module" }, { - "id": "ember-4.12.1-@ember/engine", + "id": "ember-4.12.3-@ember/engine", "type": "module" }, { - "id": "ember-4.12.1-@ember/error", + "id": "ember-4.12.3-@ember/error", "type": "module" }, { - "id": "ember-4.12.1-@ember/helper", + "id": "ember-4.12.3-@ember/helper", "type": "module" }, { - "id": "ember-4.12.1-@ember/object/core", + "id": "ember-4.12.3-@ember/object/core", "type": "module" }, { - "id": "ember-4.12.1-@ember/object/evented", + "id": "ember-4.12.3-@ember/object/evented", "type": "module" }, { - "id": "ember-4.12.1-@ember/object/mixin", + "id": "ember-4.12.3-@ember/object/mixin", "type": "module" }, { - "id": "ember-4.12.1-@ember/object/observable", + "id": "ember-4.12.3-@ember/object/observable", "type": "module" }, { - "id": "ember-4.12.1-@ember/object/promise-proxy-mixin", + "id": "ember-4.12.3-@ember/object/promise-proxy-mixin", "type": "module" }, { - "id": "ember-4.12.1-@ember/object/proxy", + "id": "ember-4.12.3-@ember/object/proxy", "type": "module" }, { - "id": "ember-4.12.1-@ember/polyfills", + "id": "ember-4.12.3-@ember/polyfills", "type": "module" }, { - "id": "ember-4.12.1-@ember/renderer", + "id": "ember-4.12.3-@ember/renderer", "type": "module" }, { - "id": "ember-4.12.1-ember/routing", + "id": "ember-4.12.3-ember/routing", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/auto-location", + "id": "ember-4.12.3-@ember/routing/auto-location", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/hash-location", + "id": "ember-4.12.3-@ember/routing/hash-location", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/history-location", + "id": "ember-4.12.3-@ember/routing/history-location", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/location", + "id": "ember-4.12.3-@ember/routing/location", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/none-location", + "id": "ember-4.12.3-@ember/routing/none-location", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/route-info", + "id": "ember-4.12.3-@ember/routing/route-info", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/route", + "id": "ember-4.12.3-@ember/routing/route", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/router-service", + "id": "ember-4.12.3-@ember/routing/router-service", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/router", + "id": "ember-4.12.3-@ember/routing/router", "type": "module" }, { - "id": "ember-4.12.1-@ember/routing/transition", + "id": "ember-4.12.3-@ember/routing/transition", "type": "module" }, { - "id": "ember-4.12.1-@ember/runloop", + "id": "ember-4.12.3-@ember/runloop", "type": "module" }, { - "id": "ember-4.12.1-@ember/service", + "id": "ember-4.12.3-@ember/service", "type": "module" }, { - "id": "ember-4.12.1-@ember/string", + "id": "ember-4.12.3-@ember/string", "type": "module" }, { - "id": "ember-4.12.1-@ember/test", + "id": "ember-4.12.3-@ember/test", "type": "module" } ] diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/application-f833b8ff5c.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/application-f833b8ff5c.json new file mode 100644 index 000000000..c351b2d0c --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/application-f833b8ff5c.json @@ -0,0 +1,138 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/application", + "type": "class", + "attributes": { + "name": "@ember/application", + "shortname": "@ember/application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 41, + "description": "

Framework objects in an Ember application (components, services, routes, etc.)\nare created via a factory and dependency injection system. Each of these\nobjects is the responsibility of an "owner", which handled its\ninstantiation and manages its lifetime.

\n

getOwner fetches the owner object responsible for an instance. This can\nbe used to lookup or resolve other class instances, or register new factories\ninto the owner.

\n

For example, this component dynamically looks up a service based on the\naudioType passed as an argument:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
audio.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getOwner } from '@ember/application';\n\n// Usage:\n//\n//   <PlayAudio @audioType={{@model.audioType}} @audioFile={{@model.file}}/>\n//\nexport default class extends Component {\n  get audioService() {\n    let owner = getOwner(this);\n    return owner.lookup(`service:${this.args.audioType}`);\n  }\n\n  @action\n  onPlay() {\n    let player = this.audioService;\n    player.play(this.args.audioFile);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "getOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object with an owner.", + "type": "Object" + } + ], + "return": { + "description": "An owner object.", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 89, + "description": "

setOwner forces a new owner on a given object instance. This is primarily\nuseful in some testing cases.

\n", + "itemtype": "method", + "name": "setOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object instance.", + "type": "Object" + }, + { + "name": "object", + "description": "The new owner object of the object instance.", + "type": "Object" + } + ], + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.js", + "line": 14, + "description": "

Detects when a specific package of Ember (e.g. 'Application')\nhas fully loaded and is available for extension.

\n

The provided callback will be called with the name passed\nresolved from a string into the object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { onLoad } from '@ember/application';\n\nonLoad('Ember.Application' function(hbars) {\n  hbars.registerHelper(...);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "onLoad", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "callback", + "description": "callback to be called", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.js", + "line": 47, + "description": "

Called when an Ember.js package (e.g Application) has finished\nloading. Triggers any callbacks registered for this event.

\n", + "itemtype": "method", + "name": "runLoadHooks", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "object", + "description": "object to pass to callbacks", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/component/helper-b74a42f401.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/component/helper-b74a42f401.json new file mode 100644 index 000000000..df8e97569 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/component/helper-b74a42f401.json @@ -0,0 +1,61 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/component/helper", + "type": "class", + "attributes": { + "name": "@ember/component/helper", + "shortname": "@ember/component/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 231, + "description": "

In many cases it is not necessary to use the full Helper class.\nThe helper method create pure-function helpers without instances.\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n
import { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n  return `${currency}${cents * 0.01}`;\n});
\n
\n
\n \n", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/controller-35aba4ebcb.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/controller-35aba4ebcb.json new file mode 100644 index 000000000..3f5a5a88f --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/controller-35aba4ebcb.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/controller", + "type": "class", + "attributes": { + "name": "@ember/controller", + "shortname": "@ember/controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/controller/index.js", + "line": 17, + "description": "

Creates a property that lazily looks up another controller in the container.\nCan only be used when defining another controller.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default class PostController extends Controller {\n  @controller posts;\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default Controller.extend({\n  posts: controller()\n});
\n
\n
\n \n

This example will create a posts property on the post controller that\nlooks up the posts controller in the container, making it easy to reference\nother controllers.

\n", + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the controller to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/controller", + "module": "@ember/controller" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/debug-5151a29715.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/debug-5151a29715.json new file mode 100644 index 000000000..92a0d3663 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/debug-5151a29715.json @@ -0,0 +1,310 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/debug", + "type": "class", + "attributes": { + "name": "@ember/debug", + "shortname": "@ember/debug", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 877, + "description": "

Allows checking if a given property on an object is a computed property. For the most part,\nthis doesn't matter (you would normally just access the property directly and use its value),\nbut for some tooling specific scenarios (e.g. the ember-inspector) it is important to\ndifferentiate if a property is a computed property or a "normal" property.

\n

This will work on either a class's prototype or an instance itself.

\n", + "static": 1, + "itemtype": "method", + "name": "isComputed", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/object" + }, + { + "file": "packages/@ember/debug/lib/capture-render-tree.ts", + "line": 9, + "description": "

Ember Inspector calls this function to capture the current render tree.

\n

In production mode, this requires turning on ENV._DEBUG_RENDER_TREE\nbefore loading Ember.

\n", + "access": "private", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "captureRenderTree", + "params": [ + { + "name": "app", + "description": "An `ApplicationInstance`.", + "type": "ApplicationInstance" + } + ], + "since": "3.14.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 30, + "description": "

Allows for runtime registration of handler functions that override the default deprecation behavior.\nDeprecations are invoked by calls to @ember/debug/deprecate.\nThe following example demonstrates its usage by registering a handler that throws an error if the\nmessage contains the word "should", otherwise defers to the default handler.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { registerDeprecationHandler } from '@ember/debug';\n\nregisterDeprecationHandler((message, options, next) => {\n  if (message.indexOf('should') !== -1) {\n    throw new Error(`Deprecation message with should: ${message}`);\n  } else {\n    // defer to whatever handler was registered before this one\n    next(message, options);\n  }\n});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the deprecation call.
  • \n
  • options - An object passed in with the deprecation call containing additional information including:
  • \n
      \n
    • id - An id of the deprecation in the form of package-name.specific-deprecation.
    • \n
    • until - The Ember version number the feature and deprecation will be removed in.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerDeprecationHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle deprecation calls.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 169, + "description": "

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only).

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n", + "itemtype": "method", + "name": "deprecate", + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "test", + "description": "A boolean. If falsy, the deprecation will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "", + "type": "Object", + "props": [ + { + "name": "id", + "description": "A unique id for this deprecation. The id can be\n used by Ember debugging tools to change the behavior (raise, log or silence)\n for that specific deprecation. The id should be namespaced by dots, e.g.\n \"view.helper.select\".", + "type": "String" + }, + { + "name": "until", + "description": "The version of Ember when this deprecation\n warning will be removed.", + "type": "String" + }, + { + "name": "for", + "description": "A namespace for the deprecation, usually the package name", + "type": "String" + }, + { + "name": "since", + "description": "Describes when the deprecation became available and enabled.", + "type": "Object" + }, + { + "name": "url", + "description": "An optional url to the transition guide on the\n emberjs.com website.", + "type": "String", + "optional": true + } + ] + } + ], + "static": 1, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 23, + "description": "

Allows for runtime registration of handler functions that override the default warning behavior.\nWarnings are invoked by calls made to @ember/debug/warn.\nThe following example demonstrates its usage by registering a handler that does nothing overriding Ember's\ndefault warning behavior.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { registerWarnHandler } from '@ember/debug';\n\n// next is not called, so no warnings get the default behavior\nregisterWarnHandler(() => {});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the warn call.
  • \n
  • options - An object passed in with the warn call containing additional information including:
  • \n
      \n
    • id - An id of the warning in the form of package-name.specific-warning.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWarnHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle warnings.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 70, + "description": "

Display a warning with the provided message.

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { warn } from '@ember/debug';\nimport tomsterCount from './tomster-counter'; // a module in my project\n\n// Log a warning if we have more than 3 tomsters\nwarn('Too many tomsters!', tomsterCount <= 3, {\n  id: 'ember-debug.too-many-tomsters'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "warn", + "static": 1, + "params": [ + { + "name": "message", + "description": "A warning to display.", + "type": "String" + }, + { + "name": "test", + "description": "An optional boolean. If falsy, the warning\n will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "An object that can be used to pass a unique\n `id` for this warning. The `id` can be used by Ember debugging tools\n to change the behavior (raise, log, or silence) for that specific warning.\n The `id` should be namespaced by dots, e.g. \"ember-debug.feature-flag-with-features-stripped\"", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 133, + "description": "

Verify that a certain expectation is met, or throw a exception otherwise.

\n

This is useful for communicating assumptions in the code to other human\nreaders as well as catching bugs that accidentally violates these\nexpectations.

\n

Assertions are removed from production builds, so they can be freely added\nfor documentation and debugging purposes without worries of incuring any\nperformance penalty. However, because of that, they should not be used for\nchecks that could reasonably fail during normal usage. Furthermore, care\nshould be taken to avoid accidentally relying on side-effects produced from\nevaluating the condition itself, since the code will not run in production.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assert } from '@ember/debug';\n\n// Test for truthiness\nassert('Must pass a string', typeof str === 'string');\n\n// Fail unconditionally\nassert('This code path should never be run');
\n
\n
\n \n", + "itemtype": "method", + "name": "assert", + "static": 1, + "params": [ + { + "name": "description", + "description": "Describes the expectation. This will become the\n text of the Error thrown if the assertion fails.", + "type": "String" + }, + { + "name": "condition", + "description": "Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.", + "type": "Any" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 173, + "description": "

Display a debug notice.

\n

Calls to this function are not invoked in production builds.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { debug } from '@ember/debug';\n\ndebug('I\\'m a debug notice!');
\n
\n
\n \n", + "itemtype": "method", + "name": "debug", + "static": 1, + "params": [ + { + "name": "message", + "description": "A debug message to display.", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 200, + "description": "

Display an info notice.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n", + "itemtype": "method", + "name": "info", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 219, + "description": "

Alias an old, deprecated method with its new counterpart.

\n

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only) when the assigned method is called.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { deprecateFunc } from '@ember/debug';\n\nEmber.oldMethod = deprecateFunc('Please use the new, updated method', options, Ember.newMethod);
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecateFunc", + "static": 1, + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "options", + "description": "The options object for `deprecate`.", + "type": "Object", + "optional": true + }, + { + "name": "func", + "description": "The new function called to replace its deprecated counterpart.", + "type": "Function" + } + ], + "return": { + "description": "A new function that wraps the original function with a deprecation warning", + "type": "Function" + }, + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 264, + "description": "

Run a function meant for debugging.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport { runInDebug } from '@ember/debug';\n\nrunInDebug(() => {\n  Component.reopen({\n    didInsertElement() {\n      console.log("I'm happy");\n    }\n  });\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "runInDebug", + "static": 1, + "params": [ + { + "name": "func", + "description": "The function to be executed.", + "type": "Function" + } + ], + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/destroyable-285a2306c6.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/destroyable-285a2306c6.json new file mode 100644 index 000000000..0f912a07a --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/destroyable-285a2306c6.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/destroyable", + "type": "class", + "attributes": { + "name": "@ember/destroyable", + "shortname": "@ember/destroyable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/destroyable", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/destroyable/index.ts", + "line": 31, + "description": "

This function is used to associate a destroyable object with a parent. When the parent\nis destroyed, all registered children will also be destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
class CustomSelect extends Component {\n  constructor(...args) {\n    super(...args);\n\n    // obj is now a child of the component. When the component is destroyed,\n    // obj will also be destroyed, and have all of its destructors triggered.\n    this.obj = associateDestroyableChild(this, {});\n  }\n}
\n
\n
\n \n

Returns the associated child for convenience.

\n", + "itemtype": "method", + "name": "associateDestroyableChild", + "params": [ + { + "name": "parent", + "description": "the destroyable to entangle the child destroyables lifetime with", + "type": "Object|Function" + }, + { + "name": "child", + "description": "the destroyable to be entangled with the parents lifetime", + "type": "Object|Function" + } + ], + "return": { + "description": "the child argument", + "type": "Object|Function" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 58, + "description": "

Receives a destroyable, and returns true if the destroyable has begun destroying. Otherwise returns\nfalse.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let obj = {};\nisDestroying(obj); // false\ndestroy(obj);\nisDestroying(obj); // true\n// ...sometime later, after scheduled destruction\nisDestroyed(obj); // true\nisDestroying(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroying", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 80, + "description": "

Receives a destroyable, and returns true if the destroyable has finished destroying. Otherwise\nreturns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let obj = {};\n\nisDestroyed(obj); // false\ndestroy(obj);\n\n// ...sometime later, after scheduled destruction\n\nisDestroyed(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroyed", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 103, + "description": "

Initiates the destruction of a destroyable object. It runs all associated destructors, and then\ndestroys all children recursively.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let obj = {};\n\nregisterDestructor(obj, () => console.log('destroyed!'));\n\ndestroy(obj); // this will schedule the destructor to be called\n\n// ...some time later, during scheduled destruction\n\n// destroyed!
\n
\n
\n \n

Destruction via destroy() follows these steps:

\n

1, Mark the destroyable such that isDestroying(destroyable) returns true\n2, Call destroy() on each of the destroyable's associated children\n3, Schedule calling the destroyable's destructors\n4, Schedule setting destroyable such that isDestroyed(destroyable) returns true

\n

This results in the entire tree of destroyables being first marked as destroying,\nthen having all of their destructors called, and finally all being marked as isDestroyed.\nThere won't be any in between states where some items are marked as isDestroying while\ndestroying, while others are not.

\n", + "itemtype": "method", + "name": "destroy", + "params": [ + { + "name": "destroyable", + "description": "the object to destroy", + "type": "Object|Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 138, + "description": "

This function asserts that all objects which have associated destructors or associated children\nhave been destroyed at the time it is called. It is meant to be a low level hook that testing\nframeworks can use to hook into and validate that all destroyables have in fact been destroyed.

\n

This function requires that enableDestroyableTracking was called previously, and is only\navailable in non-production builds.

\n", + "itemtype": "method", + "name": "assertDestroyablesDestroyed", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 152, + "description": "

This function instructs the destroyable system to keep track of all destroyables (their\nchildren, destructors, etc). This enables a future usage of assertDestroyablesDestroyed\nto be used to ensure that all destroyable tasks (registered destructors and associated children)\nhave completed when assertDestroyablesDestroyed is called.

\n", + "itemtype": "method", + "name": "enableDestroyableTracking", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 164, + "description": "

Receives a destroyable object and a destructor function, and associates the\nfunction with it. When the destroyable is destroyed with destroy, or when its\nparent is destroyed, the destructor function will be called.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, () => this.resize.unregister(this));\n  }\n}
\n
\n
\n \n

Multiple destructors can be associated with a given destroyable, and they can be\nassociated over time, allowing libraries to dynamically add destructors as needed.\nregisterDestructor also returns the associated destructor function, for convenience.

\n

The destructor function is passed a single argument, which is the destroyable itself.\nThis allows the function to be reused multiple times for many destroyables, rather\nthan creating a closure function per destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nfunction unregisterResize(instance) {\n  instance.resize.unregister(instance);\n}\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, unregisterResize);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "registerDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to register the destructor function with", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to run when the destroyable object is destroyed", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 229, + "description": "

Receives a destroyable and a destructor function, and de-associates the destructor\nfrom the destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor, unregisterDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service modals;\n\n  constructor(...args) {\n    super(...args);\n\n    this.modals.add(this);\n\n    this.modalDestructor = registerDestructor(this, () => this.modals.remove(this));\n  }\n\n  @action pinModal() {\n    unregisterDestructor(this, this.modalDestructor);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "unregisterDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to unregister the destructor function from", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to remove from the destroyable", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/destroyable", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/helper-833098b4a6.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/helper-833098b4a6.json new file mode 100644 index 000000000..914832531 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/helper-833098b4a6.json @@ -0,0 +1,128 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/helper", + "type": "class", + "attributes": { + "name": "@ember/helper", + "shortname": "@ember/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/helper", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/helper/index.ts", + "line": 5, + "description": "

capabilities returns a capabilities configuration which can be used to modify\nthe behavior of the manager. Manager capabilities must be provided using the\ncapabilities function, as the underlying implementation can change over time.

\n

The first argument to capabilities is a version string, which is the version of\nEmber that the capabilities were defined in. Ember can add new versions at any\ntime, and these may have entirely different behaviors, but it will not remove\nold versions until the next major version.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
capabilities('3.23');
\n
\n
\n \n

The second argument is an object of capabilities and boolean values indicating\nwhether they are enabled or disabled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
capabilities('3.23', {\n  hasValue: true,\n  hasDestructor: true,\n});
\n
\n
\n \n

If no value is specified, then the default value will be used.

\n

3.23 capabilities

\n

hasDestroyable

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a destroyable to include in the destructor\nhierarchy. If enabled, the getDestroyable hook will be called, and its result\nwill be associated with the destroyable parent block.

\n

hasValue

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a value which can be used externally. The helper's\ngetValue hook will be run whenever the value of the helper is accessed if this\ncapability is enabled.

\n", + "itemtype": "method", + "name": "capabilities", + "static": 1, + "params": [ + { + "name": "managerApiVersion", + "description": "The version of capabilities that are being used", + "type": "String" + }, + { + "name": "options", + "description": "The capabilities values" + } + ], + "return": { + "description": "The capabilities object instance", + "type": "Capabilities" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 58, + "description": "

Sets the helper manager for an object or function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
setHelperManager((owner) => new ClassHelperManager(owner), Helper)
\n
\n
\n \n

When a value is used as a helper in a template, the helper manager is looked up\non the object by walking up its prototype chain and finding the first helper\nmanager. This manager then receives the value and can create and manage an\ninstance of a helper from it. This provides a layer of indirection that allows\nusers to design high-level helper APIs, without Ember needing to worry about the\ndetails. High-level APIs can be experimented with and iterated on while the\ncore of Ember helpers remains stable, and new APIs can be introduced gradually\nover time to existing code bases.

\n

setHelperManager receives two arguments:

\n
    \n
  1. A factory function, which receives the owner and returns an instance of a\n helper manager.
  2. \n
  3. A helper definition, which is the object or function to associate the factory function with.
  4. \n
\n

The first time the object is looked up, the factory function will be called to\ncreate the helper manager. It will be cached, and in subsequent lookups the\ncached helper manager will be used instead.

\n

Only one helper manager is guaranteed to exist per owner and per usage of\nsetHelperManager, so many helpers will end up using the same instance of the\nhelper manager. As such, you should only store state that is related to the\nmanager itself. If you want to store state specific to a particular helper\ndefinition, you should assign a unique helper manager to that helper. In\ngeneral, most managers should either be stateless, or only have the owner they\nwere created with as state.

\n

Helper managers must fulfill the following interface (This example uses\nTypeScript interfaces\nfor precision, you do not need to write helper managers using TypeScript):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
interface HelperManager<HelperStateBucket> {\n  capabilities: HelperCapabilities;\n\n  createHelper(definition: HelperDefinition, args: TemplateArgs): HelperStateBucket;\n\n  getValue?(bucket: HelperStateBucket): unknown;\n\n  runEffect?(bucket: HelperStateBucket): void;\n\n  getDestroyable?(bucket: HelperStateBucket): object;\n}
\n
\n
\n \n

The capabilities property must be provided using the capabilities() function\nimported from the same module as setHelperManager:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capabilities } from '@ember/helper';\n\nclass MyHelperManager {\n  capabilities = capabilities('3.21.0', { hasValue: true });\n\n  // ...snip...\n}
\n
\n
\n \n

Below is a description of each of the methods on the interface and their\nfunctions.

\n

createHelper

\n

createHelper is a required hook on the HelperManager interface. The hook is\npassed the definition of the helper that is currently being created, and is\nexpected to return a state bucket. This state bucket is what represents the\ncurrent state of the helper, and will be passed to the other lifecycle hooks at\nappropriate times. It is not necessarily related to the definition of the\nhelper itself - for instance, you could return an object containing an\ninstance of the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
class MyManager {\n  createHelper(Definition, args) {\n    return {\n      instance: new Definition(args);\n    };\n  }\n}
\n
\n
\n \n

This allows the manager to store metadata that it doesn't want to expose to the\nuser.

\n

This hook is not autotracked - changes to tracked values used within this hook\nwill not result in a call to any of the other lifecycle hooks. This is because\nit is unclear what should happen if it invalidates, and rather than make a\ndecision at this point, the initial API is aiming to allow as much expressivity\nas possible. This could change in the future with changes to capabilities and\ntheir behaviors.

\n

If users do want to autotrack some values used during construction, they can\neither create the instance of the helper in runEffect or getValue, or they\ncan use the cache API to autotrack the createHelper hook themselves. This\nprovides maximum flexibility and expressiveness to manager authors.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called as discovered during DOM construction
  • \n
  • called in definition order in the template
  • \n
\n

getValue

\n

getValue is an optional hook that should return the value of the helper. This\nis the value that is returned from the helper and passed into the template.

\n

This hook is called when the value is requested from the helper (e.g. when the\ntemplate is rendering and the helper value is needed). The hook is autotracked,\nand will rerun whenever any tracked values used inside of it are updated.\nOtherwise it does not rerun.

\n
\n

Note: This means that arguments which are not consumed within the hook will\nnot trigger updates.

\n
\n

This hook is only called for helpers with the hasValue capability enabled.\nThis hook has the following timing semantics:

\n

Always

\n
    \n
  • called the first time the helper value is requested
  • \n
  • called after autotracked state has changed
  • \n
\n

Never

\n
    \n
  • called if the hasValue capability is disabled
  • \n
\n

runEffect

\n

runEffect is an optional hook that should run the effect that the helper is\napplying, setting it up or updating it.

\n

This hook is scheduled to be called some time after render and prior to paint.\nThere is not a guaranteed, 1-to-1 relationship between a render pass and this\nhook firing. For instance, multiple render passes could occur, and the hook may\nonly trigger once. It may also never trigger if it was dirtied in one render\npass and then destroyed in the next.

\n

The hook is autotracked, and will rerun whenever any tracked values used inside\nof it are updated. Otherwise it does not rerun.

\n

The hook is also run during a time period where state mutations are disabled\nin Ember. Any tracked state mutation will throw an error during this time,\nincluding changes to tracked properties, changes made using Ember.set, updates\nto computed properties, etc. This is meant to prevent infinite rerenders and\nother antipatterns.

\n

This hook is only called for helpers with the hasScheduledEffect capability\nenabled. This hook is also not called in SSR currently, though this could be\nadded as a capability in the future. It has the following timing semantics:

\n

Always

\n
    \n
  • called after the helper was first created, if the helper has not been\ndestroyed since creation
  • \n
  • called after autotracked state has changed, if the helper has not been\ndestroyed during render
  • \n
\n

Never

\n
    \n
  • called if the hasScheduledEffect capability is disabled
  • \n
  • called in SSR
  • \n
\n

getDestroyable

\n

getDestroyable is an optional hook that users can use to register a\ndestroyable object for the helper. This destroyable will be registered to the\ncontaining block or template parent, and will be destroyed when it is destroyed.\nSee the Destroyables RFC\nfor more details.

\n

getDestroyable is only called if the hasDestroyable capability is enabled.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called immediately after the createHelper hook is called
  • \n
\n

Never

\n
    \n
  • called if the hasDestroyable capability is disabled
  • \n
\n", + "itemtype": "method", + "name": "setHelperManager", + "static": 1, + "params": [ + { + "name": "factory", + "description": "A factory function which receives an optional owner, and returns a helper manager", + "type": "Function" + }, + { + "name": "definition", + "description": "The definition to associate the manager factory with", + "type": "Object" + } + ], + "return": { + "description": "The definition passed into setHelperManager", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 251, + "description": "

The invokeHelper function can be used to create a helper instance in\nJavaScript.

\n

To access a helper's value you have to use getValue from\n@glimmer/tracking/primitives/cache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
// app/components/data-loader.js\nimport Component from '@glimmer/component';\nimport { getValue } from '@glimmer/tracking/primitives/cache';\nimport Helper from '@ember/component/helper';\nimport { invokeHelper } from '@ember/helper';\n\nclass PlusOne extends Helper {\n  compute([number]) {\n    return number + 1;\n  }\n}\n\nexport default class PlusOneComponent extends Component {\n  plusOne = invokeHelper(this, PlusOne, () => {\n    return {\n      positional: [this.args.number],\n    };\n  });\n\n  get value() {\n    return getValue(this.plusOne);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{this.value}}
\n
\n
\n \n

It receives three arguments:

\n
    \n
  • context: The parent context of the helper. When the parent is torn down and\nremoved, the helper will be as well.
  • \n
  • definition: The definition of the helper.
  • \n
  • computeArgs: An optional function that produces the arguments to the helper.\nThe function receives the parent context as an argument, and must return an\nobject with a positional property that is an array and/or a named\nproperty that is an object.
  • \n
\n

And it returns a Cache instance that contains the most recent value of the\nhelper. You can access the helper using getValue() like any other cache. The\ncache is also destroyable, and using the destroy() function on it will cause\nthe helper to be torn down.

\n

Note that using getValue() on helpers that have scheduled effects will not\ntrigger the effect early. Effects will continue to run at their scheduled time.

\n", + "itemtype": "method", + "name": "invokeHelper", + "static": 1, + "params": [ + { + "name": "context", + "description": "The parent context of the helper", + "type": "Object" + }, + { + "name": "definition", + "description": "The helper definition", + "type": "Object" + }, + { + "name": "computeArgs", + "description": "An optional function that produces args", + "type": "Function" + } + ], + "return": { + "description": "" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/helper", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/object-580812e3d7.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/object-580812e3d7.json new file mode 100644 index 000000000..3293293c2 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/object-580812e3d7.json @@ -0,0 +1,521 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/object", + "type": "class", + "attributes": { + "name": "@ember/object", + "shortname": "@ember/object", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 702, + "description": "

This helper returns a new property descriptor that wraps the passed\ncomputed property function. You can use this helper to define properties with\nnative decorator syntax, mixins, or via defineProperty().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', function() {\n    return `${this.get('firstName')} ${this.get('lastName')}`;\n  })\n});\n\nlet client = Person.create();\n\nclient.get('fullName'); // 'Betty Jones'\n\nclient.set('lastName', 'Fuller');\nclient.get('fullName'); // 'Betty Fuller'
\n
\n
\n \n

You can also provide a setter, either directly on the class using native class\nsyntax, or by passing a hash with get and set functions.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(/\\s+/);\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n\n    return value;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', {\n    get(key) {\n      return `${this.get('firstName')} ${this.get('lastName')}`;\n    },\n    set(key, value) {\n      let [firstName, lastName] = value.split(/\\s+/);\n      this.setProperties({ firstName, lastName });\n      return value;\n    }\n  })\n});\n\nlet client = Person.create();\nclient.get('firstName'); // 'Betty'\n\nclient.set('fullName', 'Carroll Fuller');\nclient.get('firstName'); // 'Carroll'
\n
\n
\n \n

When passed as an argument, the set function should accept two parameters,\nkey and value. The value returned from set will be the new value of the\nproperty.

\n

Note: This is the preferred way to define computed properties when writing third-party\nlibraries that depend on or use Ember, since there is no guarantee that the user\nwill have prototype Extensions enabled.

\n", + "itemtype": "method", + "name": "computed", + "static": 1, + "params": [ + { + "name": "dependentKeys*", + "description": "Optional dependent keys that trigger this computed property.", + "type": "String", + "optional": true + }, + { + "name": "func", + "description": "The computed property function.", + "type": "Function" + } + ], + "return": { + "description": "property decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/get_properties.ts", + "line": 6, + "description": "

To get multiple properties at once, call getProperties\nwith an object followed by a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, 'firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, ['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + }, + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 749, + "description": "

Specify a method that observes property changes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nimport { observer } from '@ember/object';\n\nexport default EmberObject.extend({\n  valueObserver: observer('value', function() {\n    // Executes whenever the "value" property changes\n  })\n});
\n
\n
\n \n

Also available as Function.prototype.observes if prototype extensions are\nenabled.

\n", + "itemtype": "method", + "name": "observer", + "params": [ + { + "name": "propertyNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "func" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/properties.ts", + "line": 11, + "description": "

NOTE: This is a low-level method used by other parts of the API. You almost\nnever want to call this method directly. Instead you should use\nmixin() to define new properties.

\n

Defines a property on an object. This method works much like the ES5\nObject.defineProperty() method except that it can also accept computed\nproperties and other special descriptors.

\n

Normally this method takes only three parameters. However if you pass an\ninstance of Descriptor as the third param then you can pass an\noptional value as the fourth parameter. This is often more efficient than\ncreating new descriptor hashes for each property.

\n

Examples

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { defineProperty, computed } from '@ember/object';\n\n// ES5 compatible mode\ndefineProperty(contact, 'firstName', {\n  writable: true,\n  configurable: false,\n  enumerable: true,\n  value: 'Charles'\n});\n\n// define a simple property\ndefineProperty(contact, 'lastName', undefined, 'Jolley');\n\n// define a computed property\ndefineProperty(contact, 'fullName', computed('firstName', 'lastName', function() {\n  return this.firstName+' '+this.lastName;\n}));
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "defineProperty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "the object to define this property on. This may be a prototype.", + "type": "Object" + }, + { + "name": "keyName", + "description": "the name of the property", + "type": "String" + }, + { + "name": "desc", + "description": "an instance of `Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.", + "type": "Descriptor", + "optional": true + }, + { + "name": "data", + "description": "something other than a descriptor, that will\n become the explicit value of this property.", + "type": "*", + "optional": true + } + ], + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 19, + "description": "

This function is called just after an object property has changed.\nIt will notify any observers and clear caches among other things.

\n

Normally you will not need to call this method directly but if for some\nreason you can't directly watch a property you can invoke this method\nmanually.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "obj", + "description": "The object with the property that will change", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key (or path) that will change.", + "type": "String" + }, + { + "name": "_meta", + "description": "The objects meta.", + "type": "Meta", + "optional": true + }, + { + "name": "value", + "description": "The new value to set for the property", + "type": "Unknown", + "optional": true + } + ], + "return": { + "description": "", + "type": "Void" + }, + "since": "3.1.0", + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 67, + "itemtype": "method", + "name": "beginPropertyChanges", + "chainable": 1, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 77, + "itemtype": "method", + "name": "endPropertyChanges", + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 89, + "description": "

Make a series of property changes together in an\nexception-safe way.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
Ember.changeProperties(function() {\n  obj1.set('foo', mayBlowUpWhenSet);\n  obj2.set('bar', baz);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "changeProperties", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_get.ts", + "line": 41, + "description": "

Gets the value of a property on an object. If the property is computed,\nthe function will be invoked. If the property is not defined but the\nobject implements the unknownProperty method then that will be invoked.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { get } from '@ember/object';\nget(obj, "name");
\n
\n
\n \n

If you plan to run on IE8 and older browsers then you should use this\nmethod anytime you want to retrieve a property on an object that you don't\nknow for sure is private. (Properties beginning with an underscore '_'\nare considered private.)

\n

On all newer browsers, you only need to use this method to retrieve\nproperties if the property might not be defined on the object and you want\nto respect the unknownProperty handler. Otherwise you can ignore this\nmethod.

\n

Note that if the object itself is undefined, this method will throw\nan error.

\n", + "itemtype": "method", + "name": "get", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to retrieve from.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to retrieve", + "type": "String" + } + ], + "return": { + "description": "the property value or `null`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 18, + "description": "

Sets the value of a property on an object, respecting computed properties\nand notifying observers and other listeners of the change.\nIf the specified property is not defined on the object and the object\nimplements the setUnknownProperty method, then instead of setting the\nvalue of the property on the object, its setUnknownProperty handler\nwill be invoked with the two parameters keyName and value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { set } from '@ember/object';\nset(obj, "name", value);
\n
\n
\n \n", + "itemtype": "method", + "name": "set", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "return": { + "description": "the passed value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 124, + "description": "

Error-tolerant form of set. Will not blow up if any part of the\nchain is undefined, null, or destroyed.

\n

This is primarily used when syncing bindings, which may try to update after\nan object has been destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { trySet } from '@ember/object';\n\nlet obj = { name: "Zoey" };\ntrySet(obj, "contacts.twitter", "@emberjs");
\n
\n
\n \n", + "itemtype": "method", + "name": "trySet", + "static": 1, + "params": [ + { + "name": "root", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "path", + "description": "The property path to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/set_properties.ts", + "line": 6, + "description": "

Set a list of properties on an object. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nlet anObject = EmberObject.create();\n\nanObject.setProperties({\n  firstName: 'Stanley',\n  lastName: 'Stuart',\n  age: 21\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "properties", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "properties" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 575, + "description": "

Creates a new subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(thing);\n   }\n});
\n
\n
\n \n

This defines a new subclass of EmberObject: Person. It contains one method: say().

\n

You can also create a subclass from any existing class by calling its extend() method.\nFor example, you might want to create a subclass of Ember's built-in Component class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nconst PersonComponent = Component.extend({\n  tagName: 'li',\n  classNameBindings: ['isAdministrator']\n});
\n
\n
\n \n

When defining a subclass, you can override methods but still access the\nimplementation of your parent class by calling the special _super() method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    let name = this.get('name');\n    alert(`${name} says: ${thing}`);\n  }\n});\n\nconst Soldier = Person.extend({\n  say(thing) {\n    this._super(`${thing}, sir!`);\n  },\n  march(numberOfHours) {\n    alert(`${this.get('name')} marches for ${numberOfHours} hours.`);\n  }\n});\n\nlet yehuda = Soldier.create({\n  name: 'Yehuda Katz'\n});\n\nyehuda.say('Yes');  // alerts "Yehuda Katz says: Yes, sir!"
\n
\n
\n \n

The create() on line #17 creates an instance of the Soldier class.\nThe extend() on line #8 creates a subclass of Person. Any instance\nof the Person class will not have the march() method.

\n

You can also pass Mixin classes to add additional properties to the subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import EmberObject from '@ember/object';\nimport Mixin from '@ember/object/mixin';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(`${this.get('name')} says: ${thing}`);\n  }\n});\n\nconst SingingMixin = Mixin.create({\n  sing(thing) {\n    alert(`${this.get('name')} sings: la la la ${thing}`);\n  }\n});\n\nconst BroadwayStar = Person.extend(SingingMixin, {\n  dance() {\n    alert(`${this.get('name')} dances: tap tap tap tap `);\n  }\n});
\n
\n
\n \n

The BroadwayStar class contains three methods: say(), sing(), and dance().

\n", + "itemtype": "method", + "name": "extend", + "static": 1, + "params": [ + { + "name": "mixins", + "description": "One or more Mixin classes", + "type": "Mixin", + "optional": true, + "multiple": true + }, + { + "name": "arguments", + "description": "Object containing values to use within the new class", + "type": "Object", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 675, + "description": "

Creates an instance of a class. Accepts either no arguments, or an object\ncontaining values to initialize the newly instantiated object with.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  helloWorld() {\n    alert(`Hi, my name is ${this.get('name')}`);\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\n\ntom.helloWorld(); // alerts "Hi, my name is Tom Dale".
\n
\n
\n \n

create will call the init function if defined during\nAnyObject.extend

\n

If no arguments are passed to create, it will not set values to the new\ninstance during initialization:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let noName = Person.create();\nnoName.helloWorld(); // alerts undefined
\n
\n
\n \n

NOTE: For performance reasons, you cannot declare methods or computed\nproperties during create. You should instead declare methods and computed\nproperties when using extend.

\n", + "itemtype": "method", + "name": "create", + "static": 1, + "params": [ + { + "name": "arguments", + "description": "", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 735, + "description": "

Augments a constructor's prototype with additional\nproperties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\no = MyObject.create();\no.get('name'); // 'an object'\n\nMyObject.reopen({\n  say(msg) {\n    console.log(msg);\n  }\n});\n\no2 = MyObject.create();\no2.say('hello'); // logs "hello"\n\no.say('goodbye'); // logs "goodbye"
\n
\n
\n \n

To add functions and properties to the constructor itself,\nsee reopenClass

\n", + "itemtype": "method", + "name": "reopen", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 789, + "description": "

Augments a constructor's own properties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\nMyObject.reopenClass({\n  canBuild: false\n});\n\nMyObject.canBuild; // false\no = MyObject.create();
\n
\n
\n \n

In other words, this creates static properties and functions for the class.\nThese are only available on the class and not on any instance of that class.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  name: '',\n  sayHello() {\n    alert(`Hello. My name is ${this.get('name')}`);\n  }\n});\n\nPerson.reopenClass({\n  species: 'Homo sapiens',\n\n  createPerson(name) {\n    return Person.create({ name });\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\nlet yehuda = Person.createPerson('Yehuda Katz');\n\ntom.sayHello(); // "Hello. My name is Tom Dale"\nyehuda.sayHello(); // "Hello. My name is Yehuda Katz"\nalert(Person.species); // "Homo sapiens"
\n
\n
\n \n

Note that species and createPerson are not valid on the tom and yehuda\nvariables. They are only valid on Person.

\n

To add functions and properties to instances of\na constructor by extending the constructor's prototype\nsee reopen

\n", + "itemtype": "method", + "name": "reopenClass", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 872, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For\nexample, computed property functions may close over variables that are then\nno longer available for introspection.

\n

You can pass a hash of these values to a computed property like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { computed } from '@ember/object';\n\nperson: computed(function() {\n  let personId = this.get('personId');\n  return Person.create({ id: personId });\n}).meta({ type: Person })
\n
\n
\n \n

Once you've done this, you can retrieve the values saved to the computed\nproperty from your class like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyClass.metaForProperty('person');
\n
\n
\n \n

This will return the original hash that was passed to meta().

\n", + "static": 1, + "itemtype": "method", + "name": "metaForProperty", + "params": [ + { + "name": "key", + "description": "property name", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 915, + "description": "

Iterate over each computed property for the class, passing its name\nand any associated metadata (see metaForProperty) to the callback.

\n", + "static": 1, + "itemtype": "method", + "name": "eachComputedProperty", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "binding", + "description": "", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 1025, + "description": "

Provides lookup-time type validation for injected properties.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_onLookup", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 1046, + "description": "

Returns a hash of property names and container names that injected\nproperties will lookup on the container lazily.

\n", + "itemtype": "method", + "name": "_lazyInjections", + "return": { + "description": "Hash of all lazy injected property keys to container names", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/index.js", + "line": 18, + "description": "

Decorator that turns the target function into an Action which can be accessed\ndirectly by reference.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action this.toggleShowing}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

Decorated actions also interop with the string style template actions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action "toggleShowing"}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

It also binds the function directly to the instance, so it can be used in any\ncontext and will correctly refer to the class it came from:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert this.toggleShowing}}\n  {{on "click" this.toggleShowing}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

This can also be used in JavaScript code directly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  constructor() {\n    super(...arguments);\n\n    // this.toggleShowing is still bound correctly when added to\n    // the event listener\n    document.addEventListener('click', this.toggleShowing);\n  }\n\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n

This is considered best practice, since it means that methods will be bound\ncorrectly no matter where they are used. By contrast, the {{action}} helper\nand modifier can also be used to bind context, but it will be required for\nevery usage of the method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert (action this.toggleShowing)}}\n  {{on "click" (action this.toggleShowing)}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

They also do not have equivalents in JavaScript directly, so they cannot be\nused for other situations where binding would be useful.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "action", + "static": 1, + "params": [ + { + "name": "callback", + "description": "The function to turn into an action,\n when used in classic classes", + "type": "Function|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/object/compat-f4cae836ef.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/object/compat-f4cae836ef.json new file mode 100644 index 000000000..138718370 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/object/compat-f4cae836ef.json @@ -0,0 +1,64 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/object/compat", + "type": "class", + "attributes": { + "name": "@ember/object/compat", + "shortname": "@ember/object/compat", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/object/compat.ts", + "line": 39, + "description": "

@dependentKeyCompat is decorator that can be used on native getters that\nuse tracked properties. It exposes the getter to Ember's classic computed\nproperty and observer systems, so they can watch it for changes. It can be\nused in both native and classic classes.

\n

Native Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { computed, set } from '@ember/object';\n\nclass Person {\n  @tracked firstName;\n  @tracked lastName;\n\n  @dependentKeyCompat\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nclass Profile {\n  constructor(person) {\n    set(this, 'person', person);\n  }\n\n  @computed('person.fullName')\n  get helloMessage() {\n    return `Hello, ${this.person.fullName}!`;\n  }\n}
\n
\n
\n \n

Classic Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport EmberObject, { computed, observer, set } from '@ember/object';\n\nconst Person = EmberObject.extend({\n  firstName: tracked(),\n  lastName: tracked(),\n\n  fullName: dependentKeyCompat(function() {\n    return `${this.firstName} ${this.lastName}`;\n  }),\n});\n\nconst Profile = EmberObject.extend({\n  person: null,\n\n  helloMessage: computed('person.fullName', function() {\n    return `Hello, ${this.person.fullName}!`;\n  }),\n\n  onNameUpdated: observer('person.fullName', function() {\n    console.log('person name updated!');\n  }),\n});
\n
\n
\n \n

dependentKeyCompat() can receive a getter function or an object containing\nget/set methods when used in classic classes, like computed properties.

\n

In general, only properties which you expect to be watched by older,\nuntracked clases should be marked as dependency compatible. The decorator is\nmeant as an interop layer for parts of Ember's older classic APIs, and should\nnot be applied to every possible getter/setter in classes. The number of\ndependency compatible getters should be minimized wherever possible. New\napplication code should not need to use @dependentKeyCompat, since it is\nonly for interoperation with older code.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "dependentKeyCompat", + "static": 1, + "params": [ + { + "name": "desc", + "description": "A property descriptor containing\n the getter and setter (when used in\n classic classes)", + "type": "PropertyDescriptor|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object/compat", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/object/computed-97f63b5990.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/object/computed-97f63b5990.json new file mode 100644 index 000000000..4b4b7fcde --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/object/computed-97f63b5990.json @@ -0,0 +1,903 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/object/computed", + "type": "class", + "attributes": { + "name": "@ember/object/computed", + "shortname": "@ember/object/computed", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/expand_properties.ts", + "line": 9, + "description": "

Expands pattern, invoking callback for each expansion.

\n

The only pattern supported is brace-expansion, anything else will be passed\nonce to callback directly.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { expandProperties } from '@ember/object/computed';\n\nfunction echo(arg){ console.log(arg); }\n\nexpandProperties('foo.bar', echo);              //=> 'foo.bar'\nexpandProperties('{foo,bar}', echo);            //=> 'foo', 'bar'\nexpandProperties('foo.{bar,baz}', echo);        //=> 'foo.bar', 'foo.baz'\nexpandProperties('{foo,bar}.baz', echo);        //=> 'foo.baz', 'bar.baz'\nexpandProperties('foo.{bar,baz}.[]', echo)      //=> 'foo.bar.[]', 'foo.baz.[]'\nexpandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs'\nexpandProperties('{foo}.bar.{baz}')             //=> 'foo.bar.baz'
\n
\n
\n \n", + "itemtype": "method", + "name": "expandProperties", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "pattern", + "description": "The property pattern to expand.", + "type": "String" + }, + { + "name": "callback", + "description": "The callback to invoke. It is invoked once per\nexpansion, and is passed the expansion.", + "type": "Function" + } + ], + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 63, + "description": "

A computed property macro that returns true if the value of the dependent\nproperty is null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { empty } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  @empty('todos') isDone;\n}\n\nlet todoList = new ToDoList(\n  ['Unit Test', 'Documentation', 'Release']\n);\n\ntodoList.isDone; // false\nset(todoList, 'todos', []);\ntodoList.isDone; // true
\n
\n
\n \n", + "since": "1.6.0", + "itemtype": "method", + "name": "empty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if the value\nof the dependent property is null, an empty string, empty array, or empty\nfunction and false if the underlying value is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 112, + "description": "

A computed property that returns true if the value of the dependent property\nis NOT null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { notEmpty } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(backpack) {\n    set(this, 'backpack', backpack);\n  }\n\n  @notEmpty('backpack') hasStuff\n}\n\nlet hamster = new Hamster(\n  ['Food', 'Sleeping Bag', 'Tent']\n);\n\nhamster.hasStuff; // true\nset(hamster, 'backpack', []);\nhamster.hasStuff; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "notEmpty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 158, + "description": "

A computed property that returns true if the value of the dependent property\nis null or undefined. This avoids errors from JSLint complaining about use of\n==, which can be technically confusing.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { none } from '@ember/object/computed';\n\nclass Hamster {\n  @none('food') isHungry;\n}\n\nlet hamster = new Hamster();\n\nhamster.isHungry; // true\n\nset(hamster, 'food', 'Banana');\nhamster.isHungry; // false\n\nset(hamster, 'food', null);\nhamster.isHungry; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "none", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is null or undefined.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 201, + "description": "

A computed property that returns the inverse boolean value of the original\nvalue for the dependent property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { not } from '@ember/object/computed';\n\nclass User {\n  loggedIn = false;\n\n  @not('loggedIn') isAnonymous;\n}\n\nlet user = new User();\n\nuser.isAnonymous; // true\nset(user, 'loggedIn', true);\nuser.isAnonymous; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "not", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns inverse of the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 243, + "description": "

A computed property that converts the provided dependent property into a\nboolean value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { bool } from '@ember/object/computed';\n\n\nclass Hamster {\n  @bool('numBananas') hasBananas\n}\n\nlet hamster = new Hamster();\n\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 0);\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 1);\nhamster.hasBananas; // true\n\nset(hamster, 'numBananas', null);\nhamster.hasBananas; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "bool", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which converts to boolean the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 291, + "description": "

A computed property which matches the original value for the dependent\nproperty against a given RegExp, returning true if the value matches the\nRegExp and false if it does not.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { match } from '@ember/object/computed';\n\nclass User {\n  @match('email', /^.+@.+\\..+$/) hasValidEmail;\n}\n\nlet user = new User();\n\nuser.hasValidEmail; // false\n\nset(user, 'email', '');\nuser.hasValidEmail; // false\n\nset(user, 'email', 'ember_hamster@example.com');\nuser.hasValidEmail; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "match", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "regexp", + "description": "", + "type": "RegExp" + } + ], + "return": { + "description": "computed property which match the original value\nfor property against a given RegExp", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 338, + "description": "

A computed property that returns true if the provided dependent property is\nequal to the given value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { equal } from '@ember/object/computed';\n\nclass Hamster {\n  @equal('percentCarrotsEaten', 100) satisfied;\n}\n\nlet hamster = new Hamster();\n\nhamster.satisfied; // false\n\nset(hamster, 'percentCarrotsEaten', 100);\nhamster.satisfied; // true\n\nset(hamster, 'percentCarrotsEaten', 50);\nhamster.satisfied; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "equal", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "String|Number|Object" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is equal to the given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 383, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gt } from '@ember/object/computed';\n\nclass Hamster {\n  @gt('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 11);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 428, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gte } from '@ember/object/computed';\n\nclass Hamster {\n  @gte('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 10);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater or equal then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 473, + "description": "

A computed property that returns true if the provided dependent property is\nless than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lt } from '@ember/object/computed';\n\nclass Hamster {\n  @lt('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 2);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 518, + "description": "

A computed property that returns true if the provided dependent property is\nless than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lte } from '@ember/object/computed';\n\nclass Hamster {\n  @lte('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 5);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less or equal than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 563, + "description": "

A computed property that performs a logical and on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first falsy value or last\ntruthy value just like JavaScript's && operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { and } from '@ember/object/computed';\n\nclass Hamster {\n  @and('hasTent', 'hasBackpack') readyForCamp;\n  @and('hasWalkingStick', 'hasBackpack') readyForHike;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForCamp; // false\n\nset(tomster, 'hasTent', true);\ntomster.readyForCamp; // false\n\nset(tomster, 'hasBackpack', true);\ntomster.readyForCamp; // true\n\nset(tomster, 'hasBackpack', 'Yes');\ntomster.readyForCamp; // 'Yes'\n\nset(tomster, 'hasWalkingStick', null);\ntomster.readyForHike; // null
\n
\n
\n \n", + "itemtype": "method", + "name": "and", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `and` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 609, + "description": "

A computed property which performs a logical or on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first truthy value or last\nfalsy value just like JavaScript's || operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { or } from '@ember/object/computed';\n\nclass Hamster {\n  @or('hasJacket', 'hasUmbrella') readyForRain;\n  @or('hasSunscreen', 'hasUmbrella') readyForBeach;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForRain; // undefined\n\nset(tomster, 'hasUmbrella', true);\ntomster.readyForRain; // true\n\nset(tomster, 'hasJacket', 'Yes');\ntomster.readyForRain; // 'Yes'\n\nset(tomster, 'hasSunscreen', 'Check');\ntomster.readyForBeach; // 'Check'
\n
\n
\n \n", + "itemtype": "method", + "name": "or", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `or` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 652, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { alias } from '@ember/object/computed';\n\nclass Person {\n  name = 'Alex Matchneer';\n\n  @alias('name') nomen;\n}\n\nlet alex = new Person();\n\nalex.nomen; // 'Alex Matchneer'\nalex.name;  // 'Alex Matchneer'\n\nset(alex, 'nomen', '@machty');\nalex.name;  // '@machty'
\n
\n
\n \n", + "itemtype": "method", + "name": "alias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates an alias to the\noriginal value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 687, + "description": "

Where the alias computed macro aliases get and set, and allows for\nbidirectional data flow, the oneWay computed macro only provides an aliased\nget. The set will not mutate the upstream property, rather causes the\ncurrent property to become the value set. This causes the downstream property\nto permanently diverge from the upstream property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { oneWay }from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @oneWay('firstName') nickName;\n}\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear');\nteddy.firstName; // 'Teddy'\nteddy.nickName; // 'TeddyBear'
\n
\n
\n \n", + "itemtype": "method", + "name": "oneWay", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 735, + "description": "

This is a more semantically meaningful alias of the oneWay computed macro,\nwhose name is somewhat ambiguous as to which direction the data flows.

\n", + "itemtype": "method", + "name": "reads", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\n property to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 748, + "description": "

Where oneWay computed macro provides oneWay bindings, the readOnly\ncomputed macro provides a readOnly one way binding. Very often when using\nthe oneWay macro one does not also want changes to propagate back up, as\nthey will replace the value.

\n

This prevents the reverse flow, and also throws an exception when it occurs.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { readOnly } from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @readOnly('firstName') nickName;\n});\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear'); // throws Exception\n// throw new EmberError('Cannot Set: nickName on: <User:ember27288>' );`\n\nteddy.firstName; // 'Teddy'
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 799, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property, but also print a deprecation warning.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { set } from '@ember/object';\nimport { deprecatingAlias } from '@ember/object/computed';\n\nclass Hamster {\n  @deprecatingAlias('cavendishCount', {\n    id: 'hamster.deprecate-banana',\n    until: '3.0.0'\n  })\n  bananaCount;\n}\n\nlet hamster = new Hamster();\n\nset(hamster, 'bananaCount', 5); // Prints a deprecation warning.\nhamster.cavendishCount; // 5
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecatingAlias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "Options for `deprecate`.", + "type": "Object" + } + ], + "return": { + "description": "computed property which creates an alias with a\ndeprecation to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 56, + "description": "

A computed property that returns the sum of the values in the dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { sum } from '@ember/object/computed';\n\nclass Invoice {\n  lineItems = [1.00, 2.50, 9.99];\n\n  @sum('lineItems') total;\n}\n\nlet invoice = new Invoice();\n\ninvoice.total; // 13.49
\n
\n
\n \n", + "itemtype": "method", + "name": "sum", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the sum of all values in the\ndependentKey's array", + "type": "ComputedProperty" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 93, + "description": "

A computed property that calculates the maximum value in the dependent array.\nThis will return -Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, max } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @max('childAges') maxChildAge;\n}\n\nlet lordByron = new Person();\n\nlordByron.maxChildAge; // -Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.maxChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.maxChildAge; // 8
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe max of a list of Date objects will be the highest timestamp as a Number.\nThis behavior is consistent with Math.max.

\n", + "itemtype": "method", + "name": "max", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the largest value in the dependentKey's\narray", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 157, + "description": "

A computed property that calculates the minimum value in the dependent array.\nThis will return Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, min } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @min('childAges') minChildAge;\n}\n\nlet lordByron = Person.create({ children: [] });\n\nlordByron.minChildAge; // Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.minChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.minChildAge; // 5
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe min of a list of Date objects will be the lowest timestamp as a Number.\nThis behavior is consistent with Math.min.

\n", + "itemtype": "method", + "name": "min", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the smallest value in the dependentKey's array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 220, + "description": "

Returns an array mapped via the callback

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function mapCallback(item, index);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', function(chore, index) {\n    return `${chore.toUpperCase()}!`;\n  })\n  excitingChores;\n});\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n

You can optionally pass an array of additional dependent keys as the second\nparameter to the macro, if your map function relies on any external values:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  shouldUpperCase = false;\n\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', ['shouldUpperCase'], function(chore, index) {\n    if (this.shouldUpperCase) {\n      return `${chore.toUpperCase()}!`;\n    } else {\n      return `${chore}!`;\n    }\n  })\n  excitingChores;\n}\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['clean!', 'write more unit tests!']\n\nset(hamster, 'shouldUpperCase', true);\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional\ndependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "an array mapped via the callback", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 321, + "description": "

Returns an array mapped to the specified key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import { set } from '@ember/object';\nimport { mapBy } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n}\n\nlet lordByron = new Person();\n\nlordByron.childAges; // []\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.childAges; // [7]\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.childAges; // [7, 5, 8]
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "an array mapped to the specified key", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 388, + "description": "

Filters the array by the callback.

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
  • array is the dependant array itself.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function filterCallback(item, index, array);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = Hamster.create([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]
\n
\n
\n \n

You can also use @each.property in your dependent key, the callback will\nstill use the underlying array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores.@each.done', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n\nset(hamster.chores[2], 'done', true);\nhamster.remainingChores; // []
\n
\n
\n \n

Finally, you can optionally pass an array of additional dependent keys as the\nsecond parameter to the macro, if your filter function relies on any external\nvalues:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  doneKey = 'finished';\n\n  @filter('chores', ['doneKey'], function(chore, index, array) {\n    return !chore[this.doneKey];\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', finished: true },\n  { name: 'clean', finished: true },\n  { name: 'write more unit tests', finished: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', finished: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional dependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 519, + "description": "

Filters the array by the property and value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { filterBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filterBy('chores', 'done', false) remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{ name: 'write more unit tests', done: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "*" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 575, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniq } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniq('fruits') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  'banana',\n  'grape',\n  'kale',\n  'banana'\n]);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale']
\n
\n
\n \n", + "itemtype": "method", + "name": "uniq", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 641, + "description": "

A computed property which returns a new array with all the unique elements\nfrom an array, with uniqueness determined by specific key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniqBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniqBy('fruits', 'id') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  { id: 1, 'banana' },\n  { id: 2, 'grape' },\n  { id: 3, 'peach' },\n  { id: 1, 'banana' }\n]);\n\nhamster.uniqueFruits; // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 695, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { union } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits, vegetables) {\n    set(this, 'fruits', fruits);\n    set(this, 'vegetables', vegetables);\n  }\n\n  @union('fruits', 'vegetables') uniqueFruits;\n});\n\nlet hamster = new, Hamster(\n  [\n    'banana',\n    'grape',\n    'kale',\n    'banana',\n    'tomato'\n  ],\n  [\n    'tomato',\n    'carrot',\n    'lettuce'\n  ]\n);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale', 'tomato', 'carrot', 'lettuce']
\n
\n
\n \n", + "itemtype": "method", + "name": "union", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the unique elements\nfrom one or more dependent arrays.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 742, + "description": "

A computed property which returns a new array with all the elements\ntwo or more dependent arrays have in common.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { intersect } from '@ember/object/computed';\n\nclass FriendGroups {\n  constructor(adaFriends, charlesFriends) {\n    set(this, 'adaFriends', adaFriends);\n    set(this, 'charlesFriends', charlesFriends);\n  }\n\n  @intersect('adaFriends', 'charlesFriends') friendsInCommon;\n}\n\nlet groups = new FriendGroups(\n  ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n  ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock']\n);\n\ngroups.friendsInCommon; // ['William King', 'Mary Somerville']
\n
\n
\n \n", + "itemtype": "method", + "name": "intersect", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the duplicated\nelements from the dependent arrays", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 816, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array that are not in the second dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { setDiff } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(likes, fruits) {\n    set(this, 'likes', likes);\n    set(this, 'fruits', fruits);\n  }\n\n  @setDiff('likes', 'fruits') wants;\n}\n\nlet hamster = new Hamster(\n  [\n    'banana',\n    'grape',\n    'kale'\n  ],\n  [\n    'grape',\n    'kale',\n  ]\n);\n\nhamster.wants; // ['banana']
\n
\n
\n \n", + "itemtype": "method", + "name": "setDiff", + "static": 1, + "params": [ + { + "name": "setAProperty", + "description": "", + "type": "String" + }, + { + "name": "setBProperty", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the items from the\nfirst dependent array that are not in the second dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 886, + "description": "

A computed property that returns the array of values for the provided\ndependent properties.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { collect } from '@ember/object/computed';\n\nclass Hamster {\n  @collect('hat', 'shirt') clothes;\n}\n\nlet hamster = new Hamster();\n\nhamster.clothes; // [null, null]\n\nset(hamster, 'hat', 'Camp Hat');\nset(hamster, 'shirt', 'Camp Shirt');\nhamster.clothes; // ['Camp Hat', 'Camp Shirt']
\n
\n
\n \n", + "itemtype": "method", + "name": "collect", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which maps values of all passed\nin properties to an array.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 937, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array sorted based on a property or sort function. The sort\nmacro can be used in two different ways:

\n
    \n
  1. By providing a sort callback function
  2. \n
  3. By providing an array of keys to sort the array
  4. \n
\n

In the first form, the callback method you provide should have the following\nsignature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function sortCallback(itemA, itemB);
\n
\n
\n \n
    \n
  • itemA the first item to compare.
  • \n
  • itemB the second item to compare.
  • \n
\n

This function should return negative number (e.g. -1) when itemA should\ncome before itemB. It should return positive number (e.g. 1) when itemA\nshould come after itemB. If the itemA and itemB are equal this function\nshould return 0.

\n

Therefore, if this function is comparing some numeric values, simple itemA - itemB or itemA.get( 'foo' ) - itemB.get( 'foo' ) can be used instead of\nseries of if.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', function(a, b){\n    if (a.priority > b.priority) {\n      return 1;\n    } else if (a.priority < b.priority) {\n      return -1;\n    }\n\n    return 0;\n  })\n  priorityTodos;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

You can also optionally pass an array of additional dependent keys as the\nsecond parameter, if your sort function is dependent on additional values that\ncould changes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n
import EmberObject, { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  sortKey = 'priority';\n\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', ['sortKey'], function(a, b){\n    if (a[this.sortKey] > b[this.sortKey]) {\n      return 1;\n    } else if (a[this.sortKey] < b[this.sortKey]) {\n      return -1;\n    }\n\n    return 0;\n  })\n  sortedTodos;\n});\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

In the second form, you should provide the key of the array of sort values as\nthe second parameter:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using standard ascending sort\n  todosSorting = ['name'];\n  @sort('todos', 'todosSorting') sortedTodos;\n\n  // using descending sort\n  todosSortingDesc = ['name:desc'];\n  @sort('todos', 'todosSortingDesc') sortedTodosDesc;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.sortedTodos; // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\ntodoList.sortedTodosDesc; // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n", + "itemtype": "method", + "name": "sort", + "static": 1, + "params": [ + { + "name": "itemsKey", + "description": "", + "type": "String" + }, + { + "name": "sortDefinitionOrDependentKeys", + "description": "The key of the sort definition (an array of sort properties),\nthe sort function, or an array of additional dependent keys", + "type": "String|Function|Array" + }, + { + "name": "sortDefinition", + "description": "the sort function (when used with additional dependent keys)", + "type": "Function?" + } + ], + "return": { + "description": "computes a new sorted array based on the sort\nproperty array or callback function", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/object/evented-20871288c5.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/object/evented-20871288c5.json new file mode 100644 index 000000000..942c22a0b --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/object/evented-20871288c5.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/object/evented", + "type": "class", + "attributes": { + "name": "@ember/object/evented", + "shortname": "@ember/object/evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 178, + "description": "

Define a property as a function that should be executed when\na specified event or events are triggered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\nimport { on } from '@ember/object/evented';\nimport { sendEvent } from '@ember/object/events';\n\nlet Job = EmberObject.extend({\n  logCompleted: on('completed', function() {\n    console.log('Job completed!');\n  })\n});\n\nlet job = Job.create();\n\nsendEvent(job, 'completed'); // Logs 'Job completed!'
\n
\n
\n \n", + "itemtype": "method", + "name": "on", + "static": 1, + "params": [ + { + "name": "eventNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the listener function, passed as last argument to on(...)", + "type": "Function" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/polyfills-311542a3d4.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/polyfills-311542a3d4.json new file mode 100644 index 000000000..6e32f8420 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/polyfills-311542a3d4.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/polyfills", + "type": "class", + "attributes": { + "name": "@ember/polyfills", + "shortname": "@ember/polyfills", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/polyfills", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/polyfills/lib/assign.ts", + "line": 11, + "description": "

Copy properties from a source object to a target object. Source arguments remain unchanged.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assign } from '@ember/polyfills';\n\nvar a = { first: 'Yehuda' };\nvar b = { last: 'Katz' };\nvar c = { company: 'Other Company' };\nvar d = { company: 'Tilde Inc.' };\nassign(a, b, c, d); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' };
\n
\n
\n \n", + "itemtype": "method", + "name": "assign", + "params": [ + { + "name": "target", + "description": "The object to assign into", + "type": "Object" + }, + { + "name": "args", + "description": "The objects to copy properties from", + "type": "Object", + "multiple": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/polyfills", + "module": "@ember/polyfills" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/polyfills", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/runloop-254ddfc3f9.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/runloop-254ddfc3f9.json new file mode 100644 index 000000000..35ee6eb7d --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/runloop-254ddfc3f9.json @@ -0,0 +1,497 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/runloop", + "type": "class", + "attributes": { + "name": "@ember/runloop", + "shortname": "@ember/runloop", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/runloop", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/runloop/index.js", + "line": 74, + "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

Normally 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { run } from '@ember/runloop';\n\nrun(function() {\n  // code to be executed within a RunLoop\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "run", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "return value from invoking the passed function.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 106, + "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

Please note: This is not for normal usage, and should be used sparingly.

\n

If invoked when not within a run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { join } from '@ember/runloop';\n\njoin(function() {\n  // creates a new run-loop\n});
\n
\n
\n \n

Alternatively, if called within an existing run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "join", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Return value from invoking the passed function. Please note,\nwhen called within an existing loop, no return value is possible.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 154, + "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

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

Let'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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import 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
\n \n

In 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.

\n", + "itemtype": "method", + "name": "bind", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "returns a new function that will always have a particular context", + "type": "Function" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 241, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "begin", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 264, + "description": "

Ends a RunLoop. This must be called sometime after you call\nbegin() to flush any deferred actions. This is a lower-level way\nto use a RunLoop instead of using run().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "end", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 287, + "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

At 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "schedule", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'", + "type": "String" + }, + { + "name": "target", + "description": "target object to use as the context when invoking a method.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.", + "type": "String|Function" + }, + { + "name": "arguments*", + "description": "Optional arguments to be passed to the queued method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 342, + "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

You 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "later", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 376, + "description": "

Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling scheduleOnce with the "actions" queue.

\n", + "itemtype": "method", + "name": "once", + "static": 1, + "params": [ + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 396, + "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

Note that although you can pass optional arguments these will not be\nconsidered when looking for duplicates. New arguments will replace previous\ncalls.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Also note that for scheduleOnce to prevent additional calls, you need to\npass the same function instance. The following case works as expected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
function log() {\n  console.log('Logging only once');\n}\n\nfunction scheduleIt() {\n  scheduleOnce('actions', myContext, log);\n}\n\nscheduleIt();\nscheduleIt();
\n
\n
\n \n

But this other case will schedule the function multiple times:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { 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
\n \n

Available queues, and their order, can be found at queues

\n", + "itemtype": "method", + "name": "scheduleOnce", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'.", + "type": "String", + "optional": true + }, + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 472, + "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\nlater with a wait time of 1ms.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { 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
\n \n

Multiple 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

Note 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

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

One 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

The 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.

\n", + "itemtype": "method", + "name": "next", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 547, + "description": "

Cancels a scheduled item. Must be a value returned by later(),\nonce(), scheduleOnce(), next(), debounce(), or\nthrottle().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n
import {\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
\n
\n \n", + "itemtype": "method", + "name": "cancel", + "static": 1, + "params": [ + { + "name": "timer", + "description": "Timer object to cancel", + "type": "Object" + } + ], + "return": { + "description": "true if canceled or false/undefined if it wasn't found", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 618, + "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

This 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n \n

Immediate allows you to run the function immediately, but debounce\nother calls for this function until the wait time has elapsed. If\ndebounce 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "debounce", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to false.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 696, + "description": "

Ensure that the target method is never called more frequently than\nthe specified spacing period. The target method is called immediately.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "throttle", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "spacing", + "description": "Number of milliseconds to space out requests.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to true.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/runloop/index.js", + "line": 31, + "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.

\n", + "itemtype": "property", + "name": "queues", + "type": "Array", + "default": "['actions', 'destroy']", + "access": "private", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/polyfills" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/runloop", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/service-f6e60210ed.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/service-f6e60210ed.json new file mode 100644 index 000000000..340878bd8 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/service-f6e60210ed.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/service", + "type": "class", + "attributes": { + "name": "@ember/service", + "shortname": "@ember/service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/service/index.js", + "line": 9, + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + }, + { + "file": "packages/@ember/service/index.js", + "line": 23, + "description": "

Creates a property that lazily looks up a service in the container. There are\nno restrictions as to what objects a service can be injected into.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service('auth') authManager;\n\n  model() {\n    return this.authManager.findCurrentUser();\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default Route.extend({\n  authManager: service('auth'),\n\n  model() {\n    return this.get('authManager').findCurrentUser();\n  }\n});
\n
\n
\n \n

This example will create an authManager property on the application route\nthat looks up the auth service in the container, making it easily accessible\nin the model hook.

\n", + "itemtype": "method", + "name": "service", + "static": 1, + "since": "4.1.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/test-d53686b80b.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/test-d53686b80b.json new file mode 100644 index 000000000..c475398f5 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/test-d53686b80b.json @@ -0,0 +1,395 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/test", + "type": "class", + "attributes": { + "name": "@ember/test", + "shortname": "@ember/test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/test", + "namespace": "", + "methods": [ + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 51, + "description": "

This hook defers the readiness of the application, so that you can start\nthe app when your tests are ready to run. It also sets the router's\nlocation to 'none', so that the window's location will not be modified\n(preventing both accidental leaking of state between tests and interference\nwith your testing framework). setupForTesting should only be called after\nsetting a custom router class (for example App.Router = Router.extend().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.setupForTesting();
\n
\n
\n \n", + "itemtype": "method", + "name": "setupForTesting", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 90, + "description": "

This injects the test helpers into the helperContainer object. If an object is provided\nit will be used as the helperContainer. If helperContainer is not set it will default\nto window. If a function of the same name has already been defined it will be cached\n(so that it can be reset if the helper is removed with unregisterHelper or\nremoveTestHelpers).

\n

Any callbacks registered with onInjectHelpers will be called once the\nhelpers have been injected.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.injectTestHelpers();
\n
\n
\n \n", + "itemtype": "method", + "name": "injectTestHelpers", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 132, + "description": "

This removes all helpers that have been registered, and resets and functions\nthat were overridden by the helpers.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.removeTestHelpers();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "removeTestHelpers", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/helpers/current_path.js", + "line": 6, + "description": "

Returns the current path.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentPath(), 'some.path.index', "correct path was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentPath", + "return": { + "description": "The currently active path.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_route_name.js", + "line": 5, + "description": "

Returns the currently active route name.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
function validateRouteName() {\nequal(currentRouteName(), 'some.path', "correct route was transitioned into.");\n}\nvisit('/some/path').then(validateRouteName)
\n
\n
\n \n", + "itemtype": "method", + "name": "currentRouteName", + "return": { + "description": "The name of the currently active route.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_url.js", + "line": 6, + "description": "

Returns the current URL.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentURL(), '/some/path', "correct URL was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentURL", + "return": { + "description": "The currently active URL.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.js", + "line": 9, + "description": "

Resumes a test paused by pauseTest.

\n", + "itemtype": "method", + "name": "resumeTest", + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.js", + "line": 22, + "description": "

Pauses the current test - this is useful for debugging while testing or for test-driving.\nIt allows you to inspect the state of your application at any point.\nExample (The test will pause before clicking the button):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('/')\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

You may want to turn off the timeout before pausing.

\n

qunit (timeout available to use as of 2.4.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nassert.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

mocha (timeout happens automatically as of ember-mocha v0.14.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nthis.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n", + "since": "1.9.0", + "itemtype": "method", + "name": "pauseTest", + "return": { + "description": "A promise that will never resolve", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/visit.js", + "line": 3, + "description": "

Loads a route, sets up any controllers, and renders any templates associated\nwith the route as though a real user had triggered the route change while\nusing your app.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('posts/index').then(function() {\n  // assert something\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/wait.js", + "line": 9, + "description": "

Causes the run loop to process any pending events. This is used to ensure that\nany async operations from other helpers (or your assertions) have been processed.

\n

This is most often used as the return value for the helper functions (see 'click',\n'fillIn','visit',etc). However, there is a method to register a test helper which\nutilizes this method without the need to actually call wait() in your helpers.

\n

The wait helper is built into registerAsyncHelper by default. You will not need\nto return app.testHelpers.wait(); - the wait behavior is provided for you.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('loginUser', function(app, username, password) {\n  visit('secured/path/here')\n    .fillIn('#username', username)\n    .fillIn('#password', password)\n    .click('.submit');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "wait", + "params": [ + { + "name": "value", + "description": "The value to be returned.", + "type": "Object" + } + ], + "return": { + "description": "Promise that resolves to the passed value.", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/test/helpers.js", + "line": 8, + "description": "

registerHelper is used to register a test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

This helper can later be called without arguments because it will be\ncalled with app as the first parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nApp = Application.create();\nApp.injectTestHelpers();\nboot();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.js", + "line": 52, + "description": "

registerAsyncHelper is used to register an async test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerAsyncHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterAsyncHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

The advantage of an async helper is that it will not run\nuntil the last async helper has completed. All async helpers\nafter it will wait for it complete before running.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('deletePost', function(app, postId) {\n  click('.delete-' + postId);\n});\n\n// ... in your test\nvisit('/post/2');\ndeletePost(2);\nvisit('/post/3');\ndeletePost(3);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerAsyncHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.js", + "line": 105, + "description": "

Remove a previously added helper method.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { unregisterHelper } from '@ember/test';\n\nunregisterHelper('wait');
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregisterHelper", + "static": 1, + "params": [ + { + "name": "name", + "description": "The helper to remove.", + "type": "String" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.js", + "line": 7, + "description": "

This allows ember-testing to play nicely with other asynchronous\nevents, such as an application that is waiting for a CSS3\ntransition or an IndexDB transaction. The waiter runs periodically\nafter each async helper (i.e. click, andThen, visit, etc) has executed,\nuntil the returning result is truthy. After the waiters finish, the next async helper\nis executed and the process repeats.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(function() {\n  return myPendingTransactions() === 0;\n});
\n
\n
\n \n

The context argument allows you to optionally specify the this\nwith which your callback will be invoked.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(MyDB, MyDB.hasPendingTransactions);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.js", + "line": 55, + "description": "

unregisterWaiter is used to unregister a callback that was\nregistered with registerWaiter.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "unregisterWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.js", + "line": 83, + "description": "

Iterates through each registered test waiter, and invokes\nits callback. If any waiter returns false, this method will return\ntrue indicating that the waiters have not settled yet.

\n

This is generally used internally from the acceptance/integration test\ninfrastructure.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "checkWaiters", + "class": "@ember/test", + "module": "@ember/test" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 10, + "description": "

This property contains the testing helpers for the current application. These\nare created once you call injectTestHelpers on your Application\ninstance. The included helpers are also available on the window object by\ndefault, but can be used from this object on the individual application also.

\n", + "itemtype": "property", + "name": "testHelpers", + "type": "{Object}", + "default": "{}", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 23, + "description": "

This property will contain the original methods that were registered\non the helperContainer before injectTestHelpers is called.

\n

When removeTestHelpers is called, these methods are restored to the\nhelperContainer.

\n", + "itemtype": "property", + "name": "originalMethods", + "type": "{Object}", + "default": "{}", + "access": "private", + "tagname": "", + "since": "1.3.0", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 38, + "description": "

This property indicates whether or not this application is currently in\ntesting mode. This is set when setupForTesting is called on the current\napplication.

\n", + "itemtype": "property", + "name": "testing", + "type": "{Boolean}", + "default": "false", + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 78, + "description": "

This will be used as the container to inject the test helpers into. By\ndefault the helpers are injected into window.

\n", + "itemtype": "property", + "name": "helperContainer", + "type": "{Object} The object to be used for test helpers.", + "default": "window", + "since": "1.2.0", + "access": "private", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/test", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/utils-39cddc591f.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/utils-39cddc591f.json new file mode 100644 index 000000000..bed1c6b00 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@ember/utils-39cddc591f.json @@ -0,0 +1,214 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/utils", + "type": "class", + "attributes": { + "name": "@ember/utils", + "shortname": "@ember/utils", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/utils", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/is_blank.ts", + "line": 5, + "description": "

A value is blank if it is empty or a whitespace string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import { isBlank } from '@ember/utils';\n\nisBlank();                // true\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
\n
\n \n", + "itemtype": "method", + "name": "isBlank", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_empty.ts", + "line": 5, + "description": "

Verifies that a value is null or undefined, an empty string, or an empty\narray.

\n

Constrains the rules on isNone by returning true for empty strings and\nempty arrays.

\n

If the value is an object with a size property of type number, it is used\nto check emptiness.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
isEmpty();                 // true\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
\n
\n \n", + "itemtype": "method", + "name": "isEmpty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_none.ts", + "line": 4, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
isNone();              // true\nisNone(null);          // true\nisNone(undefined);     // true\nisNone('');            // false\nisNone([]);            // false\nisNone(function() {}); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isNone", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_present.ts", + "line": 5, + "description": "

A value is present if it not isBlank.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
isPresent();                // false\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
\n
\n \n", + "itemtype": "method", + "name": "isPresent", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.8.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/compare.js", + "line": 44, + "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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { compare } from '@ember/utils';\n\ncompare('hello', 'hello');  // 0\ncompare('abc', 'dfg');      // -1\ncompare(2, 1);              // 1
\n
\n
\n \n

If 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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { compare } from '@ember/utils';\n\ncompare('hello', 50);       // 1\ncompare(50, 'hello');       // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "compare", + "static": 1, + "params": [ + { + "name": "v", + "description": "First value to compare", + "type": "Object" + }, + { + "name": "w", + "description": "Second value to compare", + "type": "Object" + } + ], + "return": { + "description": "-1 if v < w, 0 if v = w and 1 if v > w.", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/is-equal.js", + "line": 4, + "description": "

Compares two objects, returning true if they are equal.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { isEqual } from '@ember/utils';\n\nisEqual('hello', 'hello');                   // true\nisEqual(1, 2);                               // false
\n
\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Due 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { isEqual } from '@ember/utils';\n\nisEqual([4, 2], [4, 2]);                     // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEqual", + "static": 1, + "params": [ + { + "name": "a", + "description": "first object to compare", + "type": "Object" + }, + { + "name": "b", + "description": "second object to compare", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/type-of.js", + "line": 24, + "description": "

Returns a consistent type for the passed object.

\n

Use 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\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
\n
\n \n

Examples:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "typeOf", + "params": [ + { + "name": "item", + "description": "the item to check", + "type": "Object" + } + ], + "return": { + "description": "the type", + "type": "String" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/utils", + "module": "@ember/utils" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/utils", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@glimmer/tracking-c5abca90f9.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@glimmer/tracking-c5abca90f9.json new file mode 100644 index 000000000..a5908c440 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@glimmer/tracking-c5abca90f9.json @@ -0,0 +1,53 @@ +{ + "data": { + "id": "ember-4.2.0-@glimmer/tracking", + "type": "class", + "attributes": { + "name": "@glimmer/tracking", + "shortname": "@glimmer/tracking", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 14, + "description": "

Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are static, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>Count: {{this.count}}</div>\n<div>Times Ten: {{this.timesTen}}</div>\n<div>\n  <button {{on "click" this.plusOne}}>\n    Plus One\n  </button>\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class CounterComponent extends Component {\n  @tracked count = 0;\n\n  get timesTen() {\n    return this.count * 10;\n  }\n\n  @action\n  plusOne() {\n    this.count += 1;\n  }\n}
\n
\n
\n \n

Both the {{this.count}} and the {{this.timesTen}} properties in the\ntemplate will update whenever the button is clicked. Any tracked properties\nthat are used in any way to calculate a value that is used in the template\nwill cause a rerender when updated - this includes through method calls and\nother means:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nclass Entry {\n  @tracked name;\n  @tracked phoneNumber;\n\n  constructor(name, phoneNumber) {\n    this.name = name;\n    this.phoneNumber = phoneNumber;\n  }\n}\n\nexport default class PhoneBookComponent extends Component {\n  entries = [\n    new Entry('Pizza Palace', 5551234),\n    new Entry('1st Street Cleaners', 5554321),\n    new Entry('Plants R Us', 5552468),\n  ];\n\n  // Any usage of this property will update whenever any of the names in the\n  // entries arrays are updated\n  get names() {\n    return this.entries.map(e => e.name);\n  }\n\n  // Any usage of this property will update whenever any of the numbers in the\n  // entries arrays are updated\n  get numbers() {\n    return this.getFormattedNumbers();\n  }\n\n  getFormattedNumbers() {\n    return this.entries\n      .map(e => e.phoneNumber)\n      .map(number => {\n        let numberString = '' + number;\n\n        return numberString.slice(0, 3) + '-' + numberString.slice(3);\n      });\n  }\n}
\n
\n
\n \n

It's important to note that setting tracked properties will always trigger an\nupdate, even if the property is set to the same value as it was before.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let entry = new Entry('Pizza Palace', 5551234);\n\n// if entry was used when rendering, this would cause a rerender, even though\n// the name is being set to the same value as it was before\nentry.name = entry.name;
\n
\n
\n \n

tracked can also be used with the classic Ember object model in a similar\nmanner to classic computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked(),\n  phoneNumber: tracked()\n});
\n
\n
\n \n

Often this is unnecessary, but to ensure robust auto-tracking behavior it is\nadvisable to mark tracked state appropriately wherever possible.

\n

This form of tracked also accepts an optional configuration object\ncontaining either an initial value or an initializer function (but not\nboth).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked({ value: 'Zoey' }),\n  favoriteSongs: tracked({\n    initializer: () => ['Raspberry Beret', 'Time After Time']\n  })\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "tracked", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@glimmer/tracking", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-@glimmer/tracking/primitives/cache-83d6053101.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-@glimmer/tracking/primitives/cache-83d6053101.json new file mode 100644 index 000000000..493f97ed7 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-@glimmer/tracking/primitives/cache-83d6053101.json @@ -0,0 +1,77 @@ +{ + "data": { + "id": "ember-4.2.0-@glimmer/tracking/primitives/cache", + "type": "class", + "attributes": { + "name": "@glimmer/tracking/primitives/cache", + "shortname": "@glimmer/tracking/primitives/cache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking/primitives/cache", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 14, + "description": "

Receives a function, and returns a wrapped version of it that memoizes based on\nautotracking. The function will only rerun whenever any tracked values used\nwithin it have changed. Otherwise, it will return the previous value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state. Now, `counter` will\n  // only rerun if `state.value` changes.\n  state.value;\n\n  return ++computeCount;\n});\n\ngetValue(counter); // 1\n\n// returns the same value because no tracked state has changed\ngetValue(counter); // 1\n\nstate.value = 'foo';\n\n// reruns because a tracked value used in the function has changed,\n// incermenting the counter\ngetValue(counter); // 2
\n
\n
\n \n", + "itemtype": "method", + "name": "createCache", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 56, + "description": "

Gets the value of a cache created with createCache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  return ++computeCount;\n});\n\ngetValue(counter); // 1
\n
\n
\n \n", + "itemtype": "method", + "name": "getValue", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 78, + "description": "

Can be used to check if a memoized function is constant. If no tracked state\nwas used while running a memoized function, it will never rerun, because nothing\ncan invalidate its result. isConst can be used to determine if a memoized\nfunction is constant or not, in order to optimize code surrounding that\nfunction.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue, isConst } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state\n  state.value;\n\n  return computeCount++;\n});\n\nlet constCounter = createCache(() => {\n  return computeCount++;\n});\n\ngetValue(counter);\ngetValue(constCounter);\n\nisConst(counter); // false\nisConst(constCounter); // true
\n
\n
\n \n

If called on a cache that hasn't been accessed yet, it will throw an\nerror. This is because there's no way to know if the function will be constant\nor not yet, and so this helps prevent missing an optimization opportunity on\naccident.

\n", + "itemtype": "method", + "name": "isConst", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@glimmer/tracking/primitives/cache", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Application-2607ff3ad0.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Application-2607ff3ad0.json new file mode 100644 index 000000000..8865087c7 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Application-2607ff3ad0.json @@ -0,0 +1,1287 @@ +{ + "data": { + "id": "ember-4.2.0-Application", + "type": "class", + "attributes": { + "name": "Application", + "shortname": "Application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/lib/application.js", + "line": 30, + "description": "

An instance of Application is the starting point for every Ember\napplication. It instantiates, initializes and coordinates the\nobjects that make up your app.

\n

Each Ember app has one and only one Application object. Although\nEmber CLI creates this object implicitly, the Application class\nis defined in the app/app.js. You can define a ready method on the\nApplication class, which will be run by Ember when the application is\ninitialized.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
const App = Application.extend({\n  ready() {\n    // your code here\n  }\n})
\n
\n
\n \n

Because Application ultimately inherits from Ember.Namespace, any classes\nyou create will have useful string representations when calling toString().\nSee the Ember.Namespace documentation for more information.

\n

While you can think of your Application as a container that holds the\nother classes in your application, there are several other responsibilities\ngoing on under-the-hood that you may want to understand. It is also important\nto understand that an Application is different from an ApplicationInstance.\nRefer to the Guides to understand the difference between these.

\n

Event Delegation

\n

Ember uses a technique called event delegation. This allows the framework\nto set up a global, shared event listener instead of requiring each view to\ndo it manually. For example, instead of each view registering its own\nmousedown listener on its associated element, Ember sets up a mousedown\nlistener on the body.

\n

If a mousedown event occurs, Ember will look at the target of the event and\nstart walking up the DOM node tree, finding corresponding views and invoking\ntheir mouseDown method as it goes.

\n

Application has a number of default events that it listens for, as\nwell as a mapping from lowercase events to camel-cased view method names. For\nexample, the keypress event causes the keyPress method on the view to be\ncalled, the dblclick event causes doubleClick to be called, and so on.

\n

If there is a bubbling browser event that Ember does not listen for by\ndefault, you can specify custom events and their corresponding view method\nnames by setting the application's customEvents property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // add support for the paste event\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent Ember from setting up a listener for a default event,\nspecify the event name with a null value in the customEvents\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // prevent listeners for mouseenter/mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n

By default, the application sets up these event listeners on the document\nbody. However, in cases where you are embedding an Ember application inside\nan existing page, you may want it to set up the listeners on an element\ninside the body.

\n

For example, if only events inside a DOM element with the ID of ember-app\nshould be delegated, set your application's rootElement property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  rootElement: '#ember-app'\n});
\n
\n
\n \n

The rootElement can be either a DOM element or a CSS selector\nstring. Note that views appended to the DOM outside the root element will\nnot receive events. If you specify a custom root element, make sure you only\nappend views inside it!

\n

To learn more about the events Ember components use, see

\n

components/handling-events.

\n

Initializers

\n

To add behavior to the Application's boot process, you can define initializers in\nthe app/initializers directory, or with ember generate initializer using Ember CLI.\nThese files should export a named initialize function which will receive the created application\nobject as its first argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
export function initialize(application) {\n  // application.inject('route', 'foo', 'service:foo');\n}
\n
\n
\n \n

Application initializers can be used for a variety of reasons including:

\n
    \n
  • setting up external libraries
  • \n
  • injecting dependencies
  • \n
  • setting up event listeners in embedded apps
  • \n
  • deferring the boot process using the deferReadiness and advanceReadiness APIs.
  • \n
\n

Routing

\n

In addition to creating your application's router, Application is\nalso responsible for telling the router when to start routing. Transitions\nbetween routes can be logged with the LOG_TRANSITIONS flag, and more\ndetailed intra-transition logging can be logged with\nthe LOG_TRANSITIONS_INTERNAL flag:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  LOG_TRANSITIONS: true, // basic logging of successful transitions\n  LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n});
\n
\n
\n \n

By default, the router will begin trying to translate the current URL into\napplication state once the browser emits the DOMContentReady event. If you\nneed to defer routing, you can call the application's deferReadiness()\nmethod. Once routing can begin, call the advanceReadiness() method.

\n

If there is any setup required before routing begins, you can implement a\nready() method on your app that will be invoked immediately before routing\nbegins.

\n", + "extends": "Engine", + "uses": [ + "RegistryProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/application/lib/application.js", + "line": 377, + "description": "

Create an ApplicationInstance for this application.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the application instance", + "type": "ApplicationInstance" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 400, + "description": "

Start tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is created.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_watchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 411, + "description": "

Stop tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is about to be destroyed.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_unwatchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 422, + "description": "

Enable the legacy globals mode by allowing this application to act\nas a global namespace. See the docs on the _globalsMode property\nfor details.

\n

Most of these features are already deprecated in 1.x, so we can\nstop using them internally and try to remove them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareForGlobalsMode", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 466, + "description": "

Automatically kick-off the boot process for the application once the\nDOM has become ready.

\n

The initialization itself is scheduled on the actions queue which\nensures that code-loading finishes before booting.

\n

If you are asynchronously loading code, you should call deferReadiness()\nto defer booting, and then call advanceReadiness() once all of your code\nhas finished loading.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "waitForDOMReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 493, + "description": "

This is the autoboot flow:

\n
    \n
  1. Boot the app by calling this.boot()
  2. \n
  3. Create an instance (or use the __deprecatedInstance__ in globals mode)
  4. \n
  5. Boot the instance by calling instance.boot()
  6. \n
  7. Invoke the App.ready() callback
  8. \n
  9. Kick-off routing on the instance
  10. \n
\n

Ideally, this is all we would need to do:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
_autoBoot() {\n  this.boot().then(() => {\n    let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance();\n    return instance.boot();\n  }).then((instance) => {\n    App.ready();\n    instance.startRouting();\n  });\n}
\n
\n
\n \n

Unfortunately, we cannot actually write this because we need to participate\nin the "synchronous" boot process. While the code above would work fine on\nthe initial boot (i.e. DOM ready), when App.reset() is called, we need to\nboot a new instance synchronously (see the documentation on _bootSync()\nfor details).

\n

Because of this restriction, the actual logic of this method is located\ninside didBecomeReady().

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "domReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 538, + "description": "

Use this to defer readiness until some condition is true.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Application from '@ember/application';\n\nlet App = Application.create();\n\nApp.deferReadiness();\n\nfetch('/auth-token')\n.then(response => response.json())\n.then(data => {\n  App.token = data.token;\n  App.advanceReadiness();\n});
\n
\n
\n \n

This allows you to perform asynchronous setup logic and defer\nbooting your application until the setup has finished.

\n

However, if the setup requires a loading UI, it might be better\nto use the router for this purpose.

\n", + "itemtype": "method", + "name": "deferReadiness", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 588, + "description": "

Call advanceReadiness after any asynchronous setup logic has completed.\nEach call to deferReadiness must be matched by a call to advanceReadiness\nor the application will never become ready and routing will not begin.

\n", + "itemtype": "method", + "name": "advanceReadiness", + "see": [ + "{Application#deferReadiness}" + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 625, + "description": "

Initialize the application and return a promise that resolves with the Application\nobject when the boot process is complete.

\n

Run any application initializers and run the application load hook. These hooks may\nchoose to defer readiness. For example, an authentication hook might want to defer\nreadiness until the auth token has been retrieved.

\n

By default, this method is called automatically on "DOM ready"; however, if autoboot\nis disabled, this is automatically called when the first application instance is\ncreated via visit.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 702, + "description": "

Reset the application. This is typically used only in tests. It cleans up\nthe application in the following order:

\n
    \n
  1. Deactivate existing routes
  2. \n
  3. Destroy all objects in the container
  4. \n
  5. Create a new application container
  6. \n
  7. Re-route to the existing url
  8. \n
\n

Typical Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    App.reset();\n  }\n});\n\ntest('first test', function() {\n  // App is freshly reset\n});\n\ntest('second test', function() {\n  // App is again freshly reset\n});
\n
\n
\n \n

Advanced Example:

\n

Occasionally you may want to prevent the app from initializing during\nsetup. This could enable extra configuration, or enable asserting prior\nto the app becoming ready.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    run(function() {\n      App.reset();\n      App.deferReadiness();\n    });\n  }\n});\n\ntest('first test', function() {\n  ok(true, 'something before app is initialized');\n\n  run(function() {\n    App.advanceReadiness();\n  });\n\n  ok(true, 'something after app is initialized');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reset", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 805, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "didBecomeReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 880, + "description": "

Boot a new instance of ApplicationInstance for the current\napplication and navigate it to the given url. Returns a Promise that\nresolves with the instance when the initial routing and rendering is\ncomplete, or rejects with any error that occurred during the boot process.

\n

When autoboot is disabled, calling visit would first cause the\napplication to boot, which runs the application initializers.

\n

This method also takes a hash of boot-time configuration options for\ncustomizing the instance's behavior. See the documentation on\nApplicationInstance.BootOptions for details.

\n

ApplicationInstance.BootOptions is an interface class that exists\npurely to document the available options; you do not need to construct it\nmanually. Simply pass a regular JavaScript object containing of the\ndesired options:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Supported Scenarios

\n

While the BootOptions class exposes a large number of knobs, not all\ncombinations of them are valid; certain incompatible combinations might\nresult in unexpected behavior.

\n

For example, booting the instance in the full browser environment\nwhile specifying a foreign document object (e.g. { isBrowser: true, document: iframe.contentDocument }) does not work correctly today,\nlargely due to Ember's jQuery dependency.

\n

Currently, there are three officially supported scenarios/configurations.\nUsages outside of these scenarios are not guaranteed to work, but please\nfeel free to file bug reports documenting your experience and any issues\nyou encountered to help expand support.

\n

Browser Applications (Manual Boot)

\n

The setup is largely similar to how Ember works out-of-the-box. Normally,\nEmber will boot a default instance for your Application on "DOM ready".\nHowever, you can customize this behavior by disabling autoboot.

\n

For example, this allows you to render a miniture demo of your application\ninto a specific area on your marketing website:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let options = {\n    // Override the router's location adapter to prevent it from updating\n    // the URL in the address bar\n    location: 'none',\n\n    // Override the default `rootElement` on the app to render into a\n    // specific `div` on the page\n    rootElement: '#demo'\n  };\n\n  // Start the app at the special demo URL\n  App.visit('/demo', options);\n});
\n
\n
\n \n

Or perhaps you might want to boot two instances of your app on the same\npage for a split-screen multiplayer experience:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let sessionId = MyApp.generateSessionID();\n\n  let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' });\n  let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' });\n\n  Promise.all([player1, player2]).then(() => {\n    // Both apps have completed the initial render\n    $('#loading').fadeOut();\n  });\n});
\n
\n
\n \n

Do note that each app instance maintains their own registry/container, so\nthey will run in complete isolation by default.

\n

Server-Side Rendering (also known as FastBoot)

\n

This setup allows you to run your Ember app in a server environment using\nNode.js and render its content into static HTML for SEO purposes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap);\n\nfunction renderURL(url) {\n  let dom = new SimpleDOM.Document();\n  let rootElement = dom.body;\n  let options = { isBrowser: false, document: dom, rootElement: rootElement };\n\n  return MyApp.visit(options).then(instance => {\n    try {\n      return HTMLSerializer.serialize(rootElement.firstChild);\n    } finally {\n      instance.destroy();\n    }\n  });\n}
\n
\n
\n \n

In this scenario, because Ember does not have access to a global document\nobject in the Node.js environment, you must provide one explicitly. In practice,\nin the non-browser environment, the stand-in document object only needs to\nimplement a limited subset of the full DOM API. The SimpleDOM library is known\nto work.

\n

Since there is no DOM access in the non-browser environment, you must also\nspecify a DOM Element object in the same document for the rootElement option\n(as opposed to a selector string like "body").

\n

See the documentation on the isBrowser, document and rootElement properties\non ApplicationInstance.BootOptions for details.

\n

Server-Side Resource Discovery

\n

This setup allows you to run the routing layer of your Ember app in a server\nenvironment using Node.js and completely disable rendering. This allows you\nto simulate and discover the resources (i.e. AJAX requests) needed to fulfill\na given request and eagerly "push" these resources to the client.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
service.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import BrowserNetworkService from 'app/services/network/browser';\nimport NodeNetworkService from 'app/services/network/node';\n\n// Inject a (hypothetical) service for abstracting all AJAX calls and use\n// the appropriate implementation on the client/server. This also allows the\n// server to log all the AJAX calls made during a particular request and use\n// that for resource-discovery purpose.\n\nexport function initialize(application) {\n  if (window) { // browser\n    application.register('service:network', BrowserNetworkService);\n  } else { // node\n    application.register('service:network', NodeNetworkService);\n  }\n};\n\nexport default {\n  name: 'network-service',\n  initialize: initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\n// An example of how the (hypothetical) service is used in routes.\n\nexport default class IndexRoute extends Route {\n  @service network;\n\n  model(params) {\n    return this.network.fetch(`/api/posts/${params.post_id}.json`);\n  }\n\n  afterModel(post) {\n    if (post.isExternalContent) {\n      return this.network.fetch(`/api/external/?url=${post.externalURL}`);\n    } else {\n      return post;\n    }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
// Finally, put all the pieces together\n\nfunction discoverResourcesFor(url) {\n  return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => {\n    let networkService = instance.lookup('service:network');\n    return networkService.requests; // => { "/api/posts/123.json": "..." }\n  });\n}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "The initial URL to navigate to", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "ApplicationInstance.BootOptions" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 1101, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 61, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 74, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 87, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 100, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 108, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 116, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 127, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 158, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 305, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 378, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 427, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Namespace" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 18, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 31, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 101, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 124, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 134, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 145, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 155, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 165, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 198, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 208, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/application/lib/application.js", + "line": 855, + "description": "

Called when the Application has become ready, immediately before routing\nbegins. The call will be delayed until the DOM has become ready.

\n", + "itemtype": "event", + "name": "ready", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + } + ], + "properties": [ + { + "file": "packages/@ember/application/lib/application.js", + "line": 185, + "description": "

The root DOM element of the Application. This can be specified as an\nelement or a selector string.

\n

This is the element that will be passed to the Application's,\neventDispatcher, which sets up the listeners for event delegation. Every\nview in your application should be a child of the element you specify here.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 200, + "itemtype": "property", + "name": "_document", + "type": "Document | null", + "default": "'window.document'", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 209, + "description": "

The Ember.EventDispatcher responsible for delegating events to this\napplication's views.

\n

The event dispatcher is created by the application at initialization time\nand sets up event listeners on the DOM element described by the\napplication's rootElement property.

\n

See the documentation for Ember.EventDispatcher for more information.

\n", + "itemtype": "property", + "name": "eventDispatcher", + "type": "Ember.EventDispatcher", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 226, + "description": "

The DOM events for which the event dispatcher should listen.

\n

By default, the application's Ember.EventDispatcher listens\nfor a set of standard DOM events, such as mousedown and\nkeyup, and delegates them to your application's Ember.View\ninstances.

\n

If you would like additional bubbling events to be delegated to your\nviews, set your Application's customEvents property\nto a hash containing the DOM event name as the key and the\ncorresponding view method name as the value. Setting an event to\na value of null will prevent a default event listener from being\nadded for that event.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // add support for the paste event\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // remove support for mouseenter / mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "customEvents", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 274, + "description": "

Whether the application should automatically start routing and render\ntemplates to the rootElement on DOM ready. While default by true,\nother environments such as FastBoot or a testing harness can set this\nproperty to false and control the precise timing and behavior of the boot\nprocess.

\n", + "itemtype": "property", + "name": "autoboot", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 288, + "description": "

Whether the application should be configured for the legacy "globals mode".\nUnder this mode, the Application object serves as a global namespace for all\nclasses.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Application from '@ember/application';\nimport Component from '@ember/component';\n\nlet App = Application.create({\n  ...\n});\n\nApp.Router.reopen({\n  location: 'none'\n});\n\nApp.Router.map({\n  ...\n});\n\nApp.MyComponent = Component.extend({\n  ...\n});
\n
\n
\n \n

This flag also exposes other internal APIs that assumes the existence of\na special "default instance", like App.__container__.lookup(...).

\n

This option is currently not configurable, its value is derived from\nthe autoboot flag – disabling autoboot also implies opting-out of\nglobals mode support, although they are ultimately orthogonal concerns.

\n

Some of the global modes features are already deprecated in 1.x. The\nexistence of this flag is to untangle the globals mode code paths from\nthe autoboot code paths, so that these legacy features can be reviewed\nfor deprecation/removal separately.

\n

Forcing the (autoboot=true, _globalsMode=false) here and running the tests\nwould reveal all the places where we are still relying on these legacy\nbehavior internally (mostly just tests).

\n", + "itemtype": "property", + "name": "_globalsMode", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 337, + "description": "

An array of application instances created by buildInstance(). Used\ninternally to ensure that all instances get destroyed.

\n", + "itemtype": "property", + "name": "_applicationInstances", + "type": "Array", + "default": "null", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 53, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 418, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-Engine", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-ApplicationInstance-778c70b4d1.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-ApplicationInstance-778c70b4d1.json new file mode 100644 index 000000000..4b786fd94 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-ApplicationInstance-778c70b4d1.json @@ -0,0 +1,1063 @@ +{ + "data": { + "id": "ember-4.2.0-ApplicationInstance", + "type": "class", + "attributes": { + "name": "ApplicationInstance", + "shortname": "ApplicationInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/instance.js", + "line": 10, + "description": "

The ApplicationInstance encapsulates all of the stateful aspects of a\nrunning Application.

\n

At a high-level, we break application boot into two distinct phases:

\n
    \n
  • Definition time, where all of the classes, templates, and other\ndependencies are loaded (typically in the browser).
  • \n
  • Run time, where we begin executing the application once everything\nhas loaded.
  • \n
\n

Definition time can be expensive and only needs to happen once since it is\nan idempotent operation. For example, between test runs and FastBoot\nrequests, the application stays the same. It is only the state that we want\nto reset.

\n

That state is what the ApplicationInstance manages: it is responsible for\ncreating the container that contains all application state, and disposing of\nit once the particular test run or FastBoot request has finished.

\n", + "access": "public", + "tagname": "", + "extends": "EngineInstance", + "methods": [ + { + "file": "packages/@ember/application/instance.js", + "line": 283, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 62, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 124, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 139, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 167, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 200, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 23, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 49, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 110, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 18, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 31, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 101, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 124, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 134, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 145, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 155, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 165, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 198, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 208, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.js", + "line": 36, + "description": "

The Application for which this is an instance.

\n", + "itemtype": "property", + "name": "application", + "type": "Application", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 44, + "description": "

The DOM events for which the event dispatcher should listen.

\n

By default, the application's Ember.EventDispatcher listens\nfor a set of standard DOM events, such as mousedown and\nkeyup, and delegates them to your application's Ember.View\ninstances.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "customEvents", + "type": "Object", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 57, + "description": "

The root DOM element of the Application as an element or a\nCSS selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "String|DOMElement", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 29, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 15, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-EngineInstance", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-ApplicationInstance.BootOptions-861f5137fd.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-ApplicationInstance.BootOptions-861f5137fd.json new file mode 100644 index 000000000..6b5c4d554 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-ApplicationInstance.BootOptions-861f5137fd.json @@ -0,0 +1,143 @@ +{ + "data": { + "id": "ember-4.2.0-ApplicationInstance.BootOptions", + "type": "class", + "attributes": { + "name": "ApplicationInstance.BootOptions", + "shortname": "ApplicationInstance.BootOptions", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "ApplicationInstance", + "file": "packages/@ember/application/instance.js", + "line": 305, + "description": "

A list of boot-time configuration options for customizing the behavior of\nan ApplicationInstance.

\n

This is an interface class that exists purely to document the available\noptions; you do not need to construct it manually. Simply pass a regular\nJavaScript object containing the desired options into methods that require\none of these options object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Not all combinations of the supported options are valid. See the documentation\non Application#visit for the supported configurations.

\n

Internal, experimental or otherwise unstable flags are marked as private.

\n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.js", + "line": 329, + "description": "

Interactive mode: whether we need to set up event delegation and invoke\nlifecycle callbacks on Components.

\n", + "itemtype": "property", + "name": "isInteractive", + "type": "boolean", + "default": "auto-detected", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 340, + "itemtype": "property", + "name": "_renderMode", + "type": "string", + "default": "false", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 348, + "description": "

Run in a full browser environment.

\n

When this flag is set to false, it will disable most browser-specific\nand interactive features. Specifically:

\n
    \n
  • It does not use jQuery to append the root view; the rootElement\n(either specified as a subsequent option or on the application itself)\nmust already be an Element in the given document (as opposed to a\nstring selector).

    \n
  • \n
  • It does not set up an EventDispatcher.

    \n
  • \n
  • It does not run any Component lifecycle hooks (such as didInsertElement).

    \n
  • \n
  • It sets the location option to "none". (If you would like to use\nthe location adapter specified in the app's router instead, you can also\nspecify { location: null } to specifically opt-out.)

    \n
  • \n
\n", + "itemtype": "property", + "name": "isBrowser", + "type": "boolean", + "default": "auto-detected", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 383, + "description": "

Disable rendering completely.

\n

When this flag is set to false, it will disable the entire rendering\npipeline. Essentially, this puts the app into "routing-only" mode. No\ntemplates will be rendered, and no Components will be created.

\n", + "itemtype": "property", + "name": "shouldRender", + "type": "boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 405, + "description": "

If present, render into the given Document object instead of the\nglobal window.document object.

\n

In practice, this is only useful in non-browser environment or in\nnon-interactive mode, because Ember's jQuery dependency is\nimplicitly bound to the current document, causing event delegation\nto not work properly when the app is rendered into a foreign\ndocument object (such as an iframe's contentDocument).

\n

In non-browser mode, this could be a "Document-like" object as\nEmber only interact with a small subset of the DOM API in non-\ninteractive mode. While the exact requirements have not yet been\nformalized, the SimpleDOM library's implementation is known to\nwork.

\n", + "itemtype": "property", + "name": "document", + "type": "Document", + "default": "the global `document` object", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 432, + "description": "

If present, overrides the application's rootElement property on\nthe instance. This is useful for testing environment, where you\nmight want to append the root view to a fixture area.

\n

In non-browser mode, because Ember does not have access to jQuery,\nthis options must be specified as a DOM Element object instead of\na selector string.

\n

See the documentation on Application's rootElement for\ndetails.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "String|Element", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 457, + "description": "

If present, overrides the router's location property with this\nvalue. This is useful for environments where trying to modify the\nURL would be inappropriate.

\n", + "itemtype": "property", + "name": "location", + "type": "string", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-ArrayProxy-d241bf0163.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-ArrayProxy-d241bf0163.json new file mode 100644 index 000000000..4ad69c981 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-ArrayProxy-d241bf0163.json @@ -0,0 +1,1833 @@ +{ + "data": { + "id": "ember-4.2.0-ArrayProxy", + "type": "class", + "attributes": { + "name": "ArrayProxy", + "shortname": "ArrayProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.js", + "line": 43, + "description": "

An ArrayProxy wraps any other object that implements Array and/or\nMutableArray, forwarding all requests. This makes it very useful for\na number of binding use cases or other cases where being able to swap\nout the underlying array is useful.

\n

A simple example of usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({ content: A(pets) });\n\nap.get('firstObject');                        // 'dog'\nap.set('content', ['amoeba', 'paramecium']);\nap.get('firstObject');                        // 'amoeba'
\n
\n
\n \n

This class can also be useful as a layer to transform the contents of\nan array, as they are accessed. This can be done by overriding\nobjectAtContent:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({\n    content: A(pets),\n    objectAtContent: function(idx) {\n        return this.get('content').objectAt(idx).toUpperCase();\n    }\n});\n\nap.get('firstObject'); // . 'DOG'
\n
\n
\n \n

When overriding this class, it is important to place the call to\n_super after setting content so the internal observers have\na chance to fire properly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nexport default ArrayProxy.extend({\n  init() {\n    this.set('content', A(['dog', 'cat', 'fish']));\n    this._super(...arguments);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.js", + "line": 150, + "description": "

Should actually retrieve the object at the specified index from the\ncontent. You can override this method in subclasses to transform the\ncontent item to something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "objectAtContent", + "params": [ + { + "name": "idx", + "description": "The index to retrieve.", + "type": "Number" + } + ], + "return": { + "description": "the value or undefined if none found", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.js", + "line": 176, + "description": "

Should actually replace the specified objects on the content array.\nYou can override this method in subclasses to transform the content item\ninto something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "replaceContent", + "params": [ + { + "name": "idx", + "description": "The starting index", + "type": "Number" + }, + { + "name": "amt", + "description": "The number of items to remove from the content.", + "type": "Number" + }, + { + "name": "objects", + "description": "Optional array of objects to insert or null if no\n objects.", + "type": "EmberArray" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1348, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray" + } + ], + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1367, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1393, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1415, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1440, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1460, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1480, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1506, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1531, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1551, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumberable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1572, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1591, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1618, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1646, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1663, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1689, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1116, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1154, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1166, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1182, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1215, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1259, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1278, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1300, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.js", + "line": 141, + "description": "

The content array. Must be an object that implements Array and/or\nMutableArray.

\n", + "itemtype": "property", + "name": "content", + "type": "EmberArray", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.js", + "line": 346, + "description": "

The array that the proxy pretends to be. In the default ArrayProxy\nimplementation, this and content are the same. Subclasses of ArrayProxy\ncan override this property to provide things like sorting and filtering.

\n", + "itemtype": "property", + "name": "arrangedContent", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Component-d65aaafd4b.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Component-d65aaafd4b.json new file mode 100644 index 000000000..0fea48b10 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Component-d65aaafd4b.json @@ -0,0 +1,1569 @@ +{ + "data": { + "id": "ember-4.2.0-Component", + "type": "class", + "attributes": { + "name": "Component", + "shortname": "Component", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 37, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault component's for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Classic components. If you are looking for the\nAPI documentation for Template-only or Glimmer components, it is\navailable here.

\n

Defining a Classic Component

\n

If you want to customize the component in order to handle events, transform\narguments or maintain internal state, you implement a subclass of Component.

\n

One example is to add computed properties to your component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  displayName: computed('person.title', 'person.firstName', 'person.lastName', function() {\n    let { title, firstName, lastName } = this.person;\n\n    if (title) {\n      return `${title} ${lastName}`;\n    } else {\n      return `${firstName} ${lastName}`;\n    }\n  })\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

Customizing a Classic Component's HTML Element in JavaScript

\n

HTML Tag

\n

The default HTML tag name used for a component's HTML representation is div.\nThis can be customized by setting the tagName property.

\n

Consider the following component class:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
paragraph.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'em'\n});
\n
\n
\n \n

When invoked, this component would produce output that looks something like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<em id="ember1" class="ember-view"></em>
\n
\n
\n \n

HTML class Attribute

\n

The HTML class attribute of a component's tag can be set by providing a\nclassNames property that is set to an array of strings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class']\n});
\n
\n
\n \n

Invoking this component will produce output that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class"></div>
\n
\n
\n \n

class attribute values can also be set by providing a classNameBindings\nproperty set to an array of properties names for the component. The return\nvalue of these properties will be added as part of the value for the\ncomponents's class attribute. These properties can be computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class'],\n  classNameBindings: ['propertyA', 'propertyB'],\n\n  propertyA: 'from-a',\n  propertyB: computed(function() {\n    if (someLogic) { return 'from-b'; }\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

Note that classNames and classNameBindings is in addition to the class\nattribute passed with the angle bracket invocation syntax. Therefore, if this\ncomponent was invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyWidget class="from-invocation" />
\n
\n
\n \n

The resulting HTML will look similar to this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="from-invocation ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

If the value of a class name binding returns a boolean the property name\nitself will be used as the class name if the property is true. The class name\nwill not be added if the value is false or undefined.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['hovered'],\n\n  hovered: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view hovered"></div>
\n
\n
\n \n

Custom Class Names for Boolean Values

\n

When using boolean class name bindings you can supply a string value other\nthan the property name for use as the class HTML attribute by appending the\npreferred value after a ":" character when defining the binding:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['awesome:so-very-cool'],\n\n  awesome: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view so-very-cool"></div>
\n
\n
\n \n

Boolean value class name bindings whose property names are in a\ncamelCase-style format will be converted to a dasherized format:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isUrgent'],\n\n  isUrgent: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view is-urgent"></div>
\n
\n
\n \n

Class name bindings can also refer to object values that are found by\ntraversing a path relative to the component itself:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport EmberObject from '@ember/object';\n\nexport default Component.extend({\n  classNameBindings: ['messages.empty'],\n\n  messages: EmberObject.create({\n    empty: true\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view empty"></div>
\n
\n
\n \n

If you want to add a class name for a property which evaluates to true and\nand a different class name if it evaluates to false, you can pass a binding\nlike this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isEnabled:enabled:disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view enabled"></div>
\n
\n
\n \n

When isEnabled is false, the resulting HTML representation looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

This syntax offers the convenience to add a class if a property is false:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\n// Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\nexport default Component.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component when the isEnabled property is true will produce\nHTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view"></div>
\n
\n
\n \n

Invoking it when the isEnabled property on the component is false will\nproduce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

Updates to the value of a class name binding will result in automatic update\nof the HTML class attribute in the component's rendered HTML\nrepresentation. If the value becomes false or undefined the class name\nwill be removed.

\n

Both classNames and classNameBindings are concatenated properties. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Other HTML Attributes

\n

The HTML attribute section of a component's tag can be set by providing an\nattributeBindings property set to an array of property names on the component.\nThe return value of these properties will be used as the value of the component's\nHTML associated attribute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['href'],\n\n  href: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

One property can be mapped on to another by placing a ":" between\nthe source property and the destination property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['url:href'],\n\n  url: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

HTML attributes passed with angle bracket invocations will take precedence\nover those specified in attributeBindings. Therefore, if this component was\ninvoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyAnchor href="http://bing.com" @url="http://google.com" />
\n
\n
\n \n

The resulting HTML will looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://bing.com"></a>
\n
\n
\n \n

Note that the href attribute is ultimately set to http://bing.com,\ndespite it having attribute binidng to the url property, which was\nset to http://google.com.

\n

Namespaced attributes (e.g. xlink:href) are supported, but have to be\nmapped, since : is not a valid character for properties in Javascript:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
use.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'use',\n  attributeBindings: ['xlinkHref:xlink:href'],\n\n  xlinkHref: '#triangle'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<use xlink:href="#triangle"></use>
\n
\n
\n \n

If the value of a property monitored by attributeBindings is a boolean, the\nattribute will be present or absent depending on the value:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: false\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id="ember1" class="ember-view" />
\n
\n
\n \n

attributeBindings can refer to computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: computed(function() {\n    if (someLogic) {\n      return true;\n    } else {\n      return false;\n    }\n  })\n});
\n
\n
\n \n

To prevent setting an attribute altogether, use null or undefined as the\nvalue of the property used in attributeBindings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'form',\n  attributeBindings: ['novalidate'],\n  novalidate: null\n});
\n
\n
\n \n

Updates to the property of an attribute binding will result in automatic\nupdate of the HTML attribute in the component's HTML output.

\n

attributeBindings is a concatenated property. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Layouts

\n

The layout property can be used to dynamically specify a template associated\nwith a component class, instead of relying on Ember to link together a\ncomponent class and a template based on file names.

\n

In general, applications should not use this feature, but it's commonly used\nin addons for historical reasons.

\n

The layout property should be set to the default export of a template\nmodule, which is the name of a template file without the .hbs extension.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>Person's Title</h1>\n<div class='details'>{{yield}}</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n
  import Component from '@ember/component';\n  import layout from '../templates/components/person-profile';\n\n  export default Component.extend({\n    layout\n  });
\n
\n
\n \n

If you invoke the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile>\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</PersonProfile>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#person-profile}}\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n{{/person-profile}}
\n
\n
\n \n

It will result in the following HTML output:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<h1>Person's Title</h1>\n  <div class="details">\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</div>
\n
\n
\n \n

Handling Browser Events

\n

Components can respond to user-initiated events in one of three ways: passing\nactions with angle bracket invocation, adding event handler methods to the\ncomponent's class, or adding actions to the component's template.

\n

Passing Actions With Angle Bracket Invocation

\n

For one-off events specific to particular instance of a component, it is possible\nto pass actions to the component's element using angle bracket invocation syntax.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyWidget {{action 'firstWidgetClicked'}} />\n\n<MyWidget {{action 'secondWidgetClicked'}} />
\n
\n
\n \n

In this case, when the first component is clicked on, Ember will invoke the\nfirstWidgetClicked action. When the second component is clicked on, Ember\nwill invoke the secondWidgetClicked action instead.

\n

Besides {{action}}, it is also possible to pass any arbitrary element modifiers\nusing the angle bracket invocation syntax.

\n

Event Handler Methods

\n

Components can also respond to user-initiated events by implementing a method\nthat matches the event name. This approach is appropriate when the same event\nshould be handled by all instances of the same component.

\n

An event object will be passed as the argument to the event handler method.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click(event) {\n    // `event.target` is either the component's element or one of its children\n    let tag = event.target.tagName.toLowerCase();\n    console.log('clicked on a `<${tag}>` HTML element!');\n  }\n});
\n
\n
\n \n

In this example, whenever the user clicked anywhere inside the component, it\nwill log a message to the console.

\n

It is possible to handle event types other than click by implementing the\nfollowing event handler methods. In addition, custom events can be registered\nby using Application.customEvents.

\n

Touch events:

\n
    \n
  • touchStart
  • \n
  • touchMove
  • \n
  • touchEnd
  • \n
  • touchCancel
  • \n
\n

Keyboard events:

\n
    \n
  • keyDown
  • \n
  • keyUp
  • \n
  • keyPress
  • \n
\n

Mouse events:

\n
    \n
  • mouseDown
  • \n
  • mouseUp
  • \n
  • contextMenu
  • \n
  • click
  • \n
  • doubleClick
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
\n

Form events:

\n
    \n
  • submit
  • \n
  • change
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
  • input
  • \n
\n

Drag and drop events:

\n
    \n
  • dragStart
  • \n
  • drag
  • \n
  • dragEnter
  • \n
  • dragLeave
  • \n
  • dragOver
  • \n
  • dragEnd
  • \n
  • drop
  • \n
\n

{{action}} Helper

\n

Instead of handling all events of a particular type anywhere inside the\ncomponent's element, you may instead want to limit it to a particular\nelement in the component's template. In this case, it would be more\nconvenient to implement an action instead.

\n

For example, you could implement the action hello for the person-profile\ncomponent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  actions: {\n    hello(name) {\n      console.log("Hello", name);\n    }\n  }\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
<h1>{{@person.name}}</h1>\n\n<button {{action 'hello' @person.name}}>\n  Say Hello to {{@person.name}}\n</button>
\n
\n
\n \n

When the user clicks the button, Ember will invoke the hello action,\npassing in the current value of @person.name as an argument.

\n

See Ember.Templates.helpers.action.

\n", + "extends": "Ember.CoreView", + "uses": [ + "Ember.ViewStateSupport", + "Ember.ViewMixin", + "Ember.ActionSupport", + "Ember.ClassNamesSupport", + "Ember.TargetActionSupport" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 752, + "description": "

Normally, Ember's component model is "write-only". The component takes a\nbunch of attributes that it got passed in, and uses them to render its\ntemplate.

\n

One nice thing about this model is that if you try to set a value to the\nsame thing as last time, Ember (through HTMLBars) will avoid doing any\nwork on the DOM.

\n

This is not just a performance optimization. If an attribute has not\nchanged, it is important not to clobber the element's "hidden state".\nFor example, if you set an input's value to the same value as before,\nit will clobber selection state and cursor position. In other words,\nsetting an attribute is not always idempotent.

\n

This method provides a way to read an element's attribute and also\nupdate the last value Ember knows about at the same time. This makes\nsetting an attribute idempotent.

\n

In particular, what this means is that if you get an <input> element's\nvalue attribute and then re-render the template with the same value,\nit will avoid clobbering the cursor and selection position.\nSince most attribute sets are idempotent in the browser, you typically\ncan get away with reading attributes using jQuery, but the most reliable\nway to do so is through this method.

\n", + "itemtype": "method", + "name": "readDOMAttr", + "params": [ + { + "name": "name", + "description": "the name of the attribute", + "type": "String" + } + ], + "return": { + "description": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 879, + "description": "

Called when the attributes passed into the component have been updated.\nCalled both during the initial render of a container and during a rerender.\nCan be used in place of an observer; code placed here will be executed\nevery time any attribute updates.

\n", + "itemtype": "method", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 900, + "description": "

Called after a component has been rendered, both on initial render and\nin subsequent rerenders.

\n", + "itemtype": "method", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 917, + "description": "

Called before a component has been rendered, both on initial render and\nin subsequent rerenders.

\n", + "itemtype": "method", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 934, + "description": "

Called when the attributes passed into the component have been changed.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 951, + "description": "

Called when the component is about to update and rerender itself.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 968, + "description": "

Called when the component has updated and rerendered itself.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 41, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 62, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 82, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 114, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 156, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 165, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 180, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 196, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 212, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.js", + "line": 52, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 70, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 96, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 116, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 156, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 214, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 299, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 373, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 409, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.js", + "line": 41, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.TargetActionSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 167, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 54, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 80, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 101, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 124, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 139, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 430, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Mixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 890, + "description": "

Called when the attributes passed into the component have been updated.\nCalled both during the initial render of a container and during a rerender.\nCan be used in place of an observer; code placed here will be executed\nevery time any attribute updates.

\n", + "itemtype": "event", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 909, + "description": "

Called after a component has been rendered, both on initial render and\nin subsequent rerenders.

\n", + "itemtype": "event", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 926, + "description": "

Called before a component has been rendered, both on initial render and\nin subsequent rerenders.

\n", + "itemtype": "event", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 943, + "description": "

Called when the attributes passed into the component have been changed.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 960, + "description": "

Called when the component is about to update and rerender itself.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 977, + "description": "

Called when the component has updated and rerendered itself.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 268, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 276, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 289, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 313, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 326, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 334, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 803, + "description": "

The WAI-ARIA role of the control represented by this view. For example, a\nbutton may have a role of type 'button', or a pane may have a role of\ntype 'alertdialog'. This property is used by assistive software to help\nvisually challenged users navigate rich web applications.

\n

The full list of valid WAI-ARIA roles is available at:\nhttps://www.w3.org/TR/wai-aria/#roles_categorization

\n", + "itemtype": "property", + "name": "ariaRole", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 818, + "description": "

Enables components to take a list of parameters as arguments.\nFor example, a component that takes two parameters with the names\nname and age:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: ['name', 'age']\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" 38}}
\n
\n
\n \n

The parameters can be referred to just like named parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Name: {{name}}, Age: {{age}}.
\n
\n
\n \n

Using a string instead of an array allows for an arbitrary number of\nparameters:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: 'names'\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" "Michael" "Scott"}}
\n
\n
\n \n

The parameters can then be referred to by enumerating over the list:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{#each names as |name|}}{{name}}{{/each}}
\n
\n
\n \n", + "static": 1, + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "positionalParams", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 985, + "description": "

Layout can be used to wrap content in a component.

\n", + "itemtype": "property", + "name": "layout", + "type": "Function", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 992, + "description": "

The name of the layout to lookup if no layout is provided.\nBy default Component will lookup a template with this name in\nEmber.TEMPLATES (a shared global object).

\n", + "itemtype": "property", + "name": "layoutName", + "type": "String", + "default": "null", + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1002, + "description": "

The HTML id of the component's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent @elementId="a-really-cool-id" />
\n
\n
\n \n

If not manually set a default value will be provided by the framework.\nOnce rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
export default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    var index = this.get('index');\n    this.set('elementId', `component-id${index}`);\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.js", + "line": 34, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 12, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 141, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 235, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 346, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/child_views_support.js", + "line": 8, + "description": "

Array of child views. You should never edit this array directly.

\n", + "itemtype": "property", + "name": "childViews", + "type": "Array", + "default": "[]", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.js", + "line": 31, + "description": "

Standard CSS class names to apply to the view's outer element. This\nproperty automatically inherits any class names defined by the view's\nsuperclasses as well.

\n", + "itemtype": "property", + "name": "classNames", + "type": "Array", + "default": "['ember-view']", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.js", + "line": 43, + "description": "

A list of properties of the view to apply as class names. If the property\nis a string value, the value of that string will be applied as a class\nname.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'high' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['priority'],\n  priority: 'high'\n});
\n
\n
\n \n

If the value of the property is a Boolean, the name of that property is\nadded as a dasherized class name.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'is-urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would prefer to use a custom value instead of the dasherized\nproperty name, you can pass a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent:urgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would like to specify a class that should only be added when the\nproperty is false, you can declare a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'disabled' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: false\n});
\n
\n
\n \n

This list of properties is inherited from the component's superclasses as well.

\n", + "itemtype": "property", + "name": "classNameBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 22, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-Ember.CoreView", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-ComputedProperty-47a677369f.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-ComputedProperty-47a677369f.json new file mode 100644 index 000000000..7b35d9698 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-ComputedProperty-47a677369f.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-4.2.0-ComputedProperty", + "type": "class", + "attributes": { + "name": "ComputedProperty", + "shortname": "ComputedProperty", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 55, + "description": "

@computed is a decorator that turns a JavaScript getter and setter into a\ncomputed property, which is a cached, trackable value. By default the getter\nwill only be called once and the result will be cached. You can specify\nvarious properties that your computed property depends on. This will force the\ncached result to be cleared if the dependencies are modified, and lazily recomputed the next time something asks for it.

\n

In the following example we decorate a getter - fullName - by calling\ncomputed with the property dependencies (firstName and lastName) as\narguments. The fullName getter will be called once (regardless of how many\ntimes it is accessed) as long as its dependencies do not change. Once\nfirstName or lastName are updated any future calls to fullName will\nincorporate the new values, and any watchers of the value such as templates\nwill be updated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet tom = new Person('Tom', 'Dale');\n\ntom.fullName; // 'Tom Dale'
\n
\n
\n \n

You can also provide a setter, which will be used when updating the computed\nproperty. Ember's set function must be used to update the property\nsince it will also notify observers of the property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(' ');\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

You can also pass a getter function or object with get and set functions\nas the last argument to the computed decorator. This allows you to define\ncomputed property macros:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { computed } from '@ember/object';\n\nfunction join(...keys) {\n  return computed(...keys, function() {\n    return keys.map(key => this[key]).join(' ');\n  });\n}\n\nclass Person {\n  @join('firstName', 'lastName')\n  fullName;\n}
\n
\n
\n \n

Note that when defined this way, getters and setters receive the key of the\nproperty they are decorating as the first argument. Setters receive the value\nthey are setting to as the second argument instead. Additionally, setters must\nreturn the value that should be cached:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { computed, set } from '@ember/object';\n\nfunction fullNameMacro(firstNameKey, lastNameKey) {\n  return computed(firstNameKey, lastNameKey, {\n    get() {\n      return `${this[firstNameKey]} ${this[lastNameKey]}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, firstNameKey, firstName);\n      set(this, lastNameKey, lastName);\n\n      return value;\n    }\n  });\n}\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @fullNameMacro('firstName', 'lastName') fullName;\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

Computed properties can also be used in classic classes. To do this, we\nprovide the getter and setter as the last argument like we would for a macro,\nand we assign it to a property on the class definition. This is an anonymous\ncomputed macro:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import EmberObject, { computed, set } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  // these will be supplied by `create`\n  firstName: null,\n  lastName: null,\n\n  fullName: computed('firstName', 'lastName', {\n    get() {\n      return `${this.firstName} ${this.lastName}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, 'firstName', firstName);\n      set(this, 'lastName', lastName);\n\n      return value;\n    }\n  })\n});\n\nlet tom = Person.create({\n  firstName: 'Tom',\n  lastName: 'Dale'\n});\n\ntom.get('fullName') // 'Tom Dale'
\n
\n
\n \n

You can overwrite computed property without setters with a normal property (no\nlonger computed) that won't change if dependencies change. You can also mark\ncomputed property as .readOnly() and block all attempts to set it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName').readOnly()\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet person = new Person();\nperson.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX>
\n
\n
\n \n

Additional resources:

\n\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 583, + "description": "

Call on a computed property to set it into read-only mode. When in this\nmode the computed property will throw an error when set.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  @computed().readOnly()\n  get guid() {\n    return 'guid-guid-guid';\n  }\n}\n\nlet person = new Person();\nset(person, 'guid', 'new-guid'); // will throw an exception
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  guid: computed(function() {\n    return 'guid-guid-guid';\n  }).readOnly()\n});\n\nlet person = Person.create();\nperson.set('guid', 'new-guid'); // will throw an exception
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "return": { + "description": "this", + "type": "ComputedProperty" + }, + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 633, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For example,\ncomputed property functions may close over variables that are then no longer\navailable for introspection. You can pass a hash of these values to a\ncomputed property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nclass Store {\n  @computed().meta({ type: Person })\n  get person() {\n    let personId = this.personId;\n    return Person.create({ id: personId });\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nconst Store = EmberObject.extend({\n  person: computed(function() {\n    let personId = this.get('personId');\n    return Person.create({ id: personId });\n  }).meta({ type: Person })\n});
\n
\n
\n \n

The hash that you pass to the meta() function will be saved on the\ncomputed property descriptor under the _meta key. Ember runtime\nexposes a public API for retrieving these values from classes,\nvia the metaForProperty() function.

\n", + "itemtype": "method", + "name": "meta", + "params": [ + { + "name": "meta", + "description": "", + "type": "Object" + } + ], + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Container-c4396f09a6.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Container-c4396f09a6.json new file mode 100644 index 000000000..317b0bfc8 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Container-c4396f09a6.json @@ -0,0 +1,197 @@ +{ + "data": { + "id": "ember-4.2.0-Container", + "type": "class", + "attributes": { + "name": "Container", + "shortname": "Container", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 58, + "description": "

A container used to instantiate and cache objects.

\n

Every Container must be associated with a Registry, which is referenced\nto determine the factory and options that should be used to instantiate\nobjects.

\n

The public API for Container is still in flux and should not be considered\nstable.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 117, + "description": "

Given a fullName return a corresponding instance.\n The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter');\ntwitter instanceof Twitter; // => true\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted, an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "The fullname of the request source (used for local lookup)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 157, + "description": "

A depth first traversal, destroying the container, its descendant containers and all\ntheir managed objects.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "destroy", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 174, + "description": "

Clear either the entire cache or just the cache for a particular key.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "params": [ + { + "name": "fullName", + "description": "optional key to reset; if missing, resets everything", + "type": "String" + } + ], + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 191, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "return": { + "description": "", + "type": "Object" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 204, + "description": "

Given a fullName, return the corresponding factory. The consumer of the factory\nis responsible for the destruction of any factory instances, as there is no\nway for the container to ensure instances are destroyed when it itself is\ndestroyed.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "The fullname of the request source (used for local lookup)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 98, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registry", + "type": "Registry", + "since": "1.11.0", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 105, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "cache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 111, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "validationCache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-ContainerDebugAdapter-95b28a34d2.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-ContainerDebugAdapter-95b28a34d2.json new file mode 100644 index 000000000..0448df2a4 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-ContainerDebugAdapter-95b28a34d2.json @@ -0,0 +1,593 @@ +{ + "data": { + "id": "ember-4.2.0-ContainerDebugAdapter", + "type": "class", + "attributes": { + "name": "ContainerDebugAdapter", + "shortname": "ContainerDebugAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.js", + "line": 9, + "description": "

The ContainerDebugAdapter helps the container and resolver interface\nwith tools that debug Ember such as the\nEmber Inspector\nfor Chrome and Firefox.

\n

This class can be extended by a custom resolver implementer\nto override some of the methods with library-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • canCatalogEntriesByType
  • \n
  • catalogEntriesByType
  • \n
\n

The adapter will need to be registered\nin the application's container as container-debug-adapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "containerDebugAdapter",\n\n  initialize(application) {\n    application.register('container-debug-adapter:main', require('app/container-debug-adapter'));\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "since": "1.5.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.js", + "line": 61, + "description": "

Returns true if it is possible to catalog a list of available\nclasses in the resolver for a given type.

\n", + "itemtype": "method", + "name": "canCatalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "whether a list is available for this type.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.js", + "line": 78, + "description": "

Returns the available classes a given type.

\n", + "itemtype": "method", + "name": "catalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "An array of strings.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.js", + "line": 50, + "description": "

The resolver instance of the application\nbeing debugged. This property will be injected\non creation.

\n", + "itemtype": "property", + "name": "resolver", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-ContainerProxyMixin-fd281e03ec.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-ContainerProxyMixin-fd281e03ec.json new file mode 100644 index 000000000..77104b68e --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-ContainerProxyMixin-fd281e03ec.json @@ -0,0 +1,131 @@ +{ + "data": { + "id": "ember-4.2.0-ContainerProxyMixin", + "type": "class", + "attributes": { + "name": "ContainerProxyMixin", + "shortname": "ContainerProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 7, + "description": "

ContainerProxyMixin is used to provide public access to specific\ncontainer functionality.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 23, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "ContainerProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 49, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ContainerProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 110, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ContainerProxyMixin", + "module": "ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 15, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ContainerProxyMixin", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Controller-0ceb718a53.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Controller-0ceb718a53.json new file mode 100644 index 000000000..cb4840b1b --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Controller-0ceb718a53.json @@ -0,0 +1,716 @@ +{ + "data": { + "id": "ember-4.2.0-Controller", + "type": "class", + "attributes": { + "name": "Controller", + "shortname": "Controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "", + "file": "packages/@ember/controller/index.js", + "line": 9, + "extends": "EmberObject", + "uses": [ + "Ember.ControllerMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 50, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 71, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 92, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "itemtype": "method", + "name": "transitionToRoute", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 177, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + } + ], + "itemtype": "method", + "name": "replaceRoute", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 167, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 22, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 21, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 41, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 22, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-CoreObject-e0de4910c5.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-CoreObject-e0de4910c5.json new file mode 100644 index 000000000..ba37a4f11 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-CoreObject-e0de4910c5.json @@ -0,0 +1,158 @@ +{ + "data": { + "id": "ember-4.2.0-CoreObject", + "type": "class", + "attributes": { + "name": "CoreObject", + "shortname": "CoreObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 137, + "description": "

CoreObject is the base class for all Ember constructs. It establishes a\nclass system based on Ember's Mixin system, and provides the basis for the\nEmber Object Model. CoreObject should generally not be used directly,\ninstead you should use EmberObject.

\n

Usage

\n

You can define a class by extending from CoreObject using the extend\nmethod:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Person = CoreObject.extend({\n  name: 'Tomster',\n});
\n
\n
\n \n

For detailed usage, see the Object Model\nsection of the guides.

\n

Usage with Native Classes

\n

Native JavaScript class syntax can be used to extend from any CoreObject\nbased class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
class Person extends CoreObject {\n  init() {\n    super.init(...arguments);\n    this.name = 'Tomster';\n  }\n}
\n
\n
\n \n

Some notes about class usage:

\n
    \n
  • new syntax is not currently supported with classes that extend from\nEmberObject or CoreObject. You must continue to use the create method\nwhen making new instances of classes, even if they are defined using native\nclass syntax. If you want to use new syntax, consider creating classes\nwhich do not extend from EmberObject or CoreObject. Ember features,\nsuch as computed properties and decorators, will still work with base-less\nclasses.
  • \n
  • Instead of using this._super(), you must use standard super syntax in\nnative classes. See the MDN docs on classes\nfor more details.
  • \n
  • Native classes support using constructors\nto set up newly-created instances. Ember uses these to, among other things,\nsupport features that need to retrieve other entities by name, like Service\ninjection and getOwner. To ensure your custom instance setup logic takes\nplace after this important work is done, avoid using the constructor in\nfavor of init.
  • \n
  • Properties passed to create will be available on the instance by the time\ninit runs, so any code that requires these values should work at that\ntime.
  • \n
  • Using native classes, and switching back to the old Ember Object model is\nfully supported.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.2.0-Helper" + }, + { + "type": "class", + "id": "ember-4.2.0-EmberObject" + } + ] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-DataAdapter-a72d2d9849.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-DataAdapter-a72d2d9849.json new file mode 100644 index 000000000..fc743704c --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-DataAdapter-a72d2d9849.json @@ -0,0 +1,935 @@ +{ + "data": { + "id": "ember-4.2.0-DataAdapter", + "type": "class", + "attributes": { + "name": "DataAdapter", + "shortname": "DataAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 125, + "description": "

The DataAdapter helps a data persistence library\ninterface with tools that debug Ember such\nas the Ember Inspector\nfor Chrome and Firefox.

\n

This class will be extended by a persistence library\nwhich will override some of the methods with\nlibrary-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • getFilters
  • \n
  • detect
  • \n
  • columnsForType
  • \n
  • getRecords
  • \n
  • getRecordColumnValues
  • \n
  • getRecordKeywords
  • \n
  • getRecordFilterValues
  • \n
  • getRecordColor
  • \n
\n

The adapter will need to be registered\nin the application's container as dataAdapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "data-adapter",\n\n  initialize: function(application) {\n    application.register('data-adapter:main', DS.DataAdapter);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 248, + "description": "

Specifies how records can be filtered.\nRecords returned will need to have a filterValues\nproperty with a key for every name in the returned array.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getFilters", + "return": { + "description": "List of objects defining filters.\n The object should have a `name` and `desc` property.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 262, + "description": "

Fetch the model types and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchModelTypes", + "params": [ + { + "name": "typesAdded", + "description": "Callback to call to add types.\nTakes an array of objects containing wrapped types (returned from `wrapModelType`).", + "type": "Function" + }, + { + "name": "typesUpdated", + "description": "Callback to call when a type has changed.\nTakes an array of objects containing wrapped types.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 307, + "description": "

Fetch the records of a given type and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchRecords", + "params": [ + { + "name": "modelName", + "description": "The model name.", + "type": "String" + }, + { + "name": "recordsAdded", + "description": "Callback to call to add records.\nTakes an array of objects containing wrapped records.\nThe object should have the following properties:\n columnValues: {Object} The key and value of a table cell.\n object: {Object} The actual record object.", + "type": "Function" + }, + { + "name": "recordsUpdated", + "description": "Callback to call when a record has changed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + }, + { + "name": "recordsRemoved", + "description": "Callback to call when a record has removed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 374, + "description": "

Clear all observers before destruction

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 392, + "description": "

Detect whether a class is a model.

\n

Test that against the model class\nof your persistence library.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "detect", + "return": { + "description": "boolean Whether the class is a model class or not." + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 406, + "description": "

Get the columns for a given model type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "columnsForType", + "return": { + "description": "An array of columns of the following format:\n name: {String} The name of the column.\n desc: {String} Humanized description (what would show in a table column name).", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 419, + "description": "

Adds observers to a model type class.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "observeModelType", + "params": [ + { + "name": "modelName", + "description": "The model type name.", + "type": "String" + }, + { + "name": "typesUpdated", + "description": "Called when a type is modified.", + "type": "Function" + } + ], + "return": { + "description": "The function to call to remove observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 456, + "description": "

Wraps a given model type and observes changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapModelType", + "params": [ + { + "name": "klass", + "description": "A model class.", + "type": "Class" + }, + { + "name": "modelName", + "description": "Name of the class.", + "type": "String" + } + ], + "return": { + "description": "Contains the wrapped type and the function to remove observers\nFormat:\n type: {Object} The wrapped type.\n The wrapped type has the following format:\n name: {String} The name of the type.\n count: {Integer} The number of records available.\n columns: {Columns} An array of columns to describe the record.\n object: {Class} The actual Model type class.\n release: {Function} The function to remove observers.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 487, + "description": "

Fetches all models defined in the application.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getModelTypes", + "return": { + "description": "Array of model types.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 516, + "description": "

Loops over all namespaces and all objects\nattached to them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getObjectsOnNamespaces", + "return": { + "description": "Array of model type strings.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 545, + "description": "

Fetches all loaded records for a given type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecords", + "return": { + "description": "An array of records.\n This array will be observed for changes,\n so it should update when new records are added/removed.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 558, + "description": "

Wraps a record and observers changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapRecord", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The wrapped record. Format:\ncolumnValues: {Array}\nsearchKeywords: {Array}", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 579, + "description": "

Gets the values for each column.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColumnValues", + "return": { + "description": "Keys should match column names defined\nby the model type.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 591, + "description": "

Returns keywords to match when searching records.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordKeywords", + "return": { + "description": "Relevant keywords for search.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 602, + "description": "

Returns the values of filters defined by getFilters.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordFilterValues", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The filter values.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 614, + "description": "

Each record can have a color that represents its state.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColor", + "params": [ + { + "name": "record", + "description": "The record instance", + "type": "Object" + } + ], + "return": { + "description": "The records color.\n Possible options: black, red, blue, green.", + "type": "String" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 177, + "description": "

The container-debug-adapter which is used\nto list all models.

\n", + "itemtype": "property", + "name": "containerDebugAdapter", + "default": "undefined", + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 187, + "description": "

The number of attributes to send\nas columns. (Enough to make the record\nidentifiable).

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "attributeLimit", + "default": "3", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 199, + "description": "

Ember Data > v1.0.0-beta.18\nrequires string model names to be passed\naround instead of the actual factories.

\n

This is a stamp for the Ember Inspector\nto differentiate between the versions\nto be able to support older versions too.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "acceptsModelName", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 213, + "description": "

Map from records arrays to RecordsWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "recordsWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 221, + "description": "

Map from records arrays to TypeWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "typeWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 229, + "description": "

Callback that is currently scheduled on backburner end to flush and check\nall active watchers.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "flushWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 239, + "description": "

Stores all methods that clear observers.\nThese methods will be called on destruction.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "releaseMethods", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.ActionHandler-dd0b12c50d.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.ActionHandler-dd0b12c50d.json new file mode 100644 index 000000000..472014618 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.ActionHandler-dd0b12c50d.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.2.0-Ember.ActionHandler", + "type": "class", + "attributes": { + "name": "Ember.ActionHandler", + "shortname": "Ember.ActionHandler", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.ControllerMixin", + "Ember.CoreView" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 8, + "description": "

Ember.ActionHandler is available on some familiar classes including\nRoute, Component, and Controller.\n(Internally the mixin is used by Ember.CoreView, Ember.ControllerMixin,\nand Route and available to the above classes through\ninheritance.)

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 167, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 22, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.ControllerMixin-1f376906a2.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.ControllerMixin-1f376906a2.json new file mode 100644 index 000000000..5d847bf4f --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.ControllerMixin-1f376906a2.json @@ -0,0 +1,215 @@ +{ + "data": { + "id": "ember-4.2.0-Ember.ControllerMixin", + "type": "class", + "attributes": { + "name": "Ember.ControllerMixin", + "shortname": "Ember.ControllerMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Controller" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 11, + "uses": [ + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 50, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 71, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 92, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "itemtype": "method", + "name": "transitionToRoute", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 177, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + } + ], + "itemtype": "method", + "name": "replaceRoute", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 167, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 22, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 21, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 41, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 22, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.CoreView-f418d982ed.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.CoreView-f418d982ed.json new file mode 100644 index 000000000..ac379cae0 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.CoreView-f418d982ed.json @@ -0,0 +1,933 @@ +{ + "data": { + "id": "ember-4.2.0-Ember.CoreView", + "type": "class", + "attributes": { + "name": "Ember.CoreView", + "shortname": "Ember.CoreView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/views/core_view.js", + "line": 5, + "description": "

Ember.CoreView is an abstract class that exists to give view-like behavior\nto both Ember's main view class Component and other classes that don't need\nthe full functionality of Component.

\n

Unless you have specific needs for CoreView, you will use Component\nin your applications.

\n", + "extends": "EmberObject", + "deprecated": true, + "deprecationMessage": "Use `Component` instead.", + "uses": [ + "Evented", + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 41, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 62, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 82, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 114, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 156, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 165, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 180, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 196, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 212, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.js", + "line": 52, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 54, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 80, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 101, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 124, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 139, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 167, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/views/core_view.js", + "line": 34, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 22, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.2.0-Component" + } + ] + }, + "module": { + "data": { + "id": "ember-4.2.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.EventDispatcher-1b58df40c5.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.EventDispatcher-1b58df40c5.json new file mode 100644 index 000000000..12b2347c1 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.EventDispatcher-1b58df40c5.json @@ -0,0 +1,174 @@ +{ + "data": { + "id": "ember-4.2.0-Ember.EventDispatcher", + "type": "class", + "attributes": { + "name": "Ember.EventDispatcher", + "shortname": "Ember.EventDispatcher", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 15, + "description": "

Ember.EventDispatcher handles delegating browser events to their\ncorresponding Ember.Views. For example, when you click on a view,\nEmber.EventDispatcher ensures that that view's mouseDown method gets\ncalled.

\n", + "access": "private", + "tagname": "", + "extends": "Ember.Object", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 112, + "description": "

Sets up event listeners for standard browser events.

\n

This will be called after the browser sends a DOMContentReady event. By\ndefault, it will set up all of the listeners on the document body. If you\nwould like to register the listeners on a different element, set the event\ndispatcher's root property.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "params": [ + { + "name": "addedEvents", + "description": "", + "type": "Object" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 202, + "description": "

Setup event listeners for the given browser event name

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForBrowserEvent", + "params": [ + { + "name": "event", + "description": "the name of the event in the browser" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 213, + "description": "

Setup event listeners for the given Ember event name (camel case)

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForEmberEvent", + "params": [ + { + "name": "eventName", + "description": "" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 228, + "description": "

Registers an event listener on the rootElement. If the given event is\ntriggered, the provided event handler will be triggered on the target view.

\n

If the target view does not implement the event handler, or if the handler\nreturns false, the parent view will be called. The event will continue to\nbubble to each successive parent view until it reaches the top.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandler", + "params": [ + { + "name": "rootElement", + "description": "", + "type": "Element" + }, + { + "name": "event", + "description": "the name of the event in the browser", + "type": "String" + }, + { + "name": "eventName", + "description": "the name of the method to call on the view", + "type": "String" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/system/action_manager.js", + "line": 7, + "description": "

Global action id hash.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registeredActions", + "type": "Object", + "class": "Ember.EventDispatcher", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 27, + "description": "

The set of events names (and associated handler function names) to be setup\nand dispatched by the EventDispatcher. Modifications to this list can be done\nat setup time, generally via the Application.customEvents hash.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "events", + "type": "Object", + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 87, + "description": "

The root DOM element to which event listeners should be attached. Event\nlisteners will be attached to the document unless this is overridden.

\n

Can be specified as a DOMElement or a selector string.

\n

The default body is a string since this may be evaluated before document.body\nexists in the DOM.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.Object", + "type": "missing" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.Namespace-a880994e53.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.Namespace-a880994e53.json new file mode 100644 index 000000000..4a5f7b926 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.Namespace-a880994e53.json @@ -0,0 +1,541 @@ +{ + "data": { + "id": "ember-4.2.0-Ember.Namespace", + "type": "class", + "attributes": { + "name": "Ember.Namespace", + "shortname": "Ember.Namespace", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/system/namespace.js", + "line": 18, + "description": "

A Namespace is an object usually used to contain other objects or methods\nsuch as an application or framework. Create a namespace anytime you want\nto define one of these new containers.

\n

Example Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
MyFramework = Ember.Namespace.create({\n  VERSION: '1.0.0'\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.2.0-Engine" + } + ] + }, + "module": { + "data": { + "id": "ember-4.2.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.NativeArray-d126a78662.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.NativeArray-d126a78662.json new file mode 100644 index 000000000..a25aa1584 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.NativeArray-d126a78662.json @@ -0,0 +1,1635 @@ +{ + "data": { + "id": "ember-4.2.0-Ember.NativeArray", + "type": "class", + "attributes": { + "name": "Ember.NativeArray", + "shortname": "Ember.NativeArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1747, + "description": "

The NativeArray mixin contains the properties needed to make the native\nArray support MutableArray and all of its dependent APIs. Unless you\nhave EmberENV.EXTEND_PROTOTYPES or EmberENV.EXTEND_PROTOTYPES.Array set to\nfalse, this will be applied automatically. Otherwise you can apply the mixin\nat anytime by calling Ember.NativeArray.apply(Array.prototype).

\n", + "uses": [ + "Observable", + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1348, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1367, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1393, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1415, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1440, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1460, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1480, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1506, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1531, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1551, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumberable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1572, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1591, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1618, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1646, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1663, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1689, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1116, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1154, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1166, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1182, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1215, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1259, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1278, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1300, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.TargetActionSupport-ffafc58ad7.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.TargetActionSupport-ffafc58ad7.json new file mode 100644 index 000000000..03017c330 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.TargetActionSupport-ffafc58ad7.json @@ -0,0 +1,101 @@ +{ + "data": { + "id": "ember-4.2.0-Ember.TargetActionSupport", + "type": "class", + "attributes": { + "name": "Ember.TargetActionSupport", + "shortname": "Ember.TargetActionSupport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.js", + "line": 10, + "description": "

Ember.TargetActionSupport is a mixin that can be included in a class\nto add a triggerAction method with semantics similar to the Handlebars\n{{action}} helper. In normal Ember usage, the {{action}} helper is\nusually the best choice. This mixin is most often useful when you are\ndoing more complex event handling in Components.

\n", + "extends": "Mixin", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.js", + "line": 41, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 430, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Mixin" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-Mixin", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.Templates.components-4ce2e39e53.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.Templates.components-4ce2e39e53.json new file mode 100644 index 000000000..5476d3571 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.Templates.components-4ce2e39e53.json @@ -0,0 +1,85 @@ +{ + "data": { + "id": "ember-4.2.0-Ember.Templates.components", + "type": "class", + "attributes": { + "name": "Ember.Templates.components", + "shortname": "Ember.Templates.components", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 66, + "description": "

The Input component lets you create an HTML <input> element.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value="987" />
\n
\n
\n \n

creates an <input> element with type="text" and value set to 987.

\n

Text field

\n

If no type argument is specified, a default of type 'text' is used.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Search:\n<Input @value={{this.searchWord}} />
\n
\n
\n \n

In this example, the initial value in the <input> will be set to the value of\nthis.searchWord. If the user changes the text, the value of this.searchWord will also be\nupdated.

\n

Actions

\n

The Input component takes a number of arguments with callbacks that are invoked in response to\nuser events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-down
  • \n
  • key-press
  • \n
  • key-up
  • \n
\n

These callbacks are passed to Input like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Starting with Ember Octane, we recommend using the {{on}} modifier to call actions\non specific events, such as the input event.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
<label for="input-name">Name:</label>\n<Input\n  @id="input-name"\n  @value={{this.name}}\n  {{on "input" this.validateName}}\n/>
\n
\n
\n \n

The event name (e.g. focusout, input, keydown) always follows the casing\nthat the HTML standard uses.

\n

<input> HTML Attributes to Avoid

\n

In most cases, if you want to pass an attribute to the underlying HTML <input> element, you\ncan pass the attribute directly, just like any other Ember component.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @type="text" size="10" />
\n
\n
\n \n

In this example, the size attribute will be applied to the underlying <input> element in the\noutputted HTML.

\n

However, there are a few attributes where you must use the @ version.

\n
    \n
  • @type: This argument is used to control which Ember component is used under the hood
  • \n
  • @value: The @value argument installs a two-way binding onto the element. If you wanted a\none-way binding, use <input> with the value property and the input event instead.
  • \n
  • @checked (for checkboxes): like @value, the @checked argument installs a two-way binding\nonto the element. If you wanted a one-way binding, use <input type="checkbox"> with\nchecked and the input event instead.
  • \n
\n

Extending TextField

\n

Internally, <Input @type="text" /> creates an instance of TextField, passing arguments from\nthe helper to TextField's create method. Subclassing TextField is supported but not\nrecommended.

\n

See TextField

\n

Checkbox

\n

To create an <input type="checkbox">:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Emberize Everything:\n<Input @type="checkbox" @checked={{this.isEmberized}} name="isEmberized" />
\n
\n
\n \n

This will bind the checked state of this checkbox to the value of isEmberized -- if either one\nchanges, it will be reflected in the other.

\n

Extending Checkbox

\n

Internally, <Input @type="checkbox" /> creates an instance of Checkbox. Subclassing\nTextField is supported but not recommended.

\n

See Checkbox

\n", + "itemtype": "method", + "name": "Input", + "see": [ + "{TextField}", + "{Checkbox}" + ], + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 40, + "description": "

The LinkTo component renders a link to the supplied routeName passing an optionally\nsupplied model to the route as its model context of the route. The block for LinkTo\nbecomes the contents of the rendered element:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

Disabling the LinkTo component

\n

The LinkTo component can be disabled by using the disabled argument. A disabled link\ndoesn't result in a transition when activated, and adds the disabled class to the <a>\nelement.

\n

(The class name to apply to the element can be overridden by using the disabledClass\nargument)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @disabled={{true}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

Handling href

\n

<LinkTo> will use your application's Router to fill the element's href property with a URL\nthat matches the path to the supplied routeName.

\n

Handling current route

\n

The LinkTo component will apply a CSS class name of 'active' when the application's current\nroute matches the supplied routeName. For example, if the application's current route is\n'photoGallery.recent', then the following invocation of LinkTo:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

will result in

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="active">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

The CSS class used for active classes can be customized by passing an activeClass argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent' @activeClass="current-url">\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="current-url">\n  Great Hamster Photos\n</a>
\n
\n
\n \n\n

If you need a link to be 'active' even when it doesn't match the current route, you can use the\ncurrent-when argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @current-when='photos'>\n  Photo Gallery\n</LinkTo>
\n
\n
\n \n

This may be helpful for keeping links active for:

\n
    \n
  • non-nested routes that are logically related
  • \n
  • some secondary menu approaches
  • \n
  • 'top navigation' with 'sub navigation' scenarios
  • \n
\n

A link will be active if current-when is true or the current\nroute is the route this link would transition to.

\n

To match multiple routes 'space-separate' the routes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='gallery' @current-when='photos drawings paintings'>\n  Art Gallery\n</LinkTo>
\n
\n
\n \n

Supplying a model

\n

An optional model argument can be used for routes whose\npaths contain dynamic segments. This argument will become\nthe model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", {path: "hamster-photos/:photo_id"});\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{this.aPhoto}}>\n  {{aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

Supplying multiple models

\n

For deep-linking to route paths that contain multiple\ndynamic segments, the models argument can be used.

\n

As the router transitions through the route path, each\nsupplied model argument will become the context for the\nroute with the dynamic segments:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() {\n    this.route("comment", {path: "comments/:comment_id"});\n  });\n});
\n
\n
\n \n

This argument will become the model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.comment' @models={{array this.aPhoto this.comment}}>\n  {{comment.body}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42/comments/718">\n  A+++ would snuggle again.\n</a>
\n
\n
\n \n

Supplying an explicit dynamic segment value

\n

If you don't have a model object available to pass to LinkTo,\nan optional string or integer argument can be passed for routes whose\npaths contain dynamic segments. This argument will become the value\nof the dynamic segment:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{aPhotoId}}>\n  {{this.aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

When transitioning into the linked route, the model hook will\nbe triggered with parameters including this passed identifier.

\n

Supplying query parameters

\n

If you need to add optional key-value pairs that appear to the right of the ? in a URL,\nyou can use the query argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @query={{hash page=1 per_page=20}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos?page=1&per_page=20">\n  Great Hamster Photos\n</a>
\n
\n
\n \n", + "itemtype": "method", + "name": "LinkTo", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 9, + "description": "

The Textarea component inserts a new instance of <textarea> tag into the template.

\n

The @value argument provides the content of the <textarea>.

\n

This template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value="A bunch of text" />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  A bunch of text\n</textarea>
\n
\n
\n \n

The @value argument is two-way bound. If the user types text into the textarea, the @value\nargument is updated. If the @value argument is updated, the text in the textarea is updated.

\n

In the following example, the writtenWords property on the component will be updated as the user\ntypes 'Lots of text' into the text area of their browser's window.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class WordEditorComponent extends Component {\n  @tracked writtenWords = "Lots of text that IS bound";\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{writtenWords}} />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  Lots of text that IS bound\n</textarea>
\n
\n
\n \n

If you wanted a one way binding, you could use the <textarea> element directly, and use the\nvalue DOM property and the input event.

\n

Actions

\n

The Textarea component takes a number of arguments with callbacks that are invoked in\nresponse to user events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-press
  • \n
\n

These callbacks are passed to Textarea like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Classic Invocation Syntax

\n

The Textarea component can also be invoked using curly braces, just like any other Ember\ncomponent.

\n

For example, this is an invocation using angle-bracket notation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

You could accomplish the same thing using classic invocation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{textarea value=this.searchWord enter=this.query}}
\n
\n
\n \n

The main difference is that angle-bracket invocation supports any HTML attribute using HTML\nattribute syntax, because attributes and arguments have different syntax when using angle-bracket\ninvocation. Curly brace invocation, on the other hand, only has a single syntax for arguments,\nand components must manually map attributes onto component arguments.

\n

When using classic invocation with {{textarea}}, only the following attributes are mapped onto\narguments:

\n
    \n
  • rows
  • \n
  • cols
  • \n
  • name
  • \n
  • selectionEnd
  • \n
  • selectionStart
  • \n
  • autocomplete
  • \n
  • wrap
  • \n
  • lang
  • \n
  • dir
  • \n
  • value
  • \n
\n

Classic layout and layoutName properties

\n

Because HTML textarea elements do not contain inner HTML the layout and\nlayoutName properties will not be applied.

\n", + "itemtype": "method", + "name": "Textarea", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.Templates.helpers-aa05f78e30.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.Templates.helpers-aa05f78e30.json new file mode 100644 index 000000000..f9294d696 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.Templates.helpers-aa05f78e30.json @@ -0,0 +1,480 @@ +{ + "data": { + "id": "ember-4.2.0-Ember.Templates.helpers", + "type": "class", + "attributes": { + "name": "Ember.Templates.helpers", + "shortname": "Ember.Templates.helpers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 86, + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 45, + "description": "

See Ember.Templates.components.Input.

\n", + "itemtype": "method", + "name": "input", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 252, + "description": "

See Ember.Templates.components.LinkTo.

\n", + "itemtype": "method", + "name": "link-to", + "see": [ + "{Ember.Templates.components.LinkTo}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 122, + "description": "

See Ember.Templates.components.Textarea.

\n", + "itemtype": "method", + "name": "textarea", + "see": [ + "{Ember.Templates.components.Textarea}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/action.ts", + "line": 22, + "description": "

The {{action}} helper provides a way to pass triggers for behavior (usually\njust a function) between components, and into components from controllers.

\n

Passing functions with the action helper

\n

There are three contexts an action helper can be used in. The first two\ncontexts to discuss are attribute context, and Handlebars value context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>\n{{! Examples of Handlebars value context }}\n{{input on-input=(action "save")}}\n{{yield (action "refreshData") andAnotherParam}}
\n
\n
\n \n

In these contexts,\nthe helper is called a "closure action" helper. Its behavior is simple:\nIf passed a function name, read that function off the actions property\nof the current context. Once that function is read, or immediately if a function was\npassed, create a closure over that function and any arguments.\nThe resulting value of an action helper used this way is simply a function.

\n

For example, in the attribute context:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>
\n
\n
\n \n

The resulting template render logic would be:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
var div = document.createElement('div');\nvar actionFunction = (function(context){\n  return function() {\n    return context.actions.save.apply(context, arguments);\n  };\n})(context);\ndiv.onclick = actionFunction;
\n
\n
\n \n

Thus when the div is clicked, the action on that context is called.\nBecause the actionFunction is just a function, closure actions can be\npassed between components and still execute in the correct context.

\n

Here is an example action handler on a component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  save() {\n    this.model.save();\n  }\n}
\n
\n
\n \n

Actions are always looked up on the actions property of the current context.\nThis avoids collisions in the naming of common actions, such as destroy.\nTwo options can be passed to the action helper when it is used in this way.

\n
    \n
  • target=someProperty will look to someProperty instead of the current\ncontext for the actions hash. This can be useful when targeting a\nservice for actions.
  • \n
  • value="target.value" will read the path target.value off the first\nargument to the action when it is called and rewrite the first argument\nto be that value. This is useful when attaching actions to event listeners.
  • \n
\n

Invoking an action

\n

Closure actions curry both their scope and any arguments. When invoked, any\nadditional arguments are added to the already curried list.\nActions are presented in JavaScript as callbacks, and are\ninvoked like any other JavaScript function.

\n

For example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.hbs
1\n
{{input on-input=(action (action 'setName' @model) value="target.value")}}
\n
\n
\n \n

The first argument (@model) was curried over, and the run-time argument (event)\nbecomes a second argument. Action calls can be nested this way because each simply\nreturns a function. Any function can be passed to the {{action}} helper, including\nother actions.

\n

Actions invoked with sendAction have the same currying behavior as demonstrated\nwith on-input above. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyInput @submit={{action 'setName' @model}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-input submit=(action 'setName' @model)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    // Note that model is not passed, it was curried in the template\n    this.submit('bob');\n  }\n});
\n
\n
\n \n

Attaching actions to DOM elements

\n

The third context of the {{action}} helper can be called "element space".\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of element space }}\n<div {{action "save"}}></div>
\n
\n
\n \n

Used this way, the {{action}} helper provides a useful shortcut for\nregistering an HTML element in a template for a single DOM event and\nforwarding that interaction to the template's context (controller or component).\nIf the context of a template is a controller, actions used this way will\nbubble to routes when the controller does not implement the specified action.\nOnce an action hits a route, it will bubble through the route hierarchy.

\n

Event Propagation

\n

{{action}} helpers called in element space can control event bubbling. Note\nthat the closure style actions cannot.

\n

Events triggered through the action helper will automatically have\n.preventDefault() called on them. You do not need to do so in your event\nhandlers. If you need to allow event propagation (to handle file inputs for\nexample) you can supply the preventDefault=false option to the {{action}} helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<div {{action "sayHello" preventDefault=false}}>\n  <input type="file" />\n  <input type="checkbox" />\n</div>
\n
\n
\n \n

To disable bubbling, pass bubbles=false to the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<button {{action 'edit' post bubbles=false}}>Edit</button>
\n
\n
\n \n

To disable bubbling with closure style actions you must create your own\nwrapper helper that makes use of event.stopPropagation():

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div onclick={{disable-bubbling (action "sayHello")}}>Hello</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
bubbling.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { helper } from '@ember/component/helper';\n\nexport function disableBubbling([action]) {\n  return function(event) {\n    event.stopPropagation();\n    return action(event);\n  };\n}\nexport default helper(disableBubbling);
\n
\n
\n \n

If you need the default handler to trigger you should either register your\nown event handler, or use event methods on your view class. See\n"Responding to Browser Events"\nin the documentation for Component for more information.

\n

Specifying DOM event type

\n

{{action}} helpers called in element space can specify an event type.\nBy default the {{action}} helper registers for DOM click events. You can\nsupply an on option to the helper to specify a different DOM event name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" on="doubleClick"}}>\n  click me\n</div>
\n
\n
\n \n

See "Event Names" for a list of\nacceptable DOM event names.

\n

Specifying whitelisted modifier keys

\n

{{action}} helpers called in element space can specify modifier keys.\nBy default the {{action}} helper will ignore click events with pressed modifier\nkeys. You can supply an allowedKeys option to specify which keys should not be ignored.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="alt"}}>\n  click me\n</div>
\n
\n
\n \n

This way the action will fire when clicking with the alt key pressed down.\nAlternatively, supply "any" to the allowedKeys option to accept any combination of modifier keys.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="any"}}>\n  click me with any key pressed\n</div>
\n
\n
\n \n

Specifying a Target

\n

A target option can be provided to the helper to change\nwhich object will receive the method call. This option must be a path\nto an object, accessible in the current context:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<div {{action "anActionName" target=someService}}>\n  click me\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n
import Controller from '@ember/controller';\nimport { service } from '@ember/service';\n\nexport default class extends Controller {\n  @service someService;\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "action", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/array.ts", + "line": 5, + "description": "

Use the {{array}} helper to create an array to pass as an option to your\ncomponents.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<MyComponent @people={{array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson}}\n/>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{my-component people=(array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson)\n}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Tom Dale', 'Yehuda Katz', this.get('myOtherPerson')]
\n
\n
\n \n

Where the 3rd item in the array is bound to updates of the myOtherPerson property.

\n", + "itemtype": "method", + "name": "array", + "params": [ + { + "name": "options", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "Array", + "type": "Array" + }, + "since": "3.8.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/component.ts", + "line": 5, + "description": "

The {{component}} helper lets you add instances of Component to a\ntemplate. See Component for\nadditional information on how a Component functions.\n{{component}}'s primary use is for cases where you want to dynamically\nchange which type of component is rendered as the state of your application\nchanges. This helper has three modes: inline, block, and nested.

\n

Inline Form

\n

Given the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/application.hbs
1\n
{{component this.infographicComponentName}}
\n
\n
\n \n

And the following application code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Controller from '@ember/controller';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

The live-updating-chart component will be appended when isMarketOpen is\ntrue, and the market-close-summary component will be appended when\nisMarketOpen is false. If the value changes while the app is running,\nthe component will be automatically swapped out accordingly.\nNote: You should not use this helper when you are consistently rendering the same\ncomponent. In that case, use standard component syntax, for example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LiveUpdatingChart />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{live-updating-chart}}
\n
\n
\n \n

Block Form

\n

Using the block form of this helper is similar to using the block form\nof a component. Given the following application template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
{{#component this.infographicComponentName}}\n  Last update: {{this.lastUpdateTimestamp}}\n{{/component}}
\n
\n
\n \n

The following controller code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Controller from '@ember/controller';\nimport { computed } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get lastUpdateTimestamp() {\n    return new Date();\n  }\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

And the following component template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
chart.hbs
1\n2\n
{{! chart }}\n{{yield}}
\n
\n
\n \n

The Last Update: {{this.lastUpdateTimestamp}} will be rendered in place of the {{yield}}.

\n

Nested Usage

\n

The component helper can be used to package a component path with initial attrs.\nThe included attrs can then be merged during the final invocation.\nFor example, given a person-form component with the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.hbs
1\n2\n3\n
{{yield (hash\n  nameInput=(component "my-input-component" value=@model.name placeholder="First Name")\n)}}
\n
\n
\n \n

When yielding the component via the hash helper, the component is invoked directly.\nSee the following snippet:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonForm as |form|>\n  <form.nameInput @placeholder="Username" />\n</PersonForm>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-form as |form|}}\n  {{form.nameInput placeholder="Username"}}\n{{/person-form}}
\n
\n
\n \n

Which outputs an input whose value is already bound to model.name and placeholder\nis "Username".

\n

When yielding the component without the hash helper use the component helper.\nFor example, below is a full-name component template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{yield (component "my-input-component" value=@model.name placeholder="Name")}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<FullName as |field|>\n  {{component field placeholder="Full name"}}\n</FullName>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#full-name as |field|}}\n  {{component field placeholder="Full name"}}\n{{/full-name}}
\n
\n
\n \n", + "itemtype": "method", + "name": "component", + "since": "1.11.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/concat.ts", + "line": 5, + "description": "

Concatenates the given arguments into a string.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{some-component name=(concat firstName " " lastName)}}\n\n{{! would pass name="<first name value> <last name value>" to the component}}
\n
\n
\n \n

or for angle bracket invocation, you actually don't need concat at all.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @name="{{firstName}} {{lastName}}" />
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "concat", + "since": "1.13.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 12, + "description": "

The {{#each}} helper loops over elements in a collection. It is an extension\nof the base Handlebars {{#each}} helper.

\n

The default behavior of {{#each}} is to yield its inner block once for every\nitem in an array passing the item as the first block parameter.

\n

Assuming the @developers argument contains this array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
[{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }];
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

The same rules apply to arrays of primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Yehuda', 'Tom', 'Paul']
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developerNames as |name|}}\n    <li>Hello, {{name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

During iteration, the index of each item in the array is provided as a second block\nparameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person index|}}\n    <li>Hello, {{person.name}}! You're number {{index}} in line</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

Specifying Keys

\n

In order to improve rendering speed, Ember will try to reuse the DOM elements\nwhere possible. Specifically, if the same item is present in the array both\nbefore and after the change, its DOM output will be reused.

\n

The key option is used to tell Ember how to determine if the items in the\narray being iterated over with {{#each}} has changed between renders. By\ndefault the item's object identity is used.

\n

This is usually sufficient, so in most cases, the key option is simply not\nneeded. However, in some rare cases, the objects' identities may change even\nthough they represent the same underlying data.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
people.map(person => {\n  return { ...person, type: 'developer' };\n});
\n
\n
\n \n

In this case, each time the people array is map-ed over, it will produce\nan new array with completely different objects between renders. In these cases,\nyou can help Ember determine how these objects related to each other with the\nkey option:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers key="name" as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

By doing so, Ember will use the value of the property specified (person.name\nin the example) to find a "match" from the previous render. That is, if Ember\nhas previously seen an object from the @developers array with a matching\nname, its DOM elements will be re-used.

\n

There are two special values for key:

\n
    \n
  • @index - The index of the item in the array.
  • \n
  • @identity - The item in the array itself.
  • \n
\n

{{else}} condition

\n

{{#each}} can have a matching {{else}}. The contents of this block will render\nif the collection is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<ul>\n  {{#each @developers as |person|}}\n    <li>{{person.name}} is available!</li>\n  {{else}}\n    <li>Sorry, nobody is available for this task.</li>\n  {{/each}}\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 123, + "description": "

The {{each-in}} helper loops over properties on an object.

\n

For example, given this component definition:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    "name": "Shelly Sails",\n    "age": 42\n  };\n}
\n
\n
\n \n

This template would display all properties on the developer\nobject in a list:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.hbs
1\n2\n3\n4\n5\n
<ul>\n  {{#each-in this.developer as |key value|}}\n    <li>{{key}}: {{value}}</li>\n  {{/each-in}}\n</ul>
\n
\n
\n \n

Outputting their name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<ul>\n  <li>name: Shelly Sails</li>\n  <li>age: 42</li>\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each-in", + "access": "public", + "tagname": "", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/fn.ts", + "line": 5, + "description": "

The fn helper allows you to ensure a function that you are passing off\nto another component, helper, or modifier has access to arguments that are\navailable in the template.

\n

For example, if you have an each helper looping over a number of items, you\nmay need to pass a function that expects to receive the item as an argument\nto a component invoked within the loop. Here's how you could use the fn\nhelper to pass both the function and its arguments together:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
listing.hbs
1\n2\n3\n
{{#each @items as |item|}}\n<DisplayItem @item=item @select={{fn this.handleSelected item}} />\n{{/each}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class ItemsList extends Component {\n  @action\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this case the display-item component will receive a normal function\nthat it can invoke. When it invokes the function, the handleSelected\nfunction will receive the item and any arguments passed, thanks to the\nfn helper.

\n

Let's take look at what that means in a couple circumstances:

\n
    \n
  • When invoked as this.args.select() the handleSelected function will\nreceive the item from the loop as its first and only argument.
  • \n
  • When invoked as this.args.select('foo') the handleSelected function\nwill receive the item from the loop as its first argument and the\nstring 'foo' as its second argument.
  • \n
\n

In the example above, we used @action to ensure that handleSelected is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class ItemsList extends Component {\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when handleSelected is invoked inside the display-item\ncomponent, it will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into fn!

\n

See also partial application.

\n", + "itemtype": "method", + "name": "fn", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/get.ts", + "line": 5, + "description": "

Dynamically look up a property on an object. The second argument to {{get}}\nshould have a string value, although it can be bound.

\n

For example, these two usages are equivalent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{this.developer.name}}\n{{get this.developer "name"}}
\n
\n
\n \n

If there were several facts about a person, the {{get}} helper can dynamically\npick one:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<DeveloperDetail @factName="language" />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.developer @factName}}
\n
\n
\n \n

For a more complex example, this template would allow the user to switch\nbetween showing the user's name and preferred coding language with a click:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n\n  @tracked currentFact = 'name'\n\n  @action\n  showFact(fact) {\n    this.currentFact = fact;\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
{{get this.developer this.currentFact}}\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

The {{get}} helper can also respect mutable values itself. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
<Input @value={{mut (get this.person this.currentFact)}} />\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

Would allow the user to swap what fact is being displayed, and also edit\nthat fact via a two-way mutable binding.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "get", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/hash.ts", + "line": 5, + "description": "

Use the {{hash}} helper to create a hash to pass as an option to your\ncomponents. This is specially useful for contextual components where you can\njust yield a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{yield (hash\n   name='Sarah'\n   title=office\n)}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ name: 'Sarah', title: this.get('office') }
\n
\n
\n \n

Where the title is bound to updates of the office property.

\n

Note that the hash is an empty object with no prototype chain, therefore\ncommon methods like toString are not available in the resulting hash.\nIf you need to use such a method, you can use the call or apply\napproach:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
function toString(obj) {\n  return Object.prototype.toString.apply(obj);\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "Hash", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 5, + "description": "

The if helper allows you to conditionally render one of two branches,\ndepending on the "truthiness" of a property.\nFor example the following values are all falsey: false, undefined, null, "", 0, NaN or an empty array.

\n

This helper has two forms, block and inline.

\n

Block form

\n

You can use the block form of if to conditionally render a section of the template.

\n

To use it, pass the conditional value to the if helper,\nusing the block form to wrap the section of template you want to conditionally render.\nLike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n
{{! will not render because greeting is undefined}}\n{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{/if}}
\n
\n
\n \n

You can also define what to show if the property is falsey by using\nthe else helper.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n
{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{else}}\n  No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

You are also able to combine else and if helpers to create more complex\nconditional logic.

\n

For the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if @isRaining}}\n Yes, grab an umbrella!\n{{else if @isCold}}\n Grab a coat, it's chilly!\n{{else}}\n No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

If you call it by saying isCold is true:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather @isCold={{true}} />
\n
\n
\n \n

Then Grab a coat, it's chilly! will be rendered.

\n

Inline form

\n

The inline if helper conditionally renders a single property or string.

\n

In this form, the if helper receives three arguments, the conditional value,\nthe value to render when truthy, and the value to render when falsey.

\n

For example, if useLongGreeting is truthy, the following:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{true}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{if @useLongGreeting "Hello" "Hi"}} Alex
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hello Alex
\n
\n
\n \n

One detail to keep in mind is that both branches of the if helper will be evaluated,\nso if you have {{if condition "foo" (expensive-operation "bar"),\nexpensive-operation will always calculate.

\n", + "itemtype": "method", + "name": "if", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 97, + "description": "

The unless helper is the inverse of the if helper. It displays if a value\nis falsey ("not true" or "is false"). Example values that will display with\nunless: false, undefined, null, "", 0, NaN or an empty array.

\n

Inline form

\n

The inline unless helper conditionally renders a single property or string.\nThis helper acts like a ternary operator. If the first property is falsy,\nthe second argument will be displayed, otherwise, the third argument will be\ndisplayed

\n

For example, if you pass a falsey useLongGreeting to the Greeting component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{false}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{unless @useLongGreeting "Hi" "Hello"}} Ben
\n
\n
\n \n

Then it will display:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hi Ben
\n
\n
\n \n

Block form

\n

Like the if helper, the unless helper also has a block form.

\n

The following will not render anything:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n2\n3\n
{{#unless @greeting}}\n  No greeting was found. Why not set one?\n{{/unless}}
\n
\n
\n \n

You can also use an else helper with the unless block. The\nelse will display if the value is truthy.

\n

If you have the following component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
in.hbs
1\n2\n3\n4\n5\n
{{#unless @userData}}\n  Please login.\n{{else}}\n  Welcome back!\n{{/unless}}
\n
\n
\n \n

Calling it with a truthy userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{hash username="Zoey"}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Welcome back!
\n
\n
\n \n

and calling it with a falsey userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{false}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Please login.
\n
\n
\n \n", + "itemtype": "method", + "name": "unless", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/log.ts", + "line": 5, + "description": "

log allows you to output the value of variables in the current rendering\ncontext. log also accepts primitive types such as strings or numbers.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{log "myVariable:" myVariable }}
\n
\n
\n \n", + "itemtype": "method", + "name": "log", + "params": [ + { + "name": "params", + "description": "", + "type": "Array" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/mut.ts", + "line": 9, + "description": "

The mut helper lets you clearly specify that a child Component can update the\n(mutable) value passed to it, which will change the value of the parent component.

\n

To specify that a parameter is mutable, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{fn (mut totalClicks)}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(mut totalClicks)}}
\n
\n
\n \n

The child Component can then modify the parent's value just by modifying its own\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

Note that for curly components ({{my-component}}) the bindings are already mutable,\nmaking the mut unnecessary.

\n

Additionally, the mut helper can be combined with the fn helper to\nmutate a value. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=totalClicks click-count-change=(fn (mut totalClicks))}}
\n
\n
\n \n

The child Component would invoke the function with the new click value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.get('click-count-change')(this.get('childClickCount') + 1);\n  }\n});
\n
\n
\n \n

The mut helper changes the totalClicks value to what was provided as the fn argument.

\n

The mut helper, when used with fn, will return a function that\nsets the value passed to mut to its first argument. As an example, we can create a\nbutton that increments a value passing the value directly to the fn:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{! inc helper is not provided by Ember }}\n<button onclick={{fn (mut count) (inc count)}}>\n  Increment count\n</button>
\n
\n
\n \n", + "itemtype": "method", + "name": "mut", + "params": [ + { + "name": "attr", + "description": "the \"two-way\" attribute that can be modified.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/page-title.ts", + "line": 5, + "description": "

page-title allows you to set the title of any page in your application and\nappend additional titles for each route. For complete documentation, see\nhttps://github.com/ember-cli/ember-page-title.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{page-title "My Page Title" }}
\n
\n
\n \n", + "itemtype": "method", + "name": "page-title", + "params": [ + { + "name": "param", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/readonly.ts", + "line": 8, + "description": "

The readonly helper let's you specify that a binding is one-way only,\ninstead of two-way.\nWhen you pass a readonly binding from an outer context (e.g. parent component),\nto to an inner context (e.g. child component), you are saying that changing that\nproperty in the inner context does not change the value in the outer context.

\n

To specify that a binding is read-only, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n
export default Component.extend({\n  totalClicks: 3\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} // -> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Now, when you update childClickCount:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n
export default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

The value updates in the child component, but not the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClickCount}} //-> 4
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Objects and Arrays

\n

When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string),\nonly the reference to the object is protected using the readonly helper.\nThis means that you can change properties of the object both on the parent component, as well as the child component.\nThe readonly binding behaves similar to the const keyword in JavaScript.

\n

Let's look at an example:

\n

First let's set up the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  clicks: null,\n\n  init() {\n    this._super(...arguments);\n    this.set('clicks', { total: 3 });\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n

Now, if you update the total property of childClicks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    this.get('clicks').incrementProperty('total');\n  }\n});
\n
\n
\n \n

You will see the following happen:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClicks.total}} //-> 4
\n
\n
\n \n", + "itemtype": "method", + "name": "readonly", + "params": [ + { + "name": "attr", + "description": "the read-only attribute.", + "type": "Object", + "optional": true + } + ], + "access": "private", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unbound.ts", + "line": 10, + "description": "

The {{unbound}} helper disconnects the one-way binding of a property,\nessentially freezing its value at the moment of rendering. For example,\nin this example the display of the variable name will not change even\nif it is set with a new value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{unbound this.name}}
\n
\n
\n \n

Like any helper, the unbound helper can accept a nested helper expression.\nThis allows for custom helpers to be rendered unbound:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{unbound (some-custom-helper)}}\n{{unbound (capitalize this.name)}}\n{{! You can use any helper, including unbound, in a nested expression }}\n{{capitalize (unbound this.name)}}
\n
\n
\n \n

The unbound helper only accepts a single argument, and it return an\nunbound value.

\n", + "itemtype": "method", + "name": "unbound", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/modifiers/on.ts", + "line": 5, + "description": "

The {{on}} modifier lets you easily add event listeners (it uses\nEventTarget.addEventListener\ninternally).

\n

For example, if you'd like to run a function on your component when a <button>\nin the components template is clicked you might do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' this.saveLike}}>Like this post!</button>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class LikePostComponent extends Component {\n  @action\n  saveLike() {\n    // someone likes your post!\n    // better send a request off to your server...\n  }\n}
\n
\n
\n \n

Arguments

\n

{{on}} accepts two positional arguments, and a few named arguments.

\n

The positional arguments are:

\n
    \n
  • event -- the name to use when calling addEventListener
  • \n
  • callback -- the function to be passed to addEventListener
  • \n
\n

The named arguments are:

\n
    \n
  • capture -- a true value indicates that events of this type will be dispatched\nto the registered listener before being dispatched to any EventTarget beneath it\nin the DOM tree.
  • \n
  • once -- indicates that the listener should be invoked at most once after being\nadded. If true, the listener would be automatically removed when invoked.
  • \n
  • passive -- if true, indicates that the function specified by listener will never\ncall preventDefault(). If a passive listener does call preventDefault(), the user\nagent will do nothing other than generate a console warning. See\nImproving scrolling performance with passive listeners\nto learn more.
  • \n
\n

The callback function passed to {{on}} will receive any arguments that are passed\nto the event handler. Most commonly this would be the event itself.

\n

If you would like to pass additional arguments to the function you should use\nthe {{fn}} helper.

\n

For example, in our example case above if you'd like to pass in the post that\nwas being liked when the button is clicked you could do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' (fn this.saveLike @post)}}>Like this post!</button>
\n
\n
\n \n

In this case, the saveLike function will receive two arguments: the click event\nand the value of @post.

\n

Function Context

\n

In the example above, we used @action to ensure that likePost is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class LikePostComponent extends Component {\n  saveLike() {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when the button is clicked saveLike will be invoked,\nit will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into on!

\n", + "itemtype": "method", + "name": "on", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/in-element.ts", + "line": 5, + "description": "

The in-element helper renders its block content outside of the regular flow,\ninto a DOM element given by its destinationElement positional argument.

\n

Common use cases - often referred to as "portals" or "wormholes" - are rendering\ndropdowns, modals or tooltips close to the root of the page to bypass CSS overflow\nrules, or to render content to parts of the page that are outside of the control\nof the Ember app itself (e.g. embedded into a static or server rendered HTML page).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#in-element this.destinationElement}}\n  <div>Some content</div>\n{{/in-element}}
\n
\n
\n \n

Arguments

\n

{{in-element}} requires a single positional argument:

\n
    \n
  • destinationElement -- the DOM element to render into. It must exist at the time\nof rendering.
  • \n
\n

It also supports an optional named argument:

\n
    \n
  • insertBefore -- by default the DOM element's content is replaced when used as\ndestinationElement. Passing null changes the behaviour to appended at the end\nof any existing content. Any other value than null is currently not supported.
  • \n
\n", + "itemtype": "method", + "name": "in-element", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/let.ts", + "line": 5, + "description": "

The let helper receives one or more positional arguments and yields\nthem out as block params.

\n

This allows the developer to introduce shorter names for certain computations\nin the template.

\n

This is especially useful if you are passing properties to a component\nthat receives a lot of options and you want to clean up the invocation.

\n

For the following example, the template receives a post object with\ncontent and title properties.

\n

We are going to call the my-post component, passing a title which is\nthe title of the post suffixed with the name of the blog, the content\nof the post, and a series of options defined in-place.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n    (concat post.title ' | The Ember.js Blog')\n    post.content\n    (hash\n      theme="high-contrast"\n      enableComments=true\n    )\n    as |title content options|\n}}\n  <MyPost @title={{title}} @content={{content}} @options={{options}} />\n{{/let}}
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n  (concat post.title ' | The Ember.js Blog')\n  post.content\n  (hash\n    theme="high-contrast"\n    enableComments=true\n  )\n  as |title content options|\n}}\n{{my-post title=title content=content options=options}}\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "let", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/mount.ts", + "line": 13, + "description": "

The {{mount}} helper lets you embed a routeless engine in a template.\nMounting an engine will cause an instance to be booted and its application\ntemplate to be rendered.

\n

For example, the following template mounts the ember-chat engine:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! application.hbs }}\n{{mount "ember-chat"}}
\n
\n
\n \n

Additionally, you can also pass in a model argument that will be\nset as the engines model. This can be an existing object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div>\n  {{mount 'admin' model=userSettings}}\n</div>
\n
\n
\n \n

Or an inline hash, and you can even pass components:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>\n  <h1>Application template!</h1>\n  {{mount 'admin' model=(hash\n      title='Secret Admin'\n      signInButton=(component 'sign-in-button')\n  )}}\n</div>
\n
\n
\n \n", + "itemtype": "method", + "name": "mount", + "params": [ + { + "name": "name", + "description": "Name of the engine to mount.", + "type": "String" + }, + { + "name": "model", + "description": "Object that will be set as\n the model of the engine.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/outlet.ts", + "line": 20, + "description": "

The {{outlet}} helper lets you specify where a child route will render in\nyour template. An important use of the {{outlet}} helper is in your\napplication's application.hbs file:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n7\n8\n
<MyHeader />\n\n<div class="my-dynamic-content">\n  <!-- this content will change based on the current route, which depends on the current URL -->\n  {{outlet}}\n</div>\n\n<MyFooter />
\n
\n
\n \n

See the routing guide for more\ninformation on how your route interacts with the {{outlet}} helper.\nNote: Your content will not render if there isn't an {{outlet}} for it.

\n", + "itemtype": "method", + "name": "outlet", + "params": [ + { + "name": "name", + "description": "", + "type": "String", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 91, + "description": "

{{yield}} denotes an area of a template that will be rendered inside\nof another template.

\n

Use with Component

\n

When designing components {{yield}} is used to denote where, inside the component's\ntemplate, an optional block passed to the component should render:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<LabeledTextfield @value={{@model.name}}>\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<label>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n

Additionally you can yield properties into the context for use by the consumer:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n
<LabeledTextfield @value={{@model.validation}} @validator={{this.firstNameValidator}} as |validationError|>\n  {{#if validationError}}\n    <p class="error">{{validationError}}</p>\n  {{/if}}\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield this.validationError}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<label>\n  <p class="error">First Name must be at least 3 characters long.</p>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n", + "itemtype": "method", + "name": "yield", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "return": { + "description": "HTML string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 152, + "description": "

{{(has-block)}} indicates if the component was invoked with a block.

\n

This component is invoked with a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component}}
\n
\n
\n \n

Using angle bracket invocation, this looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent>Hi Jen!</MyComponent> {{! with a block}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent/> {{! without a block}}
\n
\n
\n \n

This is useful when you want to create a component that can optionally take a block\nand then render a default template when it is not invoked with a block.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n
{{#if (has-block)}}\n  Welcome {{yield}}, we are happy you're here!\n{{else}}\n  Hey you! You're great!\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with a block", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 197, + "description": "

{{(has-block-params)}} indicates if the component was invoked with block params.

\n

This component is invoked with block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component as |favoriteFlavor|}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jenn!\n{{/my-component}}
\n
\n
\n \n

With angle bracket syntax, block params look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent as |favoriteFlavor|>\nHi Jen!\n</MyComponent>
\n
\n
\n \n

And without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent>\n  Hi Jen!\n</MyComponent>
\n
\n
\n \n

This is useful when you want to create a component that can render itself\ndifferently when it is not invoked with block params.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if (has-block-params)}}\n  Welcome {{yield this.favoriteFlavor}}, we're happy you're here and hope you\n  enjoy your favorite ice cream flavor.\n{{else}}\n  Welcome {{yield}}, we're happy you're here, but we're unsure what\n  flavor ice cream you would enjoy.\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block-params", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with block params", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 252, + "description": "

Execute the debugger statement in the current template's context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{debugger}}
\n
\n
\n \n

When using the debugger helper you will have access to a get function. This\nfunction retrieves values available in the context of the template.\nFor example, if you're wondering why a value {{foo}} isn't rendering as\nexpected within a template, you could place a {{debugger}} statement and,\nwhen the debugger; breakpoint is hit, you can attempt to retrieve this value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('foo')
\n
\n
\n \n

get is also aware of keywords. So in this situation

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#each this.items as |item|}}\n  {{debugger}}\n{{/each}}
\n
\n
\n \n

You'll be able to get values from the current item:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('item.name')
\n
\n
\n \n

You can also access the context of the view to make sure it is the object that\nyou expect:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> context
\n
\n
\n \n", + "itemtype": "method", + "name": "debugger", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.Test-0c06a955ef.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.Test-0c06a955ef.json new file mode 100644 index 000000000..a28b94010 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.Test-0c06a955ef.json @@ -0,0 +1,147 @@ +{ + "data": { + "id": "ember-4.2.0-Ember.Test", + "type": "class", + "attributes": { + "name": "Ember.Test", + "shortname": "Ember.Test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/ember-testing/lib/test.js", + "line": 11, + "description": "

This is a container for an assortment of testing related functionality:

\n
    \n
  • Choose your default test adapter (for your framework of choice).
  • \n
  • Register/Unregister additional test helpers.
  • \n
  • Setup callbacks to be fired when the test helpers are injected into\nyour application.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/ember-testing/lib/test/on_inject_helpers.js", + "line": 3, + "description": "

Used to register callbacks to be fired whenever App.injectTestHelpers\nis called.

\n

The callback will receive the current application as an argument.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import $ from 'jquery';\n\nEmber.Test.onInjectHelpers(function() {\n  $(document).ajaxSend(function() {\n    Test.pendingRequests++;\n  });\n\n  $(document).ajaxComplete(function() {\n    Test.pendingRequests--;\n  });\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "onInjectHelpers", + "params": [ + { + "name": "callback", + "description": "The function to be called.", + "type": "Function" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.js", + "line": 21, + "description": "

This returns a thenable tailored for testing. It catches failed\nonSuccess callbacks and invokes the Ember.Test.adapter.exception\ncallback in the last chained then.

\n

This method should be returned by async helpers such as wait.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "promise", + "params": [ + { + "name": "resolver", + "description": "The function used to resolve the promise.", + "type": "Function" + }, + { + "name": "label", + "description": "An optional string for identifying the promise.", + "type": "String" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.js", + "line": 39, + "description": "

Replacement for Ember.RSVP.resolve\nThe only difference is this uses\nan instance of Ember.Test.Promise

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "The", + "description": "value to resolve", + "type": "Mixed" + } + ], + "since": "1.2.0", + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/setup_for_testing.js", + "line": 8, + "description": "

Sets Ember up for testing. This is useful to perform\nbasic setup steps in order to unit test.

\n

Use App.setupForTesting to perform integration tests (full\napplication testing).

\n", + "itemtype": "method", + "name": "setupForTesting", + "since": "1.5.0", + "access": "private", + "tagname": "", + "class": "Ember.Test", + "module": "@ember/test", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/test.js", + "line": 24, + "description": "

Hash containing all known test helpers.

\n", + "itemtype": "property", + "name": "_helpers", + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/ember-testing/lib/test.js", + "line": 45, + "description": "

Used to allow ember-testing to communicate with a specific testing\nframework.

\n

You can manually set it before calling App.setupForTesting().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Ember.Test.adapter = MyCustomAdapter.create()
\n
\n
\n \n

If you do not set it, ember-testing will default to Ember.Test.QUnitAdapter.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "adapter", + "type": "{Class} The adapter to be used.", + "default": "Ember.Test.QUnitAdapter", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.ViewMixin-17f69dbeb2.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.ViewMixin-17f69dbeb2.json new file mode 100644 index 000000000..c29ea705d --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Ember.ViewMixin-17f69dbeb2.json @@ -0,0 +1,304 @@ +{ + "data": { + "id": "ember-4.2.0-Ember.ViewMixin", + "type": "class", + "attributes": { + "name": "Ember.ViewMixin", + "shortname": "Ember.ViewMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 422, + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 70, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 96, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 116, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 156, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 214, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 299, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 373, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 409, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 268, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 276, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 289, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 313, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 326, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 334, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 12, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 141, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 235, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 346, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-EmberArray-dd7d5e45cb.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-EmberArray-dd7d5e45cb.json new file mode 100644 index 000000000..41cf86429 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-EmberArray-dd7d5e45cb.json @@ -0,0 +1,836 @@ +{ + "data": { + "id": "ember-4.2.0-EmberArray", + "type": "class", + "attributes": { + "name": "EmberArray", + "shortname": "EmberArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "MutableArray" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 179, + "description": "

This mixin implements Observer-friendly Array-like behavior. It is not a\nconcrete implementation, but it can be used up by other classes that want\nto appear like arrays.

\n

For example, ArrayProxy is a concrete class that can be instantiated to\nimplement array-like behavior. This class uses the Array Mixin by way of\nthe MutableArray mixin, which allows observable changes to be made to the\nunderlying array.

\n

This mixin defines methods specifically for collections that provide\nindex-ordered access to their contents. When you are designing code that\nneeds to accept any kind of Array-like object, you should use these methods\ninstead of Array primitives because these will properly notify observers of\nchanges to the array.

\n

Although these methods are efficient, they do add a layer of indirection to\nyour application so it is a good idea to use them only when you need the\nflexibility of using both true JavaScript arrays and "virtual" arrays such\nas controllers and collections.

\n

You can use the methods defined in this module to access and modify array\ncontents in an observable-friendly way. You can also be notified whenever\nthe membership of an array changes by using .observes('myArray.[]').

\n

To support EmberArray in your own class, you must override two\nprimitives to use it: length() and objectAt().

\n", + "uses": [ + "Enumerable" + ], + "since": "Ember 0.9.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1116, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1154, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1166, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1182, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1215, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1259, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1278, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1300, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-EmberObject-b9e73e88c3.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-EmberObject-b9e73e88c3.json new file mode 100644 index 000000000..777f30c56 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-EmberObject-b9e73e88c3.json @@ -0,0 +1,596 @@ +{ + "data": { + "id": "ember-4.2.0-EmberObject", + "type": "class", + "attributes": { + "name": "EmberObject", + "shortname": "EmberObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/object.js", + "line": 13, + "description": "

EmberObject is the main base class for all Ember objects. It is a subclass\nof CoreObject with the Observable mixin applied. For details,\nsee the documentation for each of these.

\n", + "extends": "CoreObject", + "uses": [ + "Observable" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.2.0-ContainerDebugAdapter" + }, + { + "type": "class", + "id": "ember-4.2.0-DataAdapter" + }, + { + "type": "class", + "id": "ember-4.2.0-HashLocation" + }, + { + "type": "class", + "id": "ember-4.2.0-HistoryLocation" + }, + { + "type": "class", + "id": "ember-4.2.0-NoneLocation" + }, + { + "type": "class", + "id": "ember-4.2.0-Route" + }, + { + "type": "class", + "id": "ember-4.2.0-EmberRouter" + }, + { + "type": "class", + "id": "ember-4.2.0-ArrayProxy" + }, + { + "type": "class", + "id": "ember-4.2.0-Ember.Namespace" + }, + { + "type": "class", + "id": "ember-4.2.0-ObjectProxy" + }, + { + "type": "class", + "id": "ember-4.2.0-Ember.CoreView" + }, + { + "type": "class", + "id": "ember-4.2.0-Controller" + }, + { + "type": "class", + "id": "ember-4.2.0-EngineInstance" + }, + { + "type": "class", + "id": "ember-4.2.0-Service" + } + ] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-EmberRouter-ce136050b3.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-EmberRouter-ce136050b3.json new file mode 100644 index 000000000..7e8d196f1 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-EmberRouter-ce136050b3.json @@ -0,0 +1,1157 @@ +{ + "data": { + "id": "ember-4.2.0-EmberRouter", + "type": "class", + "attributes": { + "name": "EmberRouter", + "shortname": "EmberRouter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 126, + "description": "

The EmberRouter class manages the application state and URLs. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 203, + "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

The first parameter is the name of the route which is used by default as the\npath name as well.

\n

The 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\nsegments.
  • \n
  • resetNamespace: false by default; when nesting routes, ember will\ncombine the route names to form the fully-qualified route name, which is\nused with {{link-to}} or manually transitioning to routes. Setting\nresetNamespace: true will cause the route not to inherit from its\nparent route's names. This is handy for preventing extremely long route names.\nKeep in mind that the actual URL path behavior is still retained.
  • \n
\n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
Router.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
\n
\n \n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 525, + "description": "

Initializes the current router instance and sets up the change handling\nevent listeners used by the instances location implementation.

\n

A property named initialURL will be used to determine the initial URL.\nIf no value is found / will be used.

\n", + "itemtype": "method", + "name": "startRouting", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 647, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n

See transitionTo for more info.

\n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 704, + "description": "

Determines if the supplied route is currently active.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 716, + "description": "

An alternative form of isActive that doesn't require\nmanual concatenation of the arguments into a single\narray.

\n", + "itemtype": "method", + "name": "isActiveIntent", + "params": [ + { + "name": "routeName", + "description": "" + }, + { + "name": "models", + "description": "" + }, + { + "name": "queryParams", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 738, + "description": "

Does this router instance have the given route.

\n", + "itemtype": "method", + "name": "hasRoute", + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 749, + "description": "

Resets the state of the router by clearing the current route\nhandlers and deactivating them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 889, + "description": "

Serializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Arrray" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 916, + "description": "

Serializes the value of a query parameter based on a type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "type", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 934, + "description": "

Deserializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 959, + "description": "

Deserializes the value of a query parameter based on a default type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "defaultType", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 980, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_pruneDefaultQueryParamValues", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1062, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareQueryParams", + "params": [ + { + "name": "targetRouteName", + "description": "", + "type": "String" + }, + { + "name": "models", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + }, + { + "name": "keepDefaultQueryParamValues", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1089, + "description": "

Returns the meta information for the query params of a given route. This\nwill be overridden to allow support for lazy routes.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getQPMeta", + "params": [ + { + "name": "routeInfo", + "description": "", + "type": "RouteInfo" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1103, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_queryParamsFor", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1168, + "description": "

Maps all query param keys to their fully scoped property name of the form\ncontrollerName:propName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_fullyScopeQueryParams", + "params": [ + { + "name": "leafRouteName", + "description": "", + "type": "String" + }, + { + "name": "contexts", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1210, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_hydrateUnsuppliedQueryParams", + "params": [ + { + "name": "state", + "description": "", + "type": "TransitionState" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1373, + "description": "

Handles updating the paths and notifying any listeners of the URL\nchange.

\n

Triggers the router level didTransition hook.

\n

For example, to notify google analytics when the route changes,\nyou could use this hook. (Note: requires also including GA scripts, etc.)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "didTransition", + "access": "private", + "tagname": "", + "since": "1.2.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1410, + "description": "

Handles notifying any listeners of an impending URL\nchange.

\n

Triggers the router level willTransition hook.

\n", + "itemtype": "method", + "name": "willTransition", + "access": "private", + "tagname": "", + "since": "1.11.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 54, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 80, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 101, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 124, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 139, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 136, + "description": "

Represents the URL of the root of the application, often '/'. This prefix is\n assumed on all routes defined on this router.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 147, + "description": "

The location property determines the type of URL's that your\n application will use.

\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

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1423, + "description": "

Represents the current URL.

\n", + "itemtype": "property", + "name": "url", + "type": "{String}", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Engine-a449c31447.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Engine-a449c31447.json new file mode 100644 index 000000000..5fb28ea83 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Engine-a449c31447.json @@ -0,0 +1,728 @@ +{ + "data": { + "id": "ember-4.2.0-Engine", + "type": "class", + "attributes": { + "name": "Engine", + "shortname": "Engine", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/index.js", + "line": 30, + "description": "

The Engine class contains core functionality for both applications and\nengines.

\n

Each engine manages a registry that's used for dependency injection and\nexposed through RegistryProxy.

\n

Engines also manage initializers and instance initializers.

\n

Engines can spawn EngineInstance instances via buildInstance().

\n", + "extends": "Ember.Namespace", + "uses": [ + "RegistryProxy" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/engine/index.js", + "line": 61, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 74, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 87, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 100, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 108, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 116, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 127, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 158, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 305, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 378, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 427, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Namespace" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/index.js", + "line": 53, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 418, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-Ember.Namespace", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.2.0-Application" + } + ] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-EngineInstance-cc7ad7238a.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-EngineInstance-cc7ad7238a.json new file mode 100644 index 000000000..9d05411c7 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-EngineInstance-cc7ad7238a.json @@ -0,0 +1,1002 @@ +{ + "data": { + "id": "ember-4.2.0-EngineInstance", + "type": "class", + "attributes": { + "name": "EngineInstance", + "shortname": "EngineInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/instance.js", + "line": 17, + "description": "

The EngineInstance encapsulates all of the stateful aspects of a\nrunning Engine.

\n", + "access": "public", + "tagname": "", + "extends": "EmberObject", + "uses": [ + "RegistryProxyMixin", + "ContainerProxyMixin" + ], + "methods": [ + { + "file": "packages/@ember/engine/instance.js", + "line": 62, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 124, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 139, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 167, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 200, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 18, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 31, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 101, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 124, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 134, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 145, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 155, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 165, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 198, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 208, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 23, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 49, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 110, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/instance.js", + "line": 29, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 15, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.2.0-ApplicationInstance" + } + ] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Evented-c3c1656769.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Evented-c3c1656769.json new file mode 100644 index 000000000..61131f964 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Evented-c3c1656769.json @@ -0,0 +1,190 @@ +{ + "data": { + "id": "ember-4.2.0-Evented", + "type": "class", + "attributes": { + "name": "Evented", + "shortname": "Evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Route", + "EmberRouter", + "Ember.CoreView" + ], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 13, + "description": "

This mixin allows for Ember objects to subscribe to and emit events.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/utils/person.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport Evented from '@ember/object/evented';\n\nexport default EmberObject.extend(Evented, {\n  greet() {\n    // ...\n    this.trigger('greet');\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
var person = Person.create();\n\nperson.on('greet', function() {\n  console.log('Our person has greeted');\n});\n\nperson.greet();\n\n// outputs: 'Our person has greeted'
\n
\n
\n \n

You can also chain multiple event subscriptions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
person.on('greet', function() {\n  console.log('Our person has greeted');\n}).one('greet', function() {\n  console.log('Offer one-time special');\n}).off('event', this, forgetThis);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 54, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 80, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 101, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 124, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 139, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-HashLocation-6f1040da73.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-HashLocation-6f1040da73.json new file mode 100644 index 000000000..2a1e85a3b --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-HashLocation-6f1040da73.json @@ -0,0 +1,641 @@ +{ + "data": { + "id": "ember-4.2.0-HashLocation", + "type": "class", + "attributes": { + "name": "HashLocation", + "shortname": "HashLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 11, + "description": "

HashLocation implements the location API using the browser's\nhash. At present, it relies on a hashchange event existing in the\nbrowser.

\n

Using HashLocation results in URLs with a # (hash sign) separating the\nserver side URL portion of the URL from the portion that is used by Ember.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'hash'\n});
\n
\n
\n \n

This will result in a posts.new url of /#/posts/new.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 51, + "access": "private", + "tagname": "Returns normalized location.hash", + "since": "1.5.1", + "itemtype": "method", + "name": "getHash", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 63, + "description": "

Returns the normalized URL, constructed from location.hash.

\n

e.g. #/foo => /foo as well as #/foo#bar => /foo#bar.

\n

By convention, hashed paths must begin with a forward slash, otherwise they\nare not treated as a path so we can distinguish intent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 93, + "description": "

Set the location.hash and remembers what was set. This prevents\nonUpdateURL callbacks from triggering when the hash was set by\nHashLocation.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 107, + "description": "

Uses location.replace to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 122, + "description": "

Register a callback to be invoked when the hash changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 147, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 162, + "description": "

Cleans up the HashLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Helper-fa927a2bb0.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Helper-fa927a2bb0.json new file mode 100644 index 000000000..5d521d9f7 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Helper-fa927a2bb0.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.2.0-Helper", + "type": "class", + "attributes": { + "name": "Helper", + "shortname": "Helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 34, + "description": "

Ember Helpers are functions that can compute values, and are used in templates.\nFor example, this code calls a helper named format-currency:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Cost @cents={{230}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/cost.hbs
1\n
<div>{{format-currency @cents currency="$"}}</div>
\n
\n
\n \n

Additionally a helper can be called as a nested helper.\nIn this example, we show the formatted currency value if the showMoney\nnamed argument is truthy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{if @showMoney (format-currency @cents currency="$")}}
\n
\n
\n \n

Helpers defined using a class must provide a compute function. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n6\n7\n
import Helper from '@ember/component/helper';\n\nexport default class extends Helper {\n  compute([cents], { currency }) {\n    return `${currency}${cents * 0.01}`;\n  }\n}
\n
\n
\n \n

Each time the input to a helper changes, the compute function will be\ncalled again.

\n

As instances, these helpers also have access to the container and will accept\ninjected dependencies.

\n

Additionally, class helpers can call recompute to force a new computation.

\n", + "extends": "CoreObject", + "access": "public", + "tagname": "", + "since": "1.13.0", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 85, + "description": "

On a class-based helper, it may be useful to force a recomputation of that\nhelpers value. This is akin to rerender on a component.

\n

For example, this component will rerender when the currentUser on a\nsession service changes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
email.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Helper from '@ember/component/helper'\nimport { service } from '@ember/service'\nimport { observer } from '@ember/object'\n\nexport default Helper.extend({\n  session: service(),\n\n  onNewUser: observer('session.currentUser', function() {\n    this.recompute();\n  }),\n\n  compute() {\n    return this.get('session.currentUser.email');\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "recompute", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 118, + "description": "

Override this function when writing a class-based helper.

\n", + "itemtype": "method", + "name": "compute", + "params": [ + { + "name": "params", + "description": "The positional arguments to the helper", + "type": "Array" + }, + { + "name": "hash", + "description": "The named arguments to the helper", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-HistoryLocation-4fe9b0c303.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-HistoryLocation-4fe9b0c303.json new file mode 100644 index 000000000..83e463c56 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-HistoryLocation-4fe9b0c303.json @@ -0,0 +1,707 @@ +{ + "data": { + "id": "ember-4.2.0-HistoryLocation", + "type": "class", + "attributes": { + "name": "HistoryLocation", + "shortname": "HistoryLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 21, + "description": "

HistoryLocation implements the location API using the browser's\nhistory.pushState API.

\n

Using HistoryLocation results in URLs that are indistinguishable from a\nstandard URL. This relies upon the browser's history API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'history'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new.

\n

Keep in mind that your server must serve the Ember app at all the routes you\ndefine.

\n

Using HistoryLocation will also result in location states being recorded by\nthe browser history API with the following schema:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
window.history.state -> { path: '/', uuid: '3552e730-b4a6-46bd-b8bf-d8c3c1a97e0a' }
\n
\n
\n \n

This allows each in-app location state to be tracked uniquely across history\nstate changes via the uuid field.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 79, + "access": "private", + "tagname": "Returns normalized location.hash", + "itemtype": "method", + "name": "getHash", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 105, + "description": "

Used to set state on first call to setURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initState", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 126, + "description": "

Returns the current location.pathname without rootURL or baseURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 153, + "description": "

Uses history.pushState to update the url without a page reload.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 169, + "description": "

Uses history.replaceState to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 186, + "description": "

Pushes a new state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "pushState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 202, + "description": "

Replaces the current state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 218, + "description": "

Register a callback to be invoked whenever the browser\nhistory changes, including using forward and back buttons.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 243, + "description": "

Used when using {{action}} helper. The url is always appended to the rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "formatted url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 267, + "description": "

Cleans up the HistoryLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 71, + "description": "

Will be pre-pended to path upon state change

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Location-affd212101.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Location-affd212101.json new file mode 100644 index 000000000..5da82de4b --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Location-affd212101.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.2.0-Location", + "type": "class", + "attributes": { + "name": "Location", + "shortname": "Location", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/api.ts", + "line": 21, + "description": "

Location returns an instance of the correct implementation of\nthe location API.

\n

Implementations

\n

You can pass an implementation name (hash, history, none, auto) to force a\nparticular implementation to be used in your application.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n

Location API

\n

Each location implementation must provide the following methods:

\n
    \n
  • implementation: returns the string name used to reference the implementation.
  • \n
  • getURL: returns the current URL.
  • \n
  • setURL(path): sets the current URL.
  • \n
  • replaceURL(path): replace the current URL (optional).
  • \n
  • onUpdateURL(callback): triggers the callback when the URL changes.
  • \n
  • formatURL(url): formats url to be placed into href attribute.
  • \n
  • detect() (optional): instructs the location to do any feature detection\n necessary. If the location needs to redirect to a different URL, it\n can cancel routing by setting the cancelRouterSetup property on itself\n to false.
  • \n
\n

Calling setURL or replaceURL will not trigger onUpdateURL callbacks.

\n

Custom implementation

\n

Ember scans app/locations/* for extending the Location API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import HistoryLocation from '@ember/routing/history-location';\n\nexport default class MyHistory {\n  implementation = 'my-custom-history';\n\n  constructor() {\n    this._history = HistoryLocation.create(...arguments);\n  }\n\n  create() {\n    return new this(...arguments);\n  }\n\n  pushState(path) {\n     this._history.pushState(path);\n  }\n}
\n
\n
\n \n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/api.ts", + "line": 82, + "description": "

This is deprecated in favor of using the container to lookup the location\nimplementation as desired.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
// Given a location registered as follows:\ncontainer.register('location:history-test', HistoryTestLocation);\n\n// You could create a new instance via:\ncontainer.lookup('location:history-test');
\n
\n
\n \n", + "itemtype": "method", + "name": "create", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "an instance of an implementation of the `location` API", + "type": "Object" + }, + "deprecated": true, + "deprecationMessage": "Use the container to lookup the location implementation that you\n need.", + "access": "private", + "tagname": "", + "class": "Location", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Mixin-d5317e4294.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Mixin-d5317e4294.json new file mode 100644 index 000000000..a75f4b1eb --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Mixin-d5317e4294.json @@ -0,0 +1,75 @@ +{ + "data": { + "id": "ember-4.2.0-Mixin", + "type": "class", + "attributes": { + "name": "Mixin", + "shortname": "Mixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 444, + "description": "

The Mixin class allows you to create mixins, whose properties can be\nadded to other classes. For instance,

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nconst EditableMixin = Mixin.create({\n  edit() {\n    console.log('starting to edit');\n    this.set('isEditing', true);\n  },\n  isEditing: false\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import EmberObject from '@ember/object';\nimport EditableMixin from '../mixins/editable';\n\n// Mix mixins into classes by passing them as the first arguments to\n// `.extend.`\nconst Comment = EmberObject.extend(EditableMixin, {\n  post: null\n});\n\nlet comment = Comment.create({\n  post: somePost\n});\n\ncomment.edit(); // outputs 'starting to edit'
\n
\n
\n \n

Note that Mixins are created with Mixin.create, not\nMixin.extend.

\n

Note that mixins extend a constructor's prototype so arrays and object literals\ndefined as properties will be shared amongst objects that implement the mixin.\nIf you want to define a property in a mixin that is not shared, you can define\nit either as a computed property or have it be created on initialization of the object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
// filters array will be shared amongst any object implementing mixin\nimport Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\nconst FilterableMixin = Mixin.create({\n  filters: A()\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\nimport { computed } from '@ember/object';\n\n// filters will be a separate array for every object implementing the mixin\nconst FilterableMixin = Mixin.create({\n  filters: computed(function() {\n    return A();\n  })\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\n// filters will be created as a separate array during the object's initialization\nconst Filterable = Mixin.create({\n  filters: null,\n\n  init() {\n    this._super(...arguments);\n    this.set("filters", A());\n  }\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 430, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Mixin", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.2.0-Ember.TargetActionSupport" + } + ] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-MutableArray-e80dd61506.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-MutableArray-e80dd61506.json new file mode 100644 index 000000000..f9b539319 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-MutableArray-e80dd61506.json @@ -0,0 +1,1239 @@ +{ + "data": { + "id": "ember-4.2.0-MutableArray", + "type": "class", + "attributes": { + "name": "MutableArray", + "shortname": "MutableArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "ArrayProxy" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1326, + "description": "

This mixin defines the API for modifying array-like objects. These methods\ncan be applied only to a collection that keeps its items in an ordered set.\nIt builds upon the Array mixin and adds methods to modify the array.\nOne concrete implementations of this class include ArrayProxy.

\n

It is important to use the methods in this class to modify arrays so that\nchanges are observable. This allows the binding system in Ember to function\ncorrectly.

\n

Note that an Array can change even if it does not implement this mixin.\nFor example, one might implement a SparseArray that cannot be directly\nmodified, but if its underlying enumerable changes, it will change also.

\n", + "uses": [ + "MutableEnumerable", + "EmberArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1348, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray" + } + ], + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1367, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1393, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1415, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1440, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1460, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1480, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1506, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1531, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1551, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumberable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1572, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1591, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1618, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1646, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1663, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1689, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1116, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1154, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1166, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1182, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1215, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1259, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1278, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1300, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-NoneLocation-db3cb8c452.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-NoneLocation-db3cb8c452.json new file mode 100644 index 000000000..b7f91379b --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-NoneLocation-db3cb8c452.json @@ -0,0 +1,639 @@ +{ + "data": { + "id": "ember-4.2.0-NoneLocation", + "type": "class", + "attributes": { + "name": "NoneLocation", + "shortname": "NoneLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 10, + "description": "

NoneLocation does not interact with the browser. It is useful for\ntesting, or when you need to manage state with your Router, but temporarily\ndon't want it to muck with the URL (for example when you embed your\napplication in a larger page).

\n

Using NoneLocation causes Ember to not store the applications URL state\nin the actual URL. This is generally used for testing purposes, and is one\nof the changes made when calling App.setupForTesting().

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 55, + "description": "

Returns the current path without rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "path", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 72, + "description": "

Set the path and remembers what was set. Using this method\nto change the path will not invoke the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 84, + "description": "

Register a callback to be invoked when the path changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 97, + "description": "

Sets the path and calls the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "handleURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 109, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 31, + "description": "

Will be pre-pended to path.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-ObjectProxy-969659b01e.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-ObjectProxy-969659b01e.json new file mode 100644 index 000000000..3f8b70bad --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-ObjectProxy-969659b01e.json @@ -0,0 +1,555 @@ +{ + "data": { + "id": "ember-4.2.0-ObjectProxy", + "type": "class", + "attributes": { + "name": "ObjectProxy", + "shortname": "ObjectProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/object_proxy.js", + "line": 4, + "description": "

ObjectProxy forwards all properties not defined by the proxy itself\nto a proxied content object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nlet exampleObject = EmberObject.create({\n  name: 'Foo'\n});\n\nlet exampleProxy = ObjectProxy.create({\n  content: exampleObject\n});\n\n// Access and change existing properties\nexampleProxy.get('name');          // 'Foo'\nexampleProxy.set('name', 'Bar');\nexampleObject.get('name');         // 'Bar'\n\n// Create new 'description' property on `exampleObject`\nexampleProxy.set('description', 'Foo is a whizboo baz');\nexampleObject.get('description');  // 'Foo is a whizboo baz'
\n
\n
\n \n

While content is unset, setting a property to be delegated will throw an\nError.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import ObjectProxy from '@ember/object/proxy';\n\nlet exampleProxy = ObjectProxy.create({\n  content: null,\n  flag: null\n});\nexampleProxy.set('flag', true);\nexampleProxy.get('flag');         // true\nexampleProxy.get('foo');          // undefined\nexampleProxy.set('foo', 'data');  // throws Error
\n
\n
\n \n

Delegated properties can be bound to and will change when content is updated.

\n

Computed properties on the proxy itself can depend on delegated properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { computed } from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nProxyWithComputedProperty = ObjectProxy.extend({\n  fullName: computed('firstName', 'lastName', function() {\n    var firstName = this.get('firstName'),\n        lastName = this.get('lastName');\n    if (firstName && lastName) {\n      return firstName + ' ' + lastName;\n    }\n    return firstName || lastName;\n  })\n});\n\nlet exampleProxy = ProxyWithComputedProperty.create();\n\nexampleProxy.get('fullName');  // undefined\nexampleProxy.set('content', {\n  firstName: 'Tom', lastName: 'Dale'\n}); // triggers property change for fullName on proxy\n\nexampleProxy.get('fullName');  // 'Tom Dale'
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "Ember.ProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.js", + "line": 64, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Observable-c987f713f4.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Observable-c987f713f4.json new file mode 100644 index 000000000..b4de42803 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Observable-c987f713f4.json @@ -0,0 +1,388 @@ +{ + "data": { + "id": "ember-4.2.0-Observable", + "type": "class", + "attributes": { + "name": "Observable", + "shortname": "Observable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "EmberObject" + ], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 21, + "description": "

Overview

\n

This mixin provides properties and property observing functionality, core\nfeatures of the Ember object model.

\n

Properties and observers allow one object to observe changes to a\nproperty on another object. This is one of the fundamental ways that\nmodels, controllers and views communicate with each other in an Ember\napplication.

\n

Any object that has this mixin applied can be used in observer\noperations. That includes EmberObject and most objects you will\ninteract with as you write your Ember application.

\n

Note that you will not generally apply this mixin to classes yourself,\nbut you will use the features provided by this module frequently, so it\nis important to understand how to use it.

\n

Using get() and set()

\n

Because of Ember's support for bindings and observers, you will always\naccess properties using the get method, and set properties using the\nset method. This allows the observing objects to be notified and\ncomputed properties to be handled properly.

\n

More documentation about get and set are below.

\n

Observing Property Changes

\n

You typically observe property changes simply by using the observer\nfunction in classes that you write.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { observer } from '@ember/object';\nimport EmberObject from '@ember/object';\n\nEmberObject.extend({\n  valueObserver: observer('value', function(sender, key, value, rev) {\n    // Executes whenever the "value" property changes\n    // See the addObserver method for more information about the callback arguments\n  })\n});
\n
\n
\n \n

Although this is the most common way to add an observer, this capability\nis actually built into the EmberObject class on top of two methods\ndefined in this mixin: addObserver and removeObserver. You can use\nthese two methods to add and remove observers yourself if you need to\ndo so at runtime.

\n

To add an observer for a property, call:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
object.addObserver('propertyKey', targetObject, targetAction)
\n
\n
\n \n

This will call the targetAction method on the targetObject whenever\nthe value of the propertyKey changes.

\n

Note that if propertyKey is a computed property, the observer will be\ncalled when any of the property dependencies are changed, even if the\nresulting value of the computed property is unchanged. This is necessary\nbecause computed properties are not computed until get is called.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Promise-e953a8ff09.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Promise-e953a8ff09.json new file mode 100644 index 000000000..eaac96f12 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Promise-e953a8ff09.json @@ -0,0 +1,246 @@ +{ + "data": { + "id": "ember-4.2.0-Promise", + "type": "class", + "attributes": { + "name": "Promise", + "shortname": "Promise", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 26, + "description": "

Promise objects represent the eventual result of an asynchronous operation. The\nprimary way of interacting with a promise is through its then method, which\nregisters callbacks to receive either a promise’s eventual value or the reason\nwhy the promise cannot be fulfilled.

\n

Terminology

\n
    \n
  • promise is an object or function with a then method whose behavior conforms to this specification.
  • \n
  • thenable is an object or function that defines a then method.
  • \n
  • value is any legal JavaScript value (including undefined, a thenable, or a promise).
  • \n
  • exception is a value that is thrown using the throw statement.
  • \n
  • reason is a value that indicates why a promise was rejected.
  • \n
  • settled the final resting state of a promise, fulfilled or rejected.
  • \n
\n

A promise can be in one of three states: pending, fulfilled, or rejected.

\n

Promises that are fulfilled have a fulfillment value and are in the fulfilled\nstate. Promises that are rejected have a rejection reason and are in the\nrejected state. A fulfillment value is never a thenable.

\n

Promises can also be said to resolve a value. If this value is also a\npromise, then the original promise's settled state will match the value's\nsettled state. So a promise that resolves a promise that rejects will\nitself reject, and a promise that resolves a promise that fulfills will\nitself fulfill.

\n

Basic Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
let promise = new Promise(function(resolve, reject) {\n  // on success\n  resolve(value);\n\n  // on failure\n  reject(reason);\n});\n\npromise.then(function(value) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Advanced Usage:

\n

Promises shine when abstracting away asynchronous interactions such as\nXMLHttpRequests.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
function getJSON(url) {\n  return new Promise(function(resolve, reject){\n    let xhr = new XMLHttpRequest();\n\n    xhr.open('GET', url);\n    xhr.onreadystatechange = handler;\n    xhr.responseType = 'json';\n    xhr.setRequestHeader('Accept', 'application/json');\n    xhr.send();\n\n    function handler() {\n      if (this.readyState === this.DONE) {\n        if (this.status === 200) {\n          resolve(this.response);\n        } else {\n          reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n        }\n      }\n    };\n  });\n}\n\ngetJSON('/posts.json').then(function(json) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Unlike callbacks, promises are great composable primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Promise.all([\n  getJSON('/posts'),\n  getJSON('/comments')\n]).then(function(values){\n  values[0] // => postsJSON\n  values[1] // => commentsJSON\n\n  return values;\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "params": [ + { + "name": "resolver", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "is_constructor": 1, + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/promise/all.js", + "line": 3, + "description": "

Promise.all accepts an array of promises, and returns a new promise which\nis fulfilled with an array of fulfillment values for the passed promises, or\nrejected with the reason of the first passed promise to be rejected. It casts all\nelements of the passed iterable to promises as it runs this algorithm.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Promise, { resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // The array here would be [ 1, 2, 3 ];\n});
\n
\n
\n \n

If any of the promises given to RSVP.all are rejected, the first promise\nthat is rejected will be given as an argument to the returned promises's\nrejection handler. For example:

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Promise, { resolve, reject } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error("2"));\nlet promise3 = reject(new Error("3"));\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(error) {\n  // error.message === "2"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "all", + "params": [ + { + "name": "entries", + "description": "array of promises", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all `promises` have been\nfulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "static": 1, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/race.js", + "line": 9, + "description": "

Promise.race returns a new promise which is settled in the same way as the\nfirst passed promise to settle.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 2');\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // result === 'promise 2' because it was resolved before promise1\n  // was resolved.\n});
\n
\n
\n \n

Promise.race is deterministic in that only the state of the first\nsettled promise matters. For example, even if other promises given to the\npromises array argument are resolved, but the first settled promise has\nbecome rejected before the other promises became fulfilled, the returned\npromise will become rejected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    reject(new Error('promise 2'));\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // Code here never runs\n}, function(reason){\n  // reason.message === 'promise 2' because promise 2 became rejected before\n  // promise 1 became fulfilled\n});
\n
\n
\n \n

An example real-world use case is implementing timeouts:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import Promise from 'rsvp';\n\nPromise.race([ajax('foo.json'), timeout(5000)])
\n
\n
\n \n", + "itemtype": "method", + "name": "race", + "static": 1, + "params": [ + { + "name": "entries", + "description": "array of promises to observe", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for describing the promise returned.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise which settles in the same way as the first passed\npromise to settle.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/reject.js", + "line": 6, + "description": "

Promise.reject returns a promise rejected with the passed reason.\nIt is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  reject(new Error('WHOOPS'));\n});\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = Promise.reject(new Error('WHOOPS'));\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/resolve.js", + "line": 6, + "description": "

Promise.resolve returns a promise that will become resolved with the\npassed value. It is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  resolve(1);\n});\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Promise from 'rsvp';\n\nlet promise = RSVP.Promise.resolve(1);\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "resolve", + "static": 1, + "params": [ + { + "name": "object", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 155, + "description": "

catch is simply sugar for then(undefined, onRejection) which makes it the same\nas the catch block of a try/catch statement.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
function findAuthor(){\n  throw new Error('couldn\\'t find that author');\n}\n\n// synchronous\ntry {\n  findAuthor();\n} catch(reason) {\n  // something went wrong\n}\n\n// async with promises\nfindAuthor().catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 187, + "description": "

finally will be invoked regardless of the promise's fate just as native\ntry/catch/finally behaves

\n

Synchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
findAuthor() {\n  if (Math.random() > 0.5) {\n    throw new Error();\n  }\n  return new Author();\n}\n\ntry {\n  return findAuthor(); // succeed or fail\n} catch(error) {\n  return findOtherAuthor();\n} finally {\n  // always runs\n  // doesn't affect the return value\n}
\n
\n
\n \n

Asynchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findAuthor().catch(function(reason){\n  return findOtherAuthor();\n}).finally(function(){\n  // author was either found, or not\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 248, + "description": "

The primary way of interacting with a promise is through its then method,\nwhich registers callbacks to receive either a promise's eventual value or the\nreason why the promise cannot be fulfilled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function(user){\n  // user is available\n}, function(reason){\n  // user is unavailable, and you are given the reason why\n});
\n
\n
\n \n

Chaining

\n

The return value of then is itself a promise. This second, 'downstream'\npromise is resolved with the return value of the first promise's fulfillment\nor rejection handler, or rejected if the handler throws an exception.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
findUser().then(function (user) {\n  return user.name;\n}, function (reason) {\n  return 'default name';\n}).then(function (userName) {\n  // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n  // will be `'default name'`\n});\n\nfindUser().then(function (user) {\n  throw new Error('Found user, but still unhappy');\n}, function (reason) {\n  throw new Error('`findUser` rejected and we\\'re unhappy');\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n  // If `findUser` rejected, `reason` will be '`findUser` rejected and we\\'re unhappy'.\n});
\n
\n
\n \n

If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
findUser().then(function (user) {\n  throw new PedagogicalException('Upstream error');\n}).then(function (value) {\n  // never reached\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // The `PedgagocialException` is propagated all the way down to here\n});
\n
\n
\n \n

Assimilation

\n

Sometimes the value you want to propagate to a downstream promise can only be\nretrieved asynchronously. This can be achieved by returning a promise in the\nfulfillment or rejection handler. The downstream promise will then be pending\nuntil the returned promise is settled. This is called assimilation.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // The user's comments are now available\n});
\n
\n
\n \n

If the assimliated promise rejects, then the downstream promise will also reject.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // If `findCommentsByAuthor` fulfills, we'll have the value here\n}, function (reason) {\n  // If `findCommentsByAuthor` rejects, we'll have the reason here\n});
\n
\n
\n \n

Simple Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let result;\n\ntry {\n  result = findResult();\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findResult(function(result, err){\n  if (err) {\n    // failure\n  } else {\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findResult().then(function(result){\n  // success\n}, function(reason){\n  // failure\n});
\n
\n
\n \n

Advanced Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let author, books;\n\ntry {\n  author = findAuthor();\n  books  = findBooksByAuthor(author);\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
function foundBooks(books) {\n\n}\n\nfunction failure(reason) {\n\n}\n\nfindAuthor(function(author, err){\n  if (err) {\n    failure(err);\n    // failure\n  } else {\n    try {\n      findBoooksByAuthor(author, function(books, err) {\n        if (err) {\n          failure(err);\n        } else {\n          try {\n            foundBooks(books);\n          } catch(reason) {\n            failure(reason);\n          }\n        }\n      });\n    } catch(error) {\n      failure(err);\n    }\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findAuthor().\n  then(findBooksByAuthor).\n  then(function(books){\n    // found books\n}).catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "onFulfillment", + "description": "", + "type": "Function" + }, + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-PromiseProxyMixin-0ee270add6.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-PromiseProxyMixin-0ee270add6.json new file mode 100644 index 000000000..2e2fef54c --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-PromiseProxyMixin-0ee270add6.json @@ -0,0 +1,186 @@ +{ + "data": { + "id": "ember-4.2.0-PromiseProxyMixin", + "type": "class", + "attributes": { + "name": "PromiseProxyMixin", + "shortname": "PromiseProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 37, + "description": "

A low level mixin making ObjectProxy promise-aware.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { resolve } from 'rsvp';\nimport $ from 'jquery';\nimport ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nlet ObjectPromiseProxy = ObjectProxy.extend(PromiseProxyMixin);\n\nlet proxy = ObjectPromiseProxy.create({\n  promise: resolve($.getJSON('/some/remote/data.json'))\n});\n\nproxy.then(function(json){\n   // the json\n}, function(reason) {\n   // the reason why you have no json\n});
\n
\n
\n \n

the proxy has bindable attributes which\ntrack the promises life cycle

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> true\nproxy.get('isSettled')  //=> false\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> false
\n
\n
\n \n

When the $.getJSON completes, and the promise is fulfilled\nwith json, the life cycle attributes will update accordingly.\nNote that $.getJSON doesn't return an ECMA specified promise,\nit is useful to wrap this with an RSVP.resolve so that it behaves\nas a spec compliant promise.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> false\nproxy.get('isSettled')   //=> true\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> true
\n
\n
\n \n

As the proxy is an ObjectProxy, and the json now its content,\nall the json properties will be available directly from the proxy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// Assuming the following json:\n{\n  firstName: 'Stefan',\n  lastName: 'Penner'\n}\n\n// both properties will accessible on the proxy\nproxy.get('firstName') //=> 'Stefan'\nproxy.get('lastName')  //=> 'Penner'
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 180, + "description": "

An alias to the proxied promise's then.

\n

See RSVP.Promise.then.

\n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 192, + "description": "

An alias to the proxied promise's catch.

\n

See RSVP.Promise.catch.

\n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 205, + "description": "

An alias to the proxied promise's finally.

\n

See RSVP.Promise.finally.

\n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 101, + "description": "

If the proxied promise is rejected this will contain the reason\nprovided.

\n", + "itemtype": "property", + "name": "reason", + "default": "null", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 111, + "description": "

Once the proxied promise has settled this will become false.

\n", + "itemtype": "property", + "name": "isPending", + "default": "true", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 122, + "description": "

Once the proxied promise has settled this will become true.

\n", + "itemtype": "property", + "name": "isSettled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 133, + "description": "

Will become true if the proxied promise is rejected.

\n", + "itemtype": "property", + "name": "isRejected", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 142, + "description": "

Will become true if the proxied promise is fulfilled.

\n", + "itemtype": "property", + "name": "isFulfilled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 151, + "description": "

The promise whose fulfillment value is being proxied by this object.

\n

This property must be specified upon creation, and should not be\nchanged once created.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nObjectProxy.extend(PromiseProxyMixin).create({\n  promise: <thenable>\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "promise", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Registry-fc078ad52f.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Registry-fc078ad52f.json new file mode 100644 index 000000000..1e2588a9b --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Registry-fc078ad52f.json @@ -0,0 +1,421 @@ +{ + "data": { + "id": "ember-4.2.0-Registry", + "type": "class", + "attributes": { + "name": "Registry", + "shortname": "Registry", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 65, + "description": "

A registry used to store factory and option information keyed\nby type.

\n

A Registry stores the factory and option information needed by a\nContainer to instantiate and cache objects.

\n

The API for Registry is still in flux and should not be considered stable.

\n", + "access": "private", + "tagname": "", + "since": "1.11.0", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 154, + "description": "

Creates a container based on this registry.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "container", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "created container", + "type": "Container" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 166, + "description": "

Registers a factory for later injection.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let registry = new Registry();\n\nregistry.register('model:user', Person, {singleton: false });\nregistry.register('fruit:favorite', Orange);\nregistry.register('communication:main', Email, {singleton: false});
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "factory", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 200, + "description": "

Unregister a fullName

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.register('model:user', User);\n\nregistry.resolve('model:user').create() instanceof User //=> true\n\nregistry.unregister('model:user')\nregistry.resolve('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 230, + "description": "

Given a fullName return the corresponding factory.

\n

By default resolve will retrieve the factory from\nthe registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let registry = new Registry();\nregistry.register('api:twitter', Twitter);\n\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n

Optionally the registry can be provided with a custom resolver.\nIf provided, resolve will first provide the custom resolver\nthe opportunity to resolve the fullName, otherwise it will fallback\nto the registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.resolver = function(fullName) {\n   // lookup via the module system of choice\n };\n\n// the twitter factory is added to the module system\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "the fullname of the request source (used for local lookups)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 273, + "description": "

A hook that can be used to describe how the resolver will\nattempt to find the factory.

\n

For example, the default Ember .describe returns the full\nclass name (including namespace) where Ember's resolver expects\nto find the fullName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "describe", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "described fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 296, + "description": "

A hook to enable custom fullName normalization behavior

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalizeFullName", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 314, + "description": "

Normalize a fullName based on the application's conventions

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalize", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 329, + "itemtype": "method", + "name": "makeToString", + "access": "private", + "tagname": "", + "params": [ + { + "name": "factory", + "description": "", + "type": "Any" + }, + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "toString function", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 347, + "description": "

Given a fullName check if the container is aware of its factory\nor singleton instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "the fullname of the request source (used for local lookups)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 366, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let registry = new Registry();\nlet container = registry.container();\n\n// if all of type `connection` must not be singletons\nregistry.optionsForType('connection', { singleton: false });\n\nregistry.register('connection:twitter', TwitterConnection);\nregistry.register('connection:facebook', FacebookConnection);\n\nlet twitter = container.lookup('connection:twitter');\nlet twitter2 = container.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = container.lookup('connection:facebook');\nlet facebook2 = container.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "optionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 407, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "options", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 478, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "knownForType", + "params": [ + { + "name": "type", + "description": "the type to iterate over", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 104, + "description": "

A backup registry for resolving registrations when no matches can be found.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "fallback", + "type": "Registry", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 112, + "description": "

An object that has a resolve method that resolves a name.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "resolver", + "type": "Resolver", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 120, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registrations", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 126, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_normalizeCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 133, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_resolveCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 140, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_options", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 147, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_typeOptions", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-RegistryProxyMixin-7e1fe0007e.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-RegistryProxyMixin-7e1fe0007e.json new file mode 100644 index 000000000..b79dae520 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-RegistryProxyMixin-7e1fe0007e.json @@ -0,0 +1,284 @@ +{ + "data": { + "id": "ember-4.2.0-RegistryProxyMixin", + "type": "class", + "attributes": { + "name": "RegistryProxyMixin", + "shortname": "RegistryProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Application", + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 8, + "description": "

RegistryProxyMixin is used to provide public access to specific\nregistry functionality.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 18, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 31, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 101, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 124, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 134, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 145, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 155, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 165, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 198, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 208, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Route-0467ae62d6.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Route-0467ae62d6.json new file mode 100644 index 000000000..a47f41802 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Route-0467ae62d6.json @@ -0,0 +1,1706 @@ +{ + "data": { + "id": "ember-4.2.0-Route", + "type": "class", + "attributes": { + "name": "Route", + "shortname": "Route", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 84, + "description": "

The Route class is used to define individual routes. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented", + "ActionHandler" + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 308, + "description": "

Sets the name for this route, including a fully resolved name for routes\ninside engines.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_setRouteName", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 321, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_stashNames", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 361, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_updatingQPChanged", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 369, + "description": "

Returns a hash containing the parameters of an ancestor route.

\n

You may notice that this.paramsFor sometimes works when referring to a\nchild route, but this behavior should not be relied upon as only ancestor\nroutes are certain to be loaded in time.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('member', { path: ':name' }, function() {\n    this.route('interest', { path: ':interest' });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class MemberRoute extends Route {\n  queryParams = {\n    memberQp: { refreshModel: true }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member/interest.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default class MemberInterestRoute extends Route {\n  queryParams = {\n    interestQp: { refreshModel: true }\n  }\n\n  model() {\n    return this.paramsFor('member');\n  }\n}
\n
\n
\n \n

If we visit /turing/maths?memberQp=member&interestQp=interest the model for\nthe member.interest route is a hash with:

\n
    \n
  • name: turing
  • \n
  • memberQp: member
  • \n
\n", + "itemtype": "method", + "name": "paramsFor", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "return": { + "description": "hash containing the parameters of the route `name`", + "type": "Object" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 448, + "description": "

Serializes the query parameter key

\n", + "itemtype": "method", + "name": "serializeQueryParamKey", + "params": [ + { + "name": "controllerPropertyName", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 459, + "description": "

Serializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 475, + "description": "

Deserializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 507, + "description": "

A hook you can use to reset controller values either when the model\nchanges or the route is exiting.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/articles.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class ArticlesRoute extends Route {\n  resetController(controller, isExiting, transition) {\n    if (isExiting && transition.targetName !== 'error') {\n      controller.set('page', 1);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "resetController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "isExiting", + "description": "", + "type": "Boolean" + }, + { + "name": "transition", + "description": "", + "type": "Object" + } + ], + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 534, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "exit", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 545, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_internalReset", + "since": "3.6.0", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 558, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "enter", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 774, + "description": "

This hook is executed when the router completely exits this route. It is\nnot executed when the model for the route changes.

\n", + "itemtype": "method", + "name": "deactivate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 785, + "description": "

This hook is executed when the router enters the route. It is not executed\nwhen the model for the route changes.

\n", + "itemtype": "method", + "name": "activate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 796, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogPosts');\nthis.transitionTo('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('blogPost', { path:':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogComment', aPost, aComment);\nthis.transitionTo('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
this.transitionTo('/');\nthis.transitionTo('/blog/post/1/comment/13');\nthis.transitionTo('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
this.transitionTo('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\nthis.transitionTo({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceWith.

\n

Simple Transition Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n  this.route('fourOhFour', { path: '*:' });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToSecret(context) {\n    if (authorized()) {\n      this.transitionTo('secret', context);\n    } else {\n      this.transitionTo('fourOhFour');\n    }\n  }\n}
\n
\n
\n \n

Transition to a nested route

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('articles', { path: '/articles' }, function() {\n    this.route('new');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToNewArticle() {\n    this.transitionTo('articles.new');\n  }\n}
\n
\n
\n \n

Multiple Models Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n\n  this.route('breakfast', { path: ':breakfastId' }, function() {\n    this.route('cereal', { path: ':cerealId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToChocolateCereal() {\n    let cereal = { cerealId: 'ChocolateYumminess' };\n    let breakfast = { breakfastId: 'CerealAndMilk' };\n\n    this.transitionTo('breakfast.cereal', breakfast, cereal);\n  }\n}
\n
\n
\n \n

Nested Route with Query String Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('fruits', function() {\n    this.route('apples');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToApples() {\n    this.transitionTo('fruits.apples', { queryParams: { color: 'red' } });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL.", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 994, + "description": "

Perform a synchronous transition into another route without attempting\nto resolve promises, update the URL, or abort any currently active\nasynchronous transitions (i.e. regular transitions caused by\ntransitionTo or URL changes).

\n

This method is handy for performing intermediate transitions on the\nway to a final destination route, and is called internally by the\ndefault implementations of the error and loading handlers.

\n", + "itemtype": "method", + "name": "intermediateTransitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) to be used while transitioning\nto the route.", + "type": "...Object" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1016, + "description": "

Refresh the model on this route and any child routes, firing the\nbeforeModel, model, and afterModel hooks in a similar fashion\nto how routes are entered when transitioning in from other route.\nThe current route params (e.g. article_id) will be passed in\nto the respective model hooks, and if a different model is returned,\nsetupController and associated route hooks will re-fire as well.

\n

An example usage of this method is re-querying the server for the\nlatest information using the same parameters as when the route\nwas first entered.

\n

Note that this will cause model hooks to fire even on routes\nthat were provided a model object when the route was initially\nentered.

\n", + "itemtype": "method", + "name": "refresh", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1042, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionTo in all other respects. See\n'transitionTo' for additional information regarding multiple models.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/secret.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class SecretRoute Route {\n  afterModel() {\n    if (!authorized()){\n      this.replaceWith('index');\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1090, + "description": "

This hook is the entry point for router.js

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1170, + "description": "

This hook is the first of the route entry validation hooks\ncalled when an attempt is made to transition into a route\nor one of its children. It is called before model and\nafterModel, and is appropriate for cases when:

\n
    \n
  1. A decision can be made to redirect elsewhere without\nneeding to resolve the model first.
  2. \n
  3. Any async operations need to occur first before the\nmodel is attempted to be resolved.
  4. \n
\n

This hook is provided the current transition attempt\nas a parameter, which can be used to .abort() the transition,\nsave it for a later .retry(), or retrieve values set\non it from a previous hook. You can also just call\nthis.transitionTo to another route to implicitly\nabort the transition.

\n

You can return a promise from this hook to pause the\ntransition until the promise resolves (or rejects). This could\nbe useful, for instance, for retrieving async code from\nthe server that is required to enter a route.

\n", + "itemtype": "method", + "name": "beforeModel", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1204, + "description": "

This hook is called after this route's model has resolved.\nIt follows identical async/promise semantics to beforeModel\nbut is provided the route's resolved model in addition to\nthe transition, and is therefore suited to performing\nlogic that can only take place after the model has already\nresolved.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n  afterModel(posts, transition) {\n    if (posts.get('length') === 1) {\n      this.transitionTo('post.show', posts.get('firstObject'));\n    }\n  }\n}
\n
\n
\n \n

Refer to documentation for beforeModel for a description\nof transition-pausing semantics when a promise is returned\nfrom this hook.

\n", + "itemtype": "method", + "name": "afterModel", + "params": [ + { + "name": "resolvedModel", + "description": "the value returned from `model`,\n or its resolved value if it was a promise", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1241, + "description": "

A hook you can implement to optionally redirect to another route.

\n

Calling this.transitionTo from inside of the redirect hook will\nabort the current transition (into the route that has implemented redirect).

\n

redirect and afterModel behave very similarly and are\ncalled almost at the same time, but they have an important\ndistinction when calling this.transitionTo to a child route\nof the current route. From afterModel, this new transition\ninvalidates the current transition, causing beforeModel,\nmodel, and afterModel hooks to be called again. But the\nsame transition started from redirect does not invalidate\nthe current transition. In other words, by the time the redirect\nhook has been called, both the resolved model and the attempted\nentry into this route are considered fully validated.

\n", + "itemtype": "method", + "name": "redirect", + "params": [ + { + "name": "model", + "description": "the model for this route", + "type": "Object" + }, + { + "name": "transition", + "description": "the transition object associated with the current transition", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1266, + "description": "

Called when the context is changed by router.js.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "contextDidChange", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1276, + "description": "

A hook you can implement to convert the URL into the model for\nthis route.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

The model for the post route is store.findRecord('post', params.post_id).

\n

By default, if your route has a dynamic segment ending in _id:

\n
    \n
  • The model class is determined from the segment (post_id's\nclass is App.Post)
  • \n
  • The find method is called on the model class with the value of\nthe dynamic segment.
  • \n
\n

Note that for routes with dynamic segments, this hook is not always\nexecuted. If the route is entered through a transition (e.g. when\nusing the link-to Handlebars helper or the transitionTo method\nof routes), and a model context is already provided this hook\nis not called.

\n

A model context does not include a primitive string or number,\nwhich does cause the model hook to be called.

\n

Routes without dynamic segments will always execute the model hook.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
// no dynamic segment, model hook always called\nthis.transitionTo('posts');\n\n// model passed in, so model hook not called\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost);\n\n// integer passed in, model hook is called\nthis.transitionTo('post', 1);\n\n// model id passed in, model hook is called\n// useful for forcing the hook to execute\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost.id);
\n
\n
\n \n

This hook follows the asynchronous/promise semantics\ndescribed in the documentation for beforeModel. In particular,\nif a promise returned from model fails, the error will be\nhandled by the error hook on Route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model(params) {\n    return this.store.findRecord('post', params.post_id);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "model", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route. If\n a promise is returned, the transition will pause until\n the promise resolves, and the resolved value of the promise\n will be used as the model for this route.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1385, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "deserialize", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route.\n\nRouter.js hook.", + "type": "Any | Promise" + }, + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1398, + "itemtype": "method", + "name": "findModel", + "params": [ + { + "name": "type", + "description": "the model type", + "type": "String" + }, + { + "name": "value", + "description": "the value passed to find", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1409, + "description": "

A hook you can use to setup the controller for the current route.

\n

This method is called with the controller for the current route and the\nmodel supplied by the model hook.

\n

By default, the setupController hook sets the model property of\nthe controller to the specified model when it is not undefined.

\n

If you implement the setupController hook in your Route, it will\nprevent this default behavior. If you want to preserve that behavior\nwhen implementing your setupController function, make sure to call\nsuper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/photos.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PhotosRoute extends Route {\n  model() {\n    return this.store.findAll('photo');\n  }\n\n  setupController(controller, model) {\n    super.setupController(controller, model);\n\n    this.controllerFor('application').set('showingPhotos', true);\n  }\n}
\n
\n
\n \n

The provided controller will be one resolved based on the name\nof this route.

\n

If no explicit controller is defined, Ember will automatically create one.

\n

As an example, consider the router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

If you have defined a file for the post controller,\nthe framework will use it.\nIf it is not defined, a basic Controller instance would be used.

\n", + "example": [ + " Behavior of a basic Controller\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, model) {\n controller.set('model', model);\n }\n});\n```" + ], + "itemtype": "method", + "name": "setupController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "model", + "description": "", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition", + "optional": true + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1486, + "description": "

Returns the controller of the current route, or a parent (or any ancestor)\nroute in a route hierarchy.

\n

The controller instance must already have been created, either through entering the\nassociated route or using generateController.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.controllerFor('posts').set('currentPost', post);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "controllerFor", + "params": [ + { + "name": "name", + "description": "the name of the route or controller", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Controller" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1532, + "description": "

Generates a controller for a route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class Post extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.generateController('posts');\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "generateController", + "params": [ + { + "name": "name", + "description": "the name of the controller", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1559, + "description": "

Returns the resolved model of a parent (or any ancestor) route\nin a route hierarchy. During a transition, all routes\nmust resolve a model object, and if a route\nneeds access to a parent route's model in order to\nresolve a model (or just reuse the model from a parent),\nit can call this.modelFor(theNameOfParentRoute) to\nretrieve it. If the ancestor route's model was a promise,\nits resolved result is returned.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' }, function() {\n    this.route('comments');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post/comments.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostCommentsRoute extends Route {\n  model() {\n    let post = this.modelFor('post');\n\n    return post.comments;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "modelFor", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "the model object", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1630, + "description": "

this[RENDER] is used to render a template into a region of another template\n(indicated by an {{outlet}}).

\n", + "itemtype": "method", + "name": "this[RENDER]", + "params": [ + { + "name": "name", + "description": "the name of the template to render", + "type": "String" + }, + { + "name": "options", + "description": "the options", + "type": "Object", + "optional": true, + "props": [ + { + "name": "into", + "description": "the template to render into,\n referenced by name. Defaults to the parent template", + "type": "String", + "optional": true + }, + { + "name": "outlet", + "description": "the outlet inside `options.into` to render into.\n Defaults to 'main'", + "type": "String", + "optional": true + }, + { + "name": "controller", + "description": "the controller to use for this template,\n referenced by name or as a controller instance. Defaults to the Route's paired controller", + "type": "String|Object", + "optional": true + }, + { + "name": "model", + "description": "the model object to set on `options.controller`.\n Defaults to the return value of the Route's model hook", + "type": "Object", + "optional": true + } + ] + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1657, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "teardownViews", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1670, + "description": "

Allows you to produce custom metadata for the route.\nThe return value of this method will be attached to\nits corresponding RouteInfoWithAttributes object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostsIndexRoute extends Route {\n  buildRouteInfoMetadata() {\n    return { title: 'Posts Page' }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service router\n\n  constructor() {\n    super(...arguments);\n\n    this.router.on('routeDidChange', transition => {\n      document.title = transition.to.metadata.title;\n      // would update document's title to "Posts Page"\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "buildRouteInfoMetadata", + "return": { + "description": "any" + }, + "since": "3.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1915, + "description": "

Sends an action to the router, which will delegate it to the currently\nactive route hierarchy per the bubbling rules explained under actions.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  track(arg) {\n    console.log(arg, 'was clicked');\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  trackIfDebug(arg) {\n    if (debug) {\n      this.send('track', arg);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "name", + "description": "the name of the action to trigger", + "type": "String" + }, + { + "name": "args", + "description": "", + "type": "...*" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2242, + "description": "

A hook you can implement to convert the route's model into parameters\nfor the URL.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model({ post_id }) {\n    // the server returns `{ id: 12 }`\n    return fetch(`/posts/${post_id}`;\n  }\n\n  serialize(model) {\n    // this will make the URL `/posts/12`\n    return { post_id: model.id };\n  }\n}
\n
\n
\n \n

The default serialize method will insert the model's id into the\nroute's dynamic segment (in this case, :post_id) if the segment contains '_id'.\nIf the route has multiple dynamic segments or does not contain '_id', serialize\nwill return getProperties(model, params)

\n

This method is called when transitionTo is called with a context\nin order to populate the URL.

\n", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "model", + "description": "the routes model", + "type": "Object" + }, + { + "name": "params", + "description": "an Array of parameter names for the current\n route (in the example, `['post_id']`.", + "type": "Array" + } + ], + "return": { + "description": "the serialized parameters", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2343, + "description": "

This action is called when one or more query params have changed. Bubbles.

\n", + "itemtype": "method", + "name": "queryParamsDidChange", + "params": [ + { + "name": "changed", + "description": "Keys are names of query params that have changed.", + "type": "Object" + }, + { + "name": "totalPresent", + "description": "Keys are names of query params that are currently set.", + "type": "Object" + }, + { + "name": "removed", + "description": "Keys are names of query params that have been removed.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 54, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 80, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 101, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 124, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 139, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 569, + "description": "

The willTransition action 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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ContactFormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData')) {\n      this.controller.displayNavigationConfirm();\n      transition.abort();\n    }\n  }\n}
\n
\n
\n \n

You can also redirect elsewhere by calling\nthis.transitionTo('elsewhere') from within willTransition.\nNote that willTransition will not be fired for the\nredirecting transitionTo, since willTransition doesn't\nfire when there is already a transition underway. If you want\nsubsequent willTransition actions to fire for the redirecting\ntransition, you must first explicitly call\ntransition.abort().

\n

To allow the willTransition event to continue bubbling to the parent\nroute, use return true;. When the willTransition method has a\nreturn value of true then the parent route's willTransition method\nwill be fired, enabling "bubbling" behavior for the event.

\n", + "itemtype": "event", + "name": "willTransition", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 613, + "description": "

The didTransition action is fired after a transition has\nsuccessfully been completed. This occurs after the normal model\nhooks (beforeModel, model, afterModel, setupController)\nhave resolved. The didTransition action has no arguments,\nhowever, it can be useful for tracking page views or resetting\nstate on the controller.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/login.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class LoginRoute extends Route {\n  @action\n  didTransition() {\n    this.controller.get('errors.base').clear();\n    return true; // Bubble the didTransition event\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "didTransition", + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 639, + "description": "

The loading action is fired on the route when a route's model\nhook returns a promise that is not already resolved. The current\nTransition object is the first parameter and the route that\ntriggered the loading event is the second parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  loading(transition, route) {\n    let controller = this.controllerFor('foo');\n\n    // The controller may not be instantiated when initially loading\n    if (controller) {\n      controller.currentlyLoading = true;\n\n      transition.finally(function() {\n        controller.currentlyLoading = false;\n      });\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "loading", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + }, + { + "name": "route", + "description": "The route that triggered the loading event", + "type": "Route" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 673, + "description": "

When attempting to transition into a route, any of the hooks\nmay return a promise that rejects, at which point an error\naction will be fired on the partially-entered routes, allowing\nfor per-route error handling logic, or shared error handling\nlogic defined on a parent route.

\n

Here is an example of an error handler that will be invoked\nfor rejected promises from the various hooks on the route,\nas well as any unhandled errors from child routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/admin.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { reject } from 'rsvp';\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class AdminRoute extends Route {\n  beforeModel() {\n    return reject('bad things!');\n  }\n\n  @action\n  error(error, transition) {\n    // Assuming we got here due to the error in `beforeModel`,\n    // we can expect that error === "bad things!",\n    // but a promise model rejecting would also\n    // call this hook, as would any errors encountered\n    // in `afterModel`.\n\n    // The `error` hook is also provided the failed\n    // `transition`, which can be stored and later\n    // `.retry()`d if desired.\n\n    this.transitionTo('login');\n  }\n}
\n
\n
\n \n

error actions that bubble up all the way to ApplicationRoute\nwill fire a default error handler that logs the error. You can\nspecify your own global default error handler by overriding the\nerror handler on ApplicationRoute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  error(error, transition) {\n    this.controllerFor('banner').displayError(error.message);\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "error", + "params": [ + { + "name": "error", + "description": "", + "type": "Error" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 734, + "description": "

This event is triggered when the router enters the route. It is\nnot executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  collectAnalytics: on('activate', function(){\n    collectAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "activate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 754, + "description": "

This event is triggered when the router completely exits this\nroute. It is not executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  trackPageLeaveAnalytics: on('deactivate', function(){\n    trackPageLeaveAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "deactivate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 146, + "description": "

Configuration hash for this route's queryParams. The possible\nconfiguration options and their defaults are as follows\n(assuming a query param whose controller property is page):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
queryParams: {\n  page: {\n    // By default, controller query param properties don't\n    // cause a full transition when they are changed, but\n    // rather only cause the URL to update. Setting\n    // `refreshModel` to true will cause an "in-place"\n    // transition to occur, whereby the model hooks for\n    // this route (and any child routes) will re-fire, allowing\n    // you to reload models (e.g., from the server) using the\n    // updated query param values.\n    refreshModel: false,\n\n    // By default, changes to controller query param properties\n    // cause the URL to update via `pushState`, which means an\n    // item will be added to the browser's history, allowing\n    // you to use the back button to restore the app to the\n    // previous state before the query param property was changed.\n    // Setting `replace` to true will use `replaceState` (or its\n    // hash location equivalent), which causes no browser history\n    // item to be added. This options name and default value are\n    // the same as the `link-to` helper's `replace` option.\n    replace: false,\n\n    // By default, the query param URL key is the same name as\n    // the controller property name. Use `as` to specify a\n    // different URL key.\n    as: 'page'\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 192, + "description": "

The name of the template to use by default when rendering this routes\ntemplate.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/list.js
1\n2\n3\n4\n5\n
import Route from '@ember/routing/route';\n\nexport default class extends Route {\n  templateName = 'posts/list'\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n
import PostsList from '../posts/list';\n\nexport default class extends PostsList {};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/archived.js
1\n2\n3\n
import PostsList from '../posts/list';\n\nexport default class extends PostsList {};
\n
\n
\n \n", + "itemtype": "property", + "name": "templateName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 225, + "description": "

The name of the controller to associate with this route.

\n

By default, Ember will lookup a route's controller that matches the name\nof the route (i.e. posts.new). However,\nif you would like to define a specific controller to use, you can do so\nusing this property.

\n

This is useful in many ways, as the controller specified will be:

\n
    \n
  • passed to the setupController method.
  • \n
  • used as the controller for the template being rendered by the route.
  • \n
  • returned from a call to controllerFor for the route.
  • \n
\n", + "itemtype": "property", + "name": "controllerName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 248, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 279, + "description": "

The name of the route, dot-delimited.

\n

For example, a route found at app/routes/posts/post.js will have\na routeName of posts.post.

\n", + "itemtype": "property", + "name": "routeName", + "type": "String", + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 293, + "description": "

The name of the route, dot-delimited, including the engine prefix\nif applicable.

\n

For example, a route found at addon/routes/posts/post.js within an\nengine named admin will have a fullRouteName of admin.posts.post.

\n", + "itemtype": "property", + "name": "fullRouteName", + "type": "String", + "since": "2.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 352, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_activeQPChanged", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 491, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_optionsForQueryParam", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1720, + "description": "

Store property provides a hook for data persistence libraries to inject themselves.

\n

By default, this store property provides the exact same functionality previously\nin the model hook.

\n

Currently, the required interface is:

\n

store.find(modelName, findArguments)

\n", + "itemtype": "property", + "name": "store", + "type": "{Object}", + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1785, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_qp", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2312, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-RouteInfo-492eaca499.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-RouteInfo-492eaca499.json new file mode 100644 index 000000000..851078030 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-RouteInfo-492eaca499.json @@ -0,0 +1,171 @@ +{ + "data": { + "id": "ember-4.2.0-RouteInfo", + "type": "class", + "attributes": { + "name": "RouteInfo", + "shortname": "RouteInfo", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 118, + "description": "

A RouteInfo is an object that contains metadata\nabout a specific route within a Transition. It is\nread-only and internally immutable. It is also not\nobservable, because a Transition instance is never\nchanged after creation.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 192, + "description": "

Allows you to traverse through the linked list\nof RouteInfos from the topmost to leafmost.\nReturns the first RouteInfo in the linked list\nfor which the callback returns true.

\n

This method is similar to the find() method\n defined in ECMAScript 2015.

\n

The callback method you provide should have the\n following signature (all parameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in\n the results, false otherwise.

\n

Note that in addition to a callback, you can also\n pass an optional target object that will be set as\n this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 129, + "description": "

The dot-separated, fully-qualified name of the\nroute, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 136, + "description": "

The final segment of the fully-qualified name of\nthe route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 143, + "description": "

The values of the route's parameters. These are the\nsame params that are received as arguments to the\nroute's model hook. Contains only the parameters\nvalid for this route, if any (params for parent or\nchild routes are not merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 153, + "description": "

The ordered list of the names of the params\nrequired for this route. It will contain the same\nstrings as Object.keys(params), but here the order\nis significant. This allows users to correctly pass\nparams into routes programmatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 163, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 169, + "description": "

Will contain the result Route#buildRouteInfoMetadata\nfor the corresponding Route.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 176, + "description": "

A reference to the parent route's RouteInfo.\nThis can be used to traverse upward to the topmost\nRouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 184, + "description": "

A reference to the child route's RouteInfo.\nThis can be used to traverse downward to the\nleafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-RouteInfoWithAttributes-1949059641.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-RouteInfoWithAttributes-1949059641.json new file mode 100644 index 000000000..2e74935ba --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-RouteInfoWithAttributes-1949059641.json @@ -0,0 +1,183 @@ +{ + "data": { + "id": "ember-4.2.0-RouteInfoWithAttributes", + "type": "class", + "attributes": { + "name": "RouteInfoWithAttributes", + "shortname": "RouteInfoWithAttributes", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 1, + "description": "

A RouteInfoWithAttributes is an object that contains\nmetadata, including the resolved value from the routes\nmodel hook. Like RouteInfo, a RouteInfoWithAttributes\nrepresents a specific route within a Transition.\nIt is read-only and internally immutable. It is also not\nobservable, because a Transition instance is never\nchanged after creation.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 84, + "description": "

Allows you to traverse through the linked list\nof RouteInfos from the topmost to leafmost.\nReturns the first RouteInfo in the linked list\nfor which the callback returns true.

\n

This method is similar to the find() method\n defined in ECMAScript 2015.

\n

The callback method you provide should have the\n following signature (all parameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in\n the results, false otherwise.

\n

Note that in addition to a callback, you can also\n pass an optional target object that will be set as\n this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 14, + "description": "

The dot-separated, fully-qualified name of the\nroute, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 21, + "description": "

The final segment of the fully-qualified name of\nthe route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 28, + "description": "

The values of the route's parameters. These are the\nsame params that are received as arguments to the\nroute's model hook. Contains only the parameters\nvalid for this route, if any (params for parent or\nchild routes are not merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 38, + "description": "

The ordered list of the names of the params\nrequired for this route. It will contain the same\nstrings as Object.keys(params), but here the order\nis significant. This allows users to correctly pass\nparams into routes programmatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 48, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 54, + "description": "

This is the resolved return value from the\nroute's model hook.

\n", + "itemtype": "property", + "name": "attributes", + "type": "Object|Array|String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 61, + "description": "

Will contain the result Route#buildRouteInfoMetadata\nfor the corresponding Route.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 68, + "description": "

A reference to the parent route's RouteInfo.\nThis can be used to traverse upward to the topmost\nRouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 76, + "description": "

A reference to the child route's RouteInfo.\nThis can be used to traverse downward to the\nleafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-RouterService-8a10bc3ade.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-RouterService-8a10bc3ade.json new file mode 100644 index 000000000..e28ac35a9 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-RouterService-8a10bc3ade.json @@ -0,0 +1,831 @@ +{ + "data": { + "id": "ember-4.2.0-RouterService", + "type": "class", + "attributes": { + "name": "RouterService", + "shortname": "RouterService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 23, + "description": "

The Router service is the public API that provides access to the router.

\n

The immediate benefit of the Router service is that you can inject it into components,\ngiving them a friendly way to initiate transitions and ask questions about the current\nglobal router state.

\n

In this example, the Router service is injected into a component to initiate a transition\nto a dedicated route:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class ExampleComponent extends Component {\n  @service router;\n\n  @action\n  next() {\n    this.router.transitionTo('other.route');\n  }\n}
\n
\n
\n \n

Like any service, it can also be injected into helpers, routes, etc.

\n", + "access": "public", + "tagname": "", + "extends": "Service", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 71, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n

See transitionTo for more info.

\n

Calling transitionTo from the Router service will cause default query parameter values to be included in the URL.\nThis behavior is different from calling transitionTo on a route or transitionToRoute on a controller.\nSee the Router Service RFC for more info.

\n

In the following example we use the Router service to navigate to a route with a\nspecific model from a Component in the first action, and in the second we trigger\na query-params only transition.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n  @service router;\n\n  @action\n  goToComments(post) {\n    this.router.transitionTo('comments', post);\n  }\n\n  @action\n  fetchMoreComments(latestComment) {\n    this.router.transitionTo({\n      queryParams: { commentsAfter: latestComment }\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 133, + "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

See replaceWith for more info.

\n

Calling 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 for more info.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class extends Route {\n  beforeModel() {\n    if (!authorized()){\n      this.replaceWith('unauthorized');\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL of the desired destination", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route i.e. an object of params to pass to the destination route", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 174, + "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

In this example, the URL for the author.books route for a given author\nis copied to the clipboard.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

Just like with transitionTo and replaceWith, urlFor can also handle\nquery parameters.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "urlFor", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the string representing the generated URL", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 248, + "description": "

Returns true if routeName/models/queryParams is the active route, where models and queryParams are optional.\nSee model and\nqueryParams for more information about these arguments.

\n

In the following example, isActive will return true if the current route is /posts.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

Where 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.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used when determining the active route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "true if the provided routeName/models/queryParams are active", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 345, + "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

See RouteInfo for more info.

\n

In the following example recognize is used to verify if a path belongs to our\napplication before transitioning to it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "recognize", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 385, + "description": "

Takes a string URL and returns a promise that resolves to a\nRouteInfoWithAttributes 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.

\n", + "itemtype": "method", + "name": "recognizeAndLoad", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 487, + "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.

\n", + "itemtype": "method", + "name": "refresh", + "params": [ + { + "name": "routeName", + "description": "the route to refresh (along with all child routes)", + "type": "String", + "optional": true + } + ], + "return": { + "description": "Transition" + }, + "category": [ + "EMBER_ROUTING_ROUTER_SERVICE_REFRESH" + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 406, + "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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Route from '@ember/routing';\nimport { service } from '@ember/service';\n\nexport default class extends Route {\n  @service router;\n\n  constructor() {\n    super(...arguments);\n\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
\n \n

The 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.

\n", + "itemtype": "event", + "name": "routeWillChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 442, + "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

A good example is sending some analytics when the route has transitioned:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Route from '@ember/routing';\nimport { service } from '@ember/service';\n\nexport default class extends Route {\n  @service router;\n\n  constructor() {\n    super(...arguments);\n\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 \n

routeDidChange will be called after any Route's\ndidTransition\naction has been fired.\nThe updates of properties\ncurrentURL,\ncurrentRouteName\nand\ncurrentRoute\nare completed at the time routeDidChange is called.

\n", + "itemtype": "event", + "name": "routeDidChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 520, + "description": "

Name of the current route.

\n

This property represents the logical name of the route,\nwhich is comma separated.\nFor the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentRouteName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 549, + "description": "

Current URL for the application.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
This property represents the URL path for this route.\nFor the following router:
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentURL", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 577, + "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

See Location for more information.

\n

To 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\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
\n \n

The following location types are available by default:\nauto, hash, history, none.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 616, + "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

If you change the rootURL in your environment configuration\nlike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\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
\n \n

This property will return /my-root.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 645, + "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

See RouteInfo for more info.

\n

This 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

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/header.js
1\n2\n3\n4\n5\n6\n7\n8\n9\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
\n
\n \n", + "itemtype": "property", + "name": "currentRoute", + "type": "RouteInfo", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-Service", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-Service-cef3ce7280.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-Service-cef3ce7280.json new file mode 100644 index 000000000..6b70cfc24 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-Service-cef3ce7280.json @@ -0,0 +1,541 @@ +{ + "data": { + "id": "ember-4.2.0-Service", + "type": "class", + "attributes": { + "name": "Service", + "shortname": "Service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "file": "packages/@ember/service/index.js", + "line": 74, + "extends": "EmberObject", + "since": "1.10.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.2.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.2.0-RouterService" + } + ] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-String-80edcb4d22.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-String-80edcb4d22.json new file mode 100644 index 000000000..e424518d0 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-String-80edcb4d22.json @@ -0,0 +1,200 @@ +{ + "data": { + "id": "ember-4.2.0-String", + "type": "class", + "attributes": { + "name": "String", + "shortname": "String", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/string", + "namespace": "", + "file": "packages/@ember/string/index.ts", + "line": 73, + "description": "

Defines string helper methods including string formatting and localization.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/string/index.ts", + "line": 80, + "description": "

Splits a string into separate units separated by spaces, eliminating any\nempty strings in the process.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { w } from '@ember/string';\n\nw("alpha beta gamma").forEach(function(key) {\n  console.log(key);\n});\n\n// > alpha\n// > beta\n// > gamma
\n
\n
\n \n", + "itemtype": "method", + "name": "w", + "params": [ + { + "name": "str", + "description": "The string to split", + "type": "String" + } + ], + "return": { + "description": "array containing the split strings", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 105, + "description": "

Converts a camelized string into all lower case separated by underscores.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { decamelize } from '@ember/string';\n\ndecamelize('innerHTML');          // 'inner_html'\ndecamelize('action_name');        // 'action_name'\ndecamelize('css-class-name');     // 'css-class-name'\ndecamelize('my favorite items');  // 'my favorite items'
\n
\n
\n \n", + "itemtype": "method", + "name": "decamelize", + "params": [ + { + "name": "str", + "description": "The string to decamelize.", + "type": "String" + } + ], + "return": { + "description": "the decamelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 126, + "description": "

Replaces underscores, spaces, or camelCase with dashes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { dasherize } from '@ember/string';\n\ndasherize('innerHTML');                // 'inner-html'\ndasherize('action_name');              // 'action-name'\ndasherize('css-class-name');           // 'css-class-name'\ndasherize('my favorite items');        // 'my-favorite-items'\ndasherize('privateDocs/ownerInvoice';  // 'private-docs/owner-invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "dasherize", + "params": [ + { + "name": "str", + "description": "The string to dasherize.", + "type": "String" + } + ], + "return": { + "description": "the dasherized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 148, + "description": "

Returns the lowerCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { camelize } from '@ember/string';\n\ncamelize('innerHTML');                   // 'innerHTML'\ncamelize('action_name');                 // 'actionName'\ncamelize('css-class-name');              // 'cssClassName'\ncamelize('my favorite items');           // 'myFavoriteItems'\ncamelize('My Favorite Items');           // 'myFavoriteItems'\ncamelize('private-docs/owner-invoice');  // 'privateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "camelize", + "params": [ + { + "name": "str", + "description": "The string to camelize.", + "type": "String" + } + ], + "return": { + "description": "the camelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 171, + "description": "

Returns the UpperCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { classify } from '@ember/string';\n\nclassify('innerHTML');                   // 'InnerHTML'\nclassify('action_name');                 // 'ActionName'\nclassify('css-class-name');              // 'CssClassName'\nclassify('my favorite items');           // 'MyFavoriteItems'\nclassify('private-docs/owner-invoice');  // 'PrivateDocs/OwnerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "classify", + "params": [ + { + "name": "str", + "description": "the string to classify", + "type": "String" + } + ], + "return": { + "description": "the classified string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 193, + "description": "

More general than decamelize. Returns the lower_case_and_underscored\nform of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { underscore } from '@ember/string';\n\nunderscore('innerHTML');                 // 'inner_html'\nunderscore('action_name');               // 'action_name'\nunderscore('css-class-name');            // 'css_class_name'\nunderscore('my favorite items');         // 'my_favorite_items'\nunderscore('privateDocs/ownerInvoice');  // 'private_docs/owner_invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "underscore", + "params": [ + { + "name": "str", + "description": "The string to underscore.", + "type": "String" + } + ], + "return": { + "description": "the underscored string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 216, + "description": "

Returns the Capitalized form of a string

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capitalize } from '@ember/string';\n\ncapitalize('innerHTML')                 // 'InnerHTML'\ncapitalize('action_name')               // 'Action_name'\ncapitalize('css-class-name')            // 'Css-class-name'\ncapitalize('my favorite items')         // 'My favorite items'\ncapitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "capitalize", + "params": [ + { + "name": "str", + "description": "The string to capitalize.", + "type": "String" + } + ], + "return": { + "description": "The capitalized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/string", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/classes/ember-4.2.0-rsvp-7e1e86af62.json b/json-docs/ember/4.2.0/classes/ember-4.2.0-rsvp-7e1e86af62.json new file mode 100644 index 000000000..c9e75c891 --- /dev/null +++ b/json-docs/ember/4.2.0/classes/ember-4.2.0-rsvp-7e1e86af62.json @@ -0,0 +1,445 @@ +{ + "data": { + "id": "ember-4.2.0-rsvp", + "type": "class", + "attributes": { + "name": "rsvp", + "shortname": "rsvp", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/all-settled.js", + "line": 20, + "description": "

RSVP.allSettled is similar to RSVP.all, but instead of implementing\na fail-fast method, it waits until all the promises have returned and\nshows you all the results. This is useful if you want to handle multiple\npromises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled. The return promise is fulfilled with an array of the states of\nthe promises passed into the promises array argument.

\n

Each state object will either indicate fulfillment or rejection, and\nprovide the corresponding value or reason. The states will take one of\nthe following formats:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{ state: 'fulfilled', value: value }\n  or\n{ state: 'rejected', reason: reason }
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
let promise1 = RSVP.Promise.resolve(1);\nlet promise2 = RSVP.Promise.reject(new Error('2'));\nlet promise3 = RSVP.Promise.reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nRSVP.allSettled(promises).then(function(array){\n  // array == [\n  //   { state: 'fulfilled', value: 1 },\n  //   { state: 'rejected', reason: Error },\n  //   { state: 'rejected', reason: Error }\n  // ]\n  // Note that for the second item, reason.message will be '2', and for the\n  // third item, reason.message will be '3'.\n}, function(error) {\n  // Not run. (This block would only be called if allSettled had failed,\n  // for instance if passed an incorrect argument type.)\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "allSettled", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "entries", + "description": "", + "type": "Array" + }, + { + "name": "label", + "description": "- optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with an array of the settled\nstates of the constituent promises.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/all.js", + "line": 3, + "description": "

This is a convenient alias for Promise.all.

\n", + "itemtype": "method", + "name": "all", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/defer.js", + "line": 3, + "description": "

defer returns an object similar to jQuery's $.Deferred.\ndefer should be used when porting over code reliant on $.Deferred's\ninterface. New code should use the Promise constructor instead.

\n

The object returned from defer is a plain object with three properties:

\n
    \n
  • promise - an Promise.
  • \n
  • reject - a function that causes the promise property on this object to\nbecome rejected
  • \n
  • resolve - a function that causes the promise property on this object to\nbecome fulfilled.
  • \n
\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let deferred = defer();\n\ndeferred.resolve("Success!");\n\ndeferred.promise.then(function(value){\n  // value here is "Success!"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "defer", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 19, + "description": "

EventTarget.mixin extends an object with EventTarget methods. For\nExample:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import EventTarget from 'rsvp';\n\nlet object = {};\n\nEventTarget.mixin(object);\n\nobject.on('finished', function(event) {\n  // handle event\n});\n\nobject.trigger('finished', { detail: value });
\n
\n
\n \n

EventTarget.mixin also works with prototypes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EventTarget from 'rsvp';\n\nlet Person = function() {};\nEventTarget.mixin(Person.prototype);\n\nlet yehuda = new Person();\nlet tom = new Person();\n\nyehuda.on('poke', function(event) {\n  console.log('Yehuda says OW');\n});\n\ntom.on('poke', function(event) {\n  console.log('Tom says OW');\n});\n\nyehuda.trigger('poke');\ntom.trigger('poke');
\n
\n
\n \n", + "itemtype": "method", + "name": "mixin", + "access": "private", + "tagname": "", + "params": [ + { + "name": "object", + "description": "object to extend with EventTarget methods", + "type": "Object" + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 107, + "description": "

You can use off to stop firing a particular callback for an event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function doStuff() { // do stuff! }\nobject.on('stuff', doStuff);\n\nobject.trigger('stuff'); // doStuff will be called\n\n// Unregister ONLY the doStuff callback\nobject.off('stuff', doStuff);\nobject.trigger('stuff'); // doStuff will NOT be called
\n
\n
\n \n

If you don't pass a callback argument to off, ALL callbacks for the\nevent will not be executed when the event fires. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let callback1 = function(){};\nlet callback2 = function(){};\n\nobject.on('stuff', callback1);\nobject.on('stuff', callback2);\n\nobject.trigger('stuff'); // callback1 and callback2 will be executed.\n\nobject.off('stuff');\nobject.trigger('stuff'); // callback1 and callback2 will not be executed!
\n
\n
\n \n", + "itemtype": "method", + "name": "off", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "event to stop listening to", + "type": "String" + }, + { + "name": "callback", + "description": "optional argument. If given, only the function\ngiven will be removed from the event's callback queue. If no `callback`\nargument is given, all callbacks will be removed from the event's callback\nqueue.", + "type": "Function", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 162, + "description": "

Use trigger to fire custom events. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
object.on('foo', function(){\n  console.log('foo event happened!');\n});\nobject.trigger('foo');\n// 'foo event happened!' logged to the console
\n
\n
\n \n

You can also pass a value as a second argument to trigger that will be\npassed as an argument to all event listeners for the event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
object.on('foo', function(value){\n  console.log(value.name);\n});\n\nobject.trigger('foo', { name: 'bar' });\n// 'bar' logged to the console
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "name of the event to be triggered", + "type": "String" + }, + { + "name": "options", + "description": "optional value to be passed to any event handlers for\nthe given `eventName`", + "type": "*", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/filter.js", + "line": 42, + "description": "

filter is similar to JavaScript's native filter method.\nfilterFn is eagerly called meaning that as soon as any promise\n resolves its value will be passed to filterFn. filter returns\n a promise that will become fulfilled with the result of running\n filterFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { filter, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\n\nlet promises = [promise1, promise2, promise3];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(result){\n  // result is [ 2, 3 ]\n});
\n
\n
\n \n

If any of the promises given to filter are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { filter, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

filter will also wait for any promises returned from filterFn.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter, resolve } from 'rsvp';\n\nlet alice = { name: 'alice' };\nlet bob   = { name: 'bob' };\nlet users = [ alice, bob ];\n\nlet promises = users.map(function(user){\n  return resolve(user);\n});\n\nlet filterFn = function(user){\n  // Here, Alice has permissions to create a blog post, but Bob does not.\n  return getPrivilegesForUser(user).then(function(privs){\n    return privs.can_create_blog_post === true;\n  });\n};\nfilter(promises, filterFn).then(function(users){\n  // true, because the server told us only Alice can create a blog post.\n  users.length === 1;\n  // false, because Alice is the only user present in `users`\n  users[0] === bob;\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "filterFn", + "description": "- function to be called on each resolved value to\n filter the final results.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string describing the promise. Useful for\n tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash-settled.js", + "line": 16, + "description": "

hashSettled is similar to allSettled, but takes an object\ninstead of an array for its promises argument.

\n

Unlike all or hash, which implement a fail-fast method,\nbut like allSettled, hashSettled waits until all the\nconstituent promises have returned and then shows you all the results\nwith their states and values/reasons. This is useful if you want to\nhandle multiple promises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled, or rejected if the passed parameters are invalid.

\n

The returned promise is fulfilled with a hash that has the same key names as\nthe promises object argument. If any of the values in the object are not\npromises, they will be copied over to the fulfilled object and marked with state\n'fulfilled'.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: { state: 'fulfilled', value: 1 },\n  //   yourPromise: { state: 'fulfilled', value: 2 },\n  //   theirPromise: { state: 'fulfilled', value: 3 },\n  //   notAPromise: { state: 'fulfilled', value: 4 }\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the state will\nbe set to 'rejected' and the reason for rejection provided.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, reject, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejection')),\n  anotherRejectedPromise: reject(new Error('more rejection')),\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise:              { state: 'fulfilled', value: 1 },\n  //   rejectedPromise:        { state: 'rejected', reason: Error },\n  //   anotherRejectedPromise: { state: 'rejected', reason: Error },\n  // }\n  // Note that for rejectedPromise, reason.message == 'rejection',\n  // and for anotherRejectedPromise, reason.message == 'more rejection'.\n});
\n
\n
\n \n

An important note: hashSettled is intended for plain JavaScript objects that\nare just a set of keys and values. hashSettled will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import Promise, { hashSettled, resolve } from 'rsvp';\n\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: Promise.resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhashSettled(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: { state: 'fulfilled', value: 'Example' }\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hashSettled", + "access": "public", + "tagname": "", + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when when all properties of `promises`\nhave been settled.", + "type": "Promise" + }, + "static": 1, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash.js", + "line": 4, + "description": "

hash is similar to all, but takes an object instead of an array\nfor its promises argument.

\n

Returns a promise that is fulfilled when all the given promises have been\nfulfilled, or rejected if any of them become rejected. The returned promise\nis fulfilled with a hash that has the same key names as the promises object\nargument. If any of the values in the object are not promises, they will\nsimply be copied over to the fulfilled object.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhash(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: 1,\n  //   yourPromise: 2,\n  //   theirPromise: 3,\n  //   notAPromise: 4\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the first promise\nthat is rejected will be given as the reason to the rejection handler.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejectedPromise')),\n  anotherRejectedPromise: reject(new Error('anotherRejectedPromise')),\n};\n\nhash(promises).then(function(hash){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === 'rejectedPromise'\n});
\n
\n
\n \n

An important note: hash is intended for plain JavaScript objects that\nare just a set of keys and values. hash will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { hash, resolve } from 'rsvp';\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhash(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: 'Example'\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all properties of `promises`\nhave been fulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/map.js", + "line": 39, + "description": "

map is similar to JavaScript's native map method. mapFn is eagerly called\n meaning that as soon as any promise resolves its value will be passed to mapFn.\n map returns a promise that will become fulfilled with the result of running\n mapFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(result){\n  // result is [ 2, 3, 4 ]\n});
\n
\n
\n \n

If any of the promises given to map are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { map, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

map will also wait if a promise is returned from mapFn. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first because they contain a url to those comments.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map } from 'rsvp';\n\nlet mapFn = function(blogPost){\n  // getComments does some ajax and returns an Promise that is fulfilled\n  // with some comments data\n  return getComments(blogPost.comments_url);\n};\n\n// getBlogPosts does some ajax and returns an Promise that is fulfilled\n// with some blog post data\nmap(getBlogPosts(), mapFn).then(function(comments){\n  // comments is the result of asking the server for the comments\n  // of all blog posts returned from getBlogPosts()\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "mapFn", + "description": "function to be called on each fulfilled promise.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\n Useful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/node.js", + "line": 44, + "description": "

denodeify takes a 'node-style' function and returns a function that\nwill return an Promise. You can use denodeify in Node.js or the\nbrowser when you'd prefer to use promises over using callbacks. For example,\ndenodeify transforms the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) return handleError(err);\n  handleData(data);\n});
\n
\n
\n \n

into:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\n\nreadFile('myfile.txt').then(handleData, handleError);
\n
\n
\n \n

If the node function has multiple success parameters, then denodeify\njust returns the first one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let request = denodeify(require('request'));\n\nrequest('http://example.com').then(function(res) {\n  // ...\n});
\n
\n
\n \n

However, if you need all success parameters, setting denodeify's\nsecond parameter to true causes it to return all success parameters\nas an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), true);\n\nrequest('http://example.com').then(function(result) {\n  // result[0] -> res\n  // result[1] -> body\n});
\n
\n
\n \n

Or if you pass it an array with names it returns the parameters as a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), ['res', 'body']);\n\nrequest('http://example.com').then(function(result) {\n  // result.res\n  // result.body\n});
\n
\n
\n \n

Sometimes you need to retain the this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let app = require('express')();\nlet render = denodeify(app.render.bind(app));
\n
\n
\n \n

The denodified function inherits from the original function. It works in all\nenvironments, except IE 10 and below. Consequently all properties of the original\nfunction are available to you. However, any properties you change on the\ndenodeified function won't be changed on the original function. Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request')),\n    cookieJar = request.jar(); // <- Inheritance is used here\n\nrequest('http://example.com', {jar: cookieJar}).then(function(res) {\n  // cookieJar.cookies holds now the cookies returned by example.com\n});
\n
\n
\n \n

Using denodeify makes it easier to compose asynchronous operations instead\nof using callbacks. For example, instead of:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) { ... } // Handle error\n  fs.writeFile('myfile2.txt', data, function(err){\n    if (err) { ... } // Handle error\n    console.log('done')\n  });\n});
\n
\n
\n \n

you can chain the operations together using then from the returned promise:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\nlet writeFile = denodeify(fs.writeFile);\n\nreadFile('myfile.txt').then(function(data){\n  return writeFile('myfile2.txt', data);\n}).then(function(){\n  console.log('done')\n}).catch(function(error){\n  // Handle error\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "denodeify", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "nodeFunc", + "description": "a 'node-style' function that takes a callback as\nits last argument. The callback expects an error to be passed as its first\nargument (if an error occurred, otherwise null), and the value from the\noperation as its second argument ('function(err, value){ }').", + "type": "Function" + }, + { + "name": "options", + "description": "An optional paramter that if set\nto `true` causes the promise to fulfill with the callback's success arguments\nas an array. This is useful if the node function has multiple success\nparamters. If you set this paramter to an array with names, the promise will\nfulfill with a hash with these names as keys and the success parameters as\nvalues.", + "type": "Boolean|Array", + "optional": true + } + ], + "return": { + "description": "a function that wraps `nodeFunc` to return a `Promise`", + "type": "Function" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/race.js", + "line": 3, + "description": "

This is a convenient alias for Promise.race.

\n", + "itemtype": "method", + "name": "race", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/reject.js", + "line": 3, + "description": "

This is a convenient alias for Promise.reject.

\n", + "itemtype": "method", + "name": "reject", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/resolve.js", + "line": 3, + "description": "

This is a convenient alias for Promise.resolve.

\n", + "itemtype": "method", + "name": "resolve", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "value", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/rethrow.js", + "line": 1, + "description": "

rethrow will rethrow an error on the next turn of the JavaScript event\nloop in order to aid debugging.

\n

Promises A+ specifies that any exceptions that occur with a promise must be\ncaught by the promises implementation and bubbled to the last handler. For\nthis reason, it is recommended that you always specify a second rejection\nhandler function to then. However, rethrow will throw the exception\noutside of the promise, so it bubbles up to your console if in the browser,\nor domain/cause uncaught exception in Node. rethrow will also throw the\nerror again so the error can be handled by the promise per the spec.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { rethrow } from 'rsvp';\n\nfunction throws(){\n  throw new Error('Whoops!');\n}\n\nlet promise = new Promise(function(resolve, reject){\n  throws();\n});\n\npromise.catch(rethrow).then(function(){\n  // Code here doesn't run because the promise became rejected due to an\n  // error!\n}, function (err){\n  // handle the error here\n});
\n
\n
\n \n

The 'Whoops' error will be thrown on the next turn of the event loop\nand you can watch for it in your console. You can also handle it using a\nrejection handler given to .then or .catch on the returned promise.

\n", + "itemtype": "method", + "name": "rethrow", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "reason the promise became rejected.", + "type": "Error" + } + ], + "throws": { + "description": "Error" + }, + "class": "rsvp", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/modules/ember-4.2.0-@ember/component-2d67285cc1.json b/json-docs/ember/4.2.0/modules/ember-4.2.0-@ember/component-2d67285cc1.json new file mode 100644 index 000000000..9e4008696 --- /dev/null +++ b/json-docs/ember/4.2.0/modules/ember-4.2.0-@ember/component-2d67285cc1.json @@ -0,0 +1,89 @@ +{ + "data": { + "id": "ember-4.2.0-@ember/component", + "type": "module", + "attributes": { + "name": "@ember/component", + "submodules": {}, + "elements": {}, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/component": 1, + "Ember.Templates.components": 1, + "@ember/component/helper": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 34, + "description": "

Glimmer is a templating engine used by Ember.js that is compatible with a subset of the Handlebars syntax.

\n

Showing a property

\n

Templates manage the flow of an application's UI, and display state (through\nthe DOM) to a user. For example, given a component with the property "name",\nthat component's template can use the name in several ways:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  name: 'Jill'\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
{{this.name}}\n<div>{{this.name}}</div>\n<span data-name={{this.name}}></span>
\n
\n
\n \n

Any time the "name" property on the component changes, the DOM will be\nupdated.

\n

Properties can be chained as well:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{@aUserModel.name}}\n<div>{{@listOfUsers.firstObject.name}}</div>
\n
\n
\n \n

Using Ember helpers

\n

When content is passed in mustaches {{}}, Ember will first try to find a helper\nor component with that name. For example, the if helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
{{if this.name "I have a name" "I have no name"}}\n<span data-has-name={{if this.name true}}></span>
\n
\n
\n \n

The returned value is placed where the {{}} is called. The above style is\ncalled "inline". A second style of helper usage is called "block". For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#if this.name}}\n  I have a name\n{{else}}\n  I have no name\n{{/if}}
\n
\n
\n \n

The block form of helpers allows you to control how the UI is created based\non the values of properties.\nA third form of helper is called "nested". For example here the concat\nhelper will add " Doe" to a displayed name if the person has no last name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<span data-name={{concat this.firstName (\n  if this.lastName (concat " " this.lastName) "Doe"\n)}}></span>
\n
\n
\n \n

Ember's built-in helpers are described under the Ember.Templates.helpers\nnamespace. Documentation on creating custom helpers can be found under\nhelper (or\nunder Helper if a helper requires access to\ndependency injection).

\n

Invoking a Component

\n

Ember components represent state to the UI of an application. Further\nreading on components can be found under Component.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "Component", + "Helper" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 231, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "allstaticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 231, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "version": "4.2.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/modules/ember-4.2.0-@glimmer/component-1ac56683f0.json b/json-docs/ember/4.2.0/modules/ember-4.2.0-@glimmer/component-1ac56683f0.json new file mode 100644 index 000000000..0d210d58f --- /dev/null +++ b/json-docs/ember/4.2.0/modules/ember-4.2.0-@glimmer/component-1ac56683f0.json @@ -0,0 +1,36 @@ +{ + "data": { + "id": "ember-4.2.0-@glimmer/component", + "type": "module", + "attributes": { + "name": "@glimmer/component", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts", + "line": 1, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault component's for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Template-only and Glimmer components. If you\nare looking for the API documentation for Classic components, it is\navailable here. The source code for\nGlimmer components can be found in @glimmer/component.

\n

Defining a Template-only Component

\n

The simplest way to create a component is to create a template file in\napp/templates/components. For example, if you name a template\napp/templates/components/person-profile.hbs:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
<h1>{{@person.name}}</h1>\n<img src={{@person.avatar}}>\n<p class='signature'>{{@person.signature}}</p>
\n
\n
\n \n

You will be able to use <PersonProfile /> to invoke this component elsewhere\nin your application:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<PersonProfile @person={{this.currentUser}} />
\n
\n
\n \n

Note that component names are capitalized here in order to distinguish them\nfrom regular HTML elements, but they are dasherized in the file system.

\n

While the angle bracket invocation form is generally preferred, it is also\npossible to invoke the same component with the {{person-profile}} syntax:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person-profile person=this.currentUser}}
\n
\n
\n \n

Note that with this syntax, you use dashes in the component name and\narguments are passed without the @ sign.

\n

In both cases, Ember will render the content of the component template we\ncreated above. The end result will be something like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\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 \n

File System Nesting

\n

Components can be nested inside sub-folders for logical groupping. For\nexample, if we placed our template in\napp/templates/components/person/short-profile.hbs, we can invoke it as\n<Person::ShortProfile />:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Person::ShortProfile @person={{this.currentUser}} />
\n
\n
\n \n

Or equivalently, {{person/short-profile}}:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person/short-profile person=this.currentUser}}
\n
\n
\n \n

Using Blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield}}
\n
\n
\n \n

We could then invoke it like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}}>\n  <p>Admin mode</p>\n</PersonProfile>
\n
\n
\n \n

or with curly syntax like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-profile person=this.currentUser}}\n  <p>Admin mode</p>\n{{/person-profile}}
\n
\n
\n \n

And 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

Blocks are executed in their original context, meaning they have access to the\nscope and any in-scope variables where they were defined.

\n

Passing parameters to blocks

\n

You can also pass positional parameters to {{yield}}, which are then made\navailable in the block:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

We can then use this value in the block like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}} as |signature|>\n  {{signature}}\n</PersonProfile>
\n
\n
\n \n

Passing multiple blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield to="title"}}</h1>\n{{yield}}
\n
\n
\n \n

This component could then be invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title>{{this.currentUser.name}}</:title>\n  <:default>{{this.currentUser.signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

When 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

Passing parameters to named blocks

\n

You can also pass parameters to named blocks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield @person.name to="title"}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

These parameters can then be used like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title as |name|>{{name}}</:title>\n  <:default as |signature|>{{signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

Checking to see if a block exists

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\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
\n \n

With this template, we can then optionally pass in one block, both blocks, or\nnone at all:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\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 \n

Checking to see if a block has parameters

\n

We can also check if a block receives parameters using the (has-block-params)\nkeyword, and conditionally yield different values if so.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
{{#if (has-block-params)}}\n  {{yield @person.signature}}\n{{else}}\n  {{yield}}\n{{/if}}
\n
\n
\n \n

Customizing Components With JavaScript

\n

To 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\nPersonProfile component which we defined above, we would create\napp/comopnents/person-profile.js and export our class as the default, like\nso:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n \n

You 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\ndisplayName property of our PersonProfile component instance in the\ntemplate like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

constructor

\n

params: owner object and args object

\n

Constructs 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import 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
\n \n

Service injections and arguments are available in the constructor.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import 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 \n

willDestroy

\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import 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 \n

args

\n

The args property of Glimmer components is an object that contains the\narguments that are passed to the component. For instance, the\nfollowing component usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @fadeIn={{true}} />
\n
\n
\n \n

Would result in the following args object to be passed to the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ fadeIn: true }
\n
\n
\n \n

args can be accessed at any point in the component lifecycle, including\nconstructor and willDestroy. They are also automatically marked as tracked\nproperties, and they can be depended on as computed property dependencies:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import 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 \n

isDestroying

\n

A boolean flag to tell if the component is in the process of destroying. This is set to\ntrue before willDestroy is called.

\n

isDestroyed

\n

A boolean to tell if the component has been fully destroyed. This is set to true\nafter willDestroy is called.

\n", + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "4.2.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/namespaces/ember-4.2.0-AutoLocation-6fb57ce111.json b/json-docs/ember/4.2.0/namespaces/ember-4.2.0-AutoLocation-6fb57ce111.json new file mode 100644 index 000000000..f0f4db4aa --- /dev/null +++ b/json-docs/ember/4.2.0/namespaces/ember-4.2.0-AutoLocation-6fb57ce111.json @@ -0,0 +1,129 @@ +{ + "data": { + "id": "ember-4.2.0-AutoLocation", + "type": "namespace", + "attributes": { + "name": "AutoLocation", + "shortname": "AutoLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 21, + "description": "

AutoLocation will select the best location option based off browser\nsupport with the priority order: history, hash, none.

\n

Clean pushState paths accessed by hashchange-only browsers will be redirected\nto the hash-equivalent and vice versa so future transitions are consistent.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n

Browsers that support the history API will use HistoryLocation, those that\ndo not, but still support the hashchange event will use HashLocation, and\nin the rare case neither is supported will use NoneLocation.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'auto'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new for modern browsers that\nsupport the history api or /#/posts/new for older ones, like Internet\nExplorer 9 and below.

\n

When a user visits a link to your application, they will be automatically\nupgraded or downgraded to the appropriate Location class, with the URL\ntransformed accordingly, if needed.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n", + "static": 1, + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 344, + "access": "private", + "tagname": "Returns the current path as it should appear for HashLocation supported\nbrowsers. This may very well differ from the real current path.", + "itemtype": "method", + "name": "_getHashPath", + "class": "AutoLocation", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 79, + "access": "private", + "tagname": "Will be pre-pended to path upon state change.", + "since": "1.5.1", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 91, + "access": "private", + "tagname": "The browser's `location` object. This is typically equivalent to\n`window.location`, but may be overridden for testing.", + "itemtype": "property", + "name": "location", + "default": "environment.location", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 103, + "access": "private", + "tagname": "The browser's `history` object. This is typically equivalent to\n`window.history`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "history", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 116, + "access": "private", + "tagname": "The user agent's global variable. In browsers, this will be `window`.", + "since": "1.11", + "itemtype": "property", + "name": "global", + "default": "window", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 128, + "access": "private", + "tagname": "The browser's `userAgent`. This is typically equivalent to\n`navigator.userAgent`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "userAgent", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 141, + "access": "private", + "tagname": "This property is used by the router to know whether to cancel the routing\nsetup process, which is needed while we redirect the browser.", + "since": "1.5.1", + "itemtype": "property", + "name": "cancelRouterSetup", + "default": "false", + "class": "AutoLocation", + "module": "@ember/routing" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.2.0/namespaces/ember-4.2.0-Instrumentation-6d326dec6d.json b/json-docs/ember/4.2.0/namespaces/ember-4.2.0-Instrumentation-6d326dec6d.json new file mode 100644 index 000000000..ef626ae8f --- /dev/null +++ b/json-docs/ember/4.2.0/namespaces/ember-4.2.0-Instrumentation-6d326dec6d.json @@ -0,0 +1,46 @@ +{ + "data": { + "id": "ember-4.2.0-Instrumentation", + "type": "namespace", + "attributes": { + "name": "Instrumentation", + "shortname": "Instrumentation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/instrumentation", + "namespace": "", + "file": "packages/@ember/instrumentation/index.ts", + "line": 39, + "description": "

The purpose of the Ember Instrumentation module is\nto provide efficient, general-purpose instrumentation\nfor Ember.

\n

Subscribe to a listener by using subscribe:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { subscribe } from '@ember/instrumentation';\n\nsubscribe("render", {\n  before(name, timestamp, payload) {\n\n  },\n\n  after(name, timestamp, payload) {\n\n  }\n});
\n
\n
\n \n

If you return a value from the before callback, that same\nvalue will be passed as a fourth parameter to the after\ncallback.

\n

Instrument a block of code by using instrument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { instrument } from '@ember/instrumentation';\n\ninstrument("render.handlebars", payload, function() {\n  // rendering logic\n}, binding);
\n
\n
\n \n

Event names passed to instrument are namespaced\nby periods, from more general to more specific. Subscribers\ncan listen for events by whatever level of granularity they\nare interested in.

\n

In the above example, the event is render.handlebars,\nand the subscriber listened for all events beginning with\nrender. It would receive callbacks for events named\nrender, render.handlebars, render.container, or\neven render.handlebars.layout.

\n", + "static": 1, + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.2.0-@ember/instrumentation", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.2.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/application-ec01ddfb3e.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/application-ec01ddfb3e.json new file mode 100644 index 000000000..8ec638d75 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/application-ec01ddfb3e.json @@ -0,0 +1,138 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/application", + "type": "class", + "attributes": { + "name": "@ember/application", + "shortname": "@ember/application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 44, + "description": "

Framework objects in an Ember application (components, services, routes, etc.)\nare created via a factory and dependency injection system. Each of these\nobjects is the responsibility of an "owner", which handled its\ninstantiation and manages its lifetime.

\n

getOwner fetches the owner object responsible for an instance. This can\nbe used to lookup or resolve other class instances, or register new factories\ninto the owner.

\n

For example, this component dynamically looks up a service based on the\naudioType passed as an argument:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
audio.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getOwner } from '@ember/application';\n\n// Usage:\n//\n//   <PlayAudio @audioType={{@model.audioType}} @audioFile={{@model.file}}/>\n//\nexport default class extends Component {\n  get audioService() {\n    let owner = getOwner(this);\n    return owner.lookup(`service:${this.args.audioType}`);\n  }\n\n  @action\n  onPlay() {\n    let player = this.audioService;\n    player.play(this.args.audioFile);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "getOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object with an owner.", + "type": "Object" + } + ], + "return": { + "description": "An owner object.", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 92, + "description": "

setOwner forces a new owner on a given object instance. This is primarily\nuseful in some testing cases.

\n", + "itemtype": "method", + "name": "setOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object instance.", + "type": "Object" + }, + { + "name": "object", + "description": "The new owner object of the object instance.", + "type": "Object" + } + ], + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.js", + "line": 14, + "description": "

Detects when a specific package of Ember (e.g. 'Application')\nhas fully loaded and is available for extension.

\n

The provided callback will be called with the name passed\nresolved from a string into the object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { onLoad } from '@ember/application';\n\nonLoad('Ember.Application' function(hbars) {\n  hbars.registerHelper(...);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "onLoad", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "callback", + "description": "callback to be called", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.js", + "line": 47, + "description": "

Called when an Ember.js package (e.g Application) has finished\nloading. Triggers any callbacks registered for this event.

\n", + "itemtype": "method", + "name": "runLoadHooks", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "object", + "description": "object to pass to callbacks", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/component/helper-9b313d25f1.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/component/helper-9b313d25f1.json new file mode 100644 index 000000000..86bd93a2c --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/component/helper-9b313d25f1.json @@ -0,0 +1,61 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/component/helper", + "type": "class", + "attributes": { + "name": "@ember/component/helper", + "shortname": "@ember/component/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 239, + "description": "

In many cases it is not necessary to use the full Helper class.\nThe helper method create pure-function helpers without instances.\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n
import { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n  return `${currency}${cents * 0.01}`;\n});
\n
\n
\n \n", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/controller-0d655bde06.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/controller-0d655bde06.json new file mode 100644 index 000000000..72c6afe16 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/controller-0d655bde06.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/controller", + "type": "class", + "attributes": { + "name": "@ember/controller", + "shortname": "@ember/controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 20, + "description": "

Creates a property that lazily looks up another controller in the container.\nCan only be used when defining another controller.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default class PostController extends Controller {\n  @controller posts;\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default Controller.extend({\n  posts: controller()\n});
\n
\n
\n \n

This example will create a posts property on the post controller that\nlooks up the posts controller in the container, making it easy to reference\nother controllers.

\n", + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the controller to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/controller", + "module": "@ember/controller" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/debug-5dccbda17c.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/debug-5dccbda17c.json new file mode 100644 index 000000000..ddec51ec2 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/debug-5dccbda17c.json @@ -0,0 +1,310 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/debug", + "type": "class", + "attributes": { + "name": "@ember/debug", + "shortname": "@ember/debug", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 911, + "description": "

Allows checking if a given property on an object is a computed property. For the most part,\nthis doesn't matter (you would normally just access the property directly and use its value),\nbut for some tooling specific scenarios (e.g. the ember-inspector) it is important to\ndifferentiate if a property is a computed property or a "normal" property.

\n

This will work on either a class's prototype or an instance itself.

\n", + "static": 1, + "itemtype": "method", + "name": "isComputed", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/object" + }, + { + "file": "packages/@ember/debug/lib/capture-render-tree.ts", + "line": 9, + "description": "

Ember Inspector calls this function to capture the current render tree.

\n

In production mode, this requires turning on ENV._DEBUG_RENDER_TREE\nbefore loading Ember.

\n", + "access": "private", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "captureRenderTree", + "params": [ + { + "name": "app", + "description": "An `ApplicationInstance`.", + "type": "ApplicationInstance" + } + ], + "since": "3.14.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 36, + "description": "

Allows for runtime registration of handler functions that override the default deprecation behavior.\nDeprecations are invoked by calls to @ember/debug/deprecate.\nThe following example demonstrates its usage by registering a handler that throws an error if the\nmessage contains the word "should", otherwise defers to the default handler.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { registerDeprecationHandler } from '@ember/debug';\n\nregisterDeprecationHandler((message, options, next) => {\n  if (message.indexOf('should') !== -1) {\n    throw new Error(`Deprecation message with should: ${message}`);\n  } else {\n    // defer to whatever handler was registered before this one\n    next(message, options);\n  }\n});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the deprecation call.
  • \n
  • options - An object passed in with the deprecation call containing additional information including:
  • \n
      \n
    • id - An id of the deprecation in the form of package-name.specific-deprecation.
    • \n
    • until - The Ember version number the feature and deprecation will be removed in.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerDeprecationHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle deprecation calls.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 177, + "description": "

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only).

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n", + "itemtype": "method", + "name": "deprecate", + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "test", + "description": "A boolean. If falsy, the deprecation will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "", + "type": "Object", + "props": [ + { + "name": "id", + "description": "A unique id for this deprecation. The id can be\n used by Ember debugging tools to change the behavior (raise, log or silence)\n for that specific deprecation. The id should be namespaced by dots, e.g.\n \"view.helper.select\".", + "type": "String" + }, + { + "name": "until", + "description": "The version of Ember when this deprecation\n warning will be removed.", + "type": "String" + }, + { + "name": "for", + "description": "A namespace for the deprecation, usually the package name", + "type": "String" + }, + { + "name": "since", + "description": "Describes when the deprecation became available and enabled.", + "type": "Object" + }, + { + "name": "url", + "description": "An optional url to the transition guide on the\n emberjs.com website.", + "type": "String", + "optional": true + } + ] + } + ], + "static": 1, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 23, + "description": "

Allows for runtime registration of handler functions that override the default warning behavior.\nWarnings are invoked by calls made to @ember/debug/warn.\nThe following example demonstrates its usage by registering a handler that does nothing overriding Ember's\ndefault warning behavior.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { registerWarnHandler } from '@ember/debug';\n\n// next is not called, so no warnings get the default behavior\nregisterWarnHandler(() => {});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the warn call.
  • \n
  • options - An object passed in with the warn call containing additional information including:
  • \n
      \n
    • id - An id of the warning in the form of package-name.specific-warning.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWarnHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle warnings.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 70, + "description": "

Display a warning with the provided message.

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { warn } from '@ember/debug';\nimport tomsterCount from './tomster-counter'; // a module in my project\n\n// Log a warning if we have more than 3 tomsters\nwarn('Too many tomsters!', tomsterCount <= 3, {\n  id: 'ember-debug.too-many-tomsters'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "warn", + "static": 1, + "params": [ + { + "name": "message", + "description": "A warning to display.", + "type": "String" + }, + { + "name": "test", + "description": "An optional boolean. If falsy, the warning\n will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "An object that can be used to pass a unique\n `id` for this warning. The `id` can be used by Ember debugging tools\n to change the behavior (raise, log, or silence) for that specific warning.\n The `id` should be namespaced by dots, e.g. \"ember-debug.feature-flag-with-features-stripped\"", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 133, + "description": "

Verify that a certain expectation is met, or throw a exception otherwise.

\n

This is useful for communicating assumptions in the code to other human\nreaders as well as catching bugs that accidentally violates these\nexpectations.

\n

Assertions are removed from production builds, so they can be freely added\nfor documentation and debugging purposes without worries of incuring any\nperformance penalty. However, because of that, they should not be used for\nchecks that could reasonably fail during normal usage. Furthermore, care\nshould be taken to avoid accidentally relying on side-effects produced from\nevaluating the condition itself, since the code will not run in production.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assert } from '@ember/debug';\n\n// Test for truthiness\nassert('Must pass a string', typeof str === 'string');\n\n// Fail unconditionally\nassert('This code path should never be run');
\n
\n
\n \n", + "itemtype": "method", + "name": "assert", + "static": 1, + "params": [ + { + "name": "description", + "description": "Describes the expectation. This will become the\n text of the Error thrown if the assertion fails.", + "type": "String" + }, + { + "name": "condition", + "description": "Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.", + "type": "Any" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 173, + "description": "

Display a debug notice.

\n

Calls to this function are not invoked in production builds.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { debug } from '@ember/debug';\n\ndebug('I\\'m a debug notice!');
\n
\n
\n \n", + "itemtype": "method", + "name": "debug", + "static": 1, + "params": [ + { + "name": "message", + "description": "A debug message to display.", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 200, + "description": "

Display an info notice.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n", + "itemtype": "method", + "name": "info", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 219, + "description": "

Alias an old, deprecated method with its new counterpart.

\n

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only) when the assigned method is called.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { deprecateFunc } from '@ember/debug';\n\nEmber.oldMethod = deprecateFunc('Please use the new, updated method', options, Ember.newMethod);
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecateFunc", + "static": 1, + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "options", + "description": "The options object for `deprecate`.", + "type": "Object", + "optional": true + }, + { + "name": "func", + "description": "The new function called to replace its deprecated counterpart.", + "type": "Function" + } + ], + "return": { + "description": "A new function that wraps the original function with a deprecation warning", + "type": "Function" + }, + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 264, + "description": "

Run a function meant for debugging.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport { runInDebug } from '@ember/debug';\n\nrunInDebug(() => {\n  Component.reopen({\n    didInsertElement() {\n      console.log("I'm happy");\n    }\n  });\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "runInDebug", + "static": 1, + "params": [ + { + "name": "func", + "description": "The function to be executed.", + "type": "Function" + } + ], + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/destroyable-c102b6e5aa.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/destroyable-c102b6e5aa.json new file mode 100644 index 000000000..ca53d6b10 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/destroyable-c102b6e5aa.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/destroyable", + "type": "class", + "attributes": { + "name": "@ember/destroyable", + "shortname": "@ember/destroyable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/destroyable", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/destroyable/index.ts", + "line": 31, + "description": "

This function is used to associate a destroyable object with a parent. When the parent\nis destroyed, all registered children will also be destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
class CustomSelect extends Component {\n  constructor(...args) {\n    super(...args);\n\n    // obj is now a child of the component. When the component is destroyed,\n    // obj will also be destroyed, and have all of its destructors triggered.\n    this.obj = associateDestroyableChild(this, {});\n  }\n}
\n
\n
\n \n

Returns the associated child for convenience.

\n", + "itemtype": "method", + "name": "associateDestroyableChild", + "params": [ + { + "name": "parent", + "description": "the destroyable to entangle the child destroyables lifetime with", + "type": "Object|Function" + }, + { + "name": "child", + "description": "the destroyable to be entangled with the parents lifetime", + "type": "Object|Function" + } + ], + "return": { + "description": "the child argument", + "type": "Object|Function" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 58, + "description": "

Receives a destroyable, and returns true if the destroyable has begun destroying. Otherwise returns\nfalse.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let obj = {};\nisDestroying(obj); // false\ndestroy(obj);\nisDestroying(obj); // true\n// ...sometime later, after scheduled destruction\nisDestroyed(obj); // true\nisDestroying(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroying", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 80, + "description": "

Receives a destroyable, and returns true if the destroyable has finished destroying. Otherwise\nreturns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let obj = {};\n\nisDestroyed(obj); // false\ndestroy(obj);\n\n// ...sometime later, after scheduled destruction\n\nisDestroyed(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroyed", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 103, + "description": "

Initiates the destruction of a destroyable object. It runs all associated destructors, and then\ndestroys all children recursively.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let obj = {};\n\nregisterDestructor(obj, () => console.log('destroyed!'));\n\ndestroy(obj); // this will schedule the destructor to be called\n\n// ...some time later, during scheduled destruction\n\n// destroyed!
\n
\n
\n \n

Destruction via destroy() follows these steps:

\n

1, Mark the destroyable such that isDestroying(destroyable) returns true\n2, Call destroy() on each of the destroyable's associated children\n3, Schedule calling the destroyable's destructors\n4, Schedule setting destroyable such that isDestroyed(destroyable) returns true

\n

This results in the entire tree of destroyables being first marked as destroying,\nthen having all of their destructors called, and finally all being marked as isDestroyed.\nThere won't be any in between states where some items are marked as isDestroying while\ndestroying, while others are not.

\n", + "itemtype": "method", + "name": "destroy", + "params": [ + { + "name": "destroyable", + "description": "the object to destroy", + "type": "Object|Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 138, + "description": "

This function asserts that all objects which have associated destructors or associated children\nhave been destroyed at the time it is called. It is meant to be a low level hook that testing\nframeworks can use to hook into and validate that all destroyables have in fact been destroyed.

\n

This function requires that enableDestroyableTracking was called previously, and is only\navailable in non-production builds.

\n", + "itemtype": "method", + "name": "assertDestroyablesDestroyed", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 152, + "description": "

This function instructs the destroyable system to keep track of all destroyables (their\nchildren, destructors, etc). This enables a future usage of assertDestroyablesDestroyed\nto be used to ensure that all destroyable tasks (registered destructors and associated children)\nhave completed when assertDestroyablesDestroyed is called.

\n", + "itemtype": "method", + "name": "enableDestroyableTracking", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 164, + "description": "

Receives a destroyable object and a destructor function, and associates the\nfunction with it. When the destroyable is destroyed with destroy, or when its\nparent is destroyed, the destructor function will be called.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, () => this.resize.unregister(this));\n  }\n}
\n
\n
\n \n

Multiple destructors can be associated with a given destroyable, and they can be\nassociated over time, allowing libraries to dynamically add destructors as needed.\nregisterDestructor also returns the associated destructor function, for convenience.

\n

The destructor function is passed a single argument, which is the destroyable itself.\nThis allows the function to be reused multiple times for many destroyables, rather\nthan creating a closure function per destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nfunction unregisterResize(instance) {\n  instance.resize.unregister(instance);\n}\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, unregisterResize);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "registerDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to register the destructor function with", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to run when the destroyable object is destroyed", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 229, + "description": "

Receives a destroyable and a destructor function, and de-associates the destructor\nfrom the destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor, unregisterDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service modals;\n\n  constructor(...args) {\n    super(...args);\n\n    this.modals.add(this);\n\n    this.modalDestructor = registerDestructor(this, () => this.modals.remove(this));\n  }\n\n  @action pinModal() {\n    unregisterDestructor(this, this.modalDestructor);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "unregisterDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to unregister the destructor function from", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to remove from the destroyable", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/destroyable", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/helper-21c41cce34.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/helper-21c41cce34.json new file mode 100644 index 000000000..d81b1dbde --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/helper-21c41cce34.json @@ -0,0 +1,128 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/helper", + "type": "class", + "attributes": { + "name": "@ember/helper", + "shortname": "@ember/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/helper", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/helper/index.ts", + "line": 5, + "description": "

capabilities returns a capabilities configuration which can be used to modify\nthe behavior of the manager. Manager capabilities must be provided using the\ncapabilities function, as the underlying implementation can change over time.

\n

The first argument to capabilities is a version string, which is the version of\nEmber that the capabilities were defined in. Ember can add new versions at any\ntime, and these may have entirely different behaviors, but it will not remove\nold versions until the next major version.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
capabilities('3.23');
\n
\n
\n \n

The second argument is an object of capabilities and boolean values indicating\nwhether they are enabled or disabled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
capabilities('3.23', {\n  hasValue: true,\n  hasDestructor: true,\n});
\n
\n
\n \n

If no value is specified, then the default value will be used.

\n

3.23 capabilities

\n

hasDestroyable

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a destroyable to include in the destructor\nhierarchy. If enabled, the getDestroyable hook will be called, and its result\nwill be associated with the destroyable parent block.

\n

hasValue

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a value which can be used externally. The helper's\ngetValue hook will be run whenever the value of the helper is accessed if this\ncapability is enabled.

\n", + "itemtype": "method", + "name": "capabilities", + "static": 1, + "params": [ + { + "name": "managerApiVersion", + "description": "The version of capabilities that are being used", + "type": "String" + }, + { + "name": "options", + "description": "The capabilities values" + } + ], + "return": { + "description": "The capabilities object instance", + "type": "Capabilities" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 58, + "description": "

Sets the helper manager for an object or function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
setHelperManager((owner) => new ClassHelperManager(owner), Helper)
\n
\n
\n \n

When a value is used as a helper in a template, the helper manager is looked up\non the object by walking up its prototype chain and finding the first helper\nmanager. This manager then receives the value and can create and manage an\ninstance of a helper from it. This provides a layer of indirection that allows\nusers to design high-level helper APIs, without Ember needing to worry about the\ndetails. High-level APIs can be experimented with and iterated on while the\ncore of Ember helpers remains stable, and new APIs can be introduced gradually\nover time to existing code bases.

\n

setHelperManager receives two arguments:

\n
    \n
  1. A factory function, which receives the owner and returns an instance of a\n helper manager.
  2. \n
  3. A helper definition, which is the object or function to associate the factory function with.
  4. \n
\n

The first time the object is looked up, the factory function will be called to\ncreate the helper manager. It will be cached, and in subsequent lookups the\ncached helper manager will be used instead.

\n

Only one helper manager is guaranteed to exist per owner and per usage of\nsetHelperManager, so many helpers will end up using the same instance of the\nhelper manager. As such, you should only store state that is related to the\nmanager itself. If you want to store state specific to a particular helper\ndefinition, you should assign a unique helper manager to that helper. In\ngeneral, most managers should either be stateless, or only have the owner they\nwere created with as state.

\n

Helper managers must fulfill the following interface (This example uses\nTypeScript interfaces\nfor precision, you do not need to write helper managers using TypeScript):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
interface HelperManager<HelperStateBucket> {\n  capabilities: HelperCapabilities;\n\n  createHelper(definition: HelperDefinition, args: TemplateArgs): HelperStateBucket;\n\n  getValue?(bucket: HelperStateBucket): unknown;\n\n  runEffect?(bucket: HelperStateBucket): void;\n\n  getDestroyable?(bucket: HelperStateBucket): object;\n}
\n
\n
\n \n

The capabilities property must be provided using the capabilities() function\nimported from the same module as setHelperManager:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capabilities } from '@ember/helper';\n\nclass MyHelperManager {\n  capabilities = capabilities('3.21.0', { hasValue: true });\n\n  // ...snip...\n}
\n
\n
\n \n

Below is a description of each of the methods on the interface and their\nfunctions.

\n

createHelper

\n

createHelper is a required hook on the HelperManager interface. The hook is\npassed the definition of the helper that is currently being created, and is\nexpected to return a state bucket. This state bucket is what represents the\ncurrent state of the helper, and will be passed to the other lifecycle hooks at\nappropriate times. It is not necessarily related to the definition of the\nhelper itself - for instance, you could return an object containing an\ninstance of the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
class MyManager {\n  createHelper(Definition, args) {\n    return {\n      instance: new Definition(args);\n    };\n  }\n}
\n
\n
\n \n

This allows the manager to store metadata that it doesn't want to expose to the\nuser.

\n

This hook is not autotracked - changes to tracked values used within this hook\nwill not result in a call to any of the other lifecycle hooks. This is because\nit is unclear what should happen if it invalidates, and rather than make a\ndecision at this point, the initial API is aiming to allow as much expressivity\nas possible. This could change in the future with changes to capabilities and\ntheir behaviors.

\n

If users do want to autotrack some values used during construction, they can\neither create the instance of the helper in runEffect or getValue, or they\ncan use the cache API to autotrack the createHelper hook themselves. This\nprovides maximum flexibility and expressiveness to manager authors.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called as discovered during DOM construction
  • \n
  • called in definition order in the template
  • \n
\n

getValue

\n

getValue is an optional hook that should return the value of the helper. This\nis the value that is returned from the helper and passed into the template.

\n

This hook is called when the value is requested from the helper (e.g. when the\ntemplate is rendering and the helper value is needed). The hook is autotracked,\nand will rerun whenever any tracked values used inside of it are updated.\nOtherwise it does not rerun.

\n
\n

Note: This means that arguments which are not consumed within the hook will\nnot trigger updates.

\n
\n

This hook is only called for helpers with the hasValue capability enabled.\nThis hook has the following timing semantics:

\n

Always

\n
    \n
  • called the first time the helper value is requested
  • \n
  • called after autotracked state has changed
  • \n
\n

Never

\n
    \n
  • called if the hasValue capability is disabled
  • \n
\n

runEffect

\n

runEffect is an optional hook that should run the effect that the helper is\napplying, setting it up or updating it.

\n

This hook is scheduled to be called some time after render and prior to paint.\nThere is not a guaranteed, 1-to-1 relationship between a render pass and this\nhook firing. For instance, multiple render passes could occur, and the hook may\nonly trigger once. It may also never trigger if it was dirtied in one render\npass and then destroyed in the next.

\n

The hook is autotracked, and will rerun whenever any tracked values used inside\nof it are updated. Otherwise it does not rerun.

\n

The hook is also run during a time period where state mutations are disabled\nin Ember. Any tracked state mutation will throw an error during this time,\nincluding changes to tracked properties, changes made using Ember.set, updates\nto computed properties, etc. This is meant to prevent infinite rerenders and\nother antipatterns.

\n

This hook is only called for helpers with the hasScheduledEffect capability\nenabled. This hook is also not called in SSR currently, though this could be\nadded as a capability in the future. It has the following timing semantics:

\n

Always

\n
    \n
  • called after the helper was first created, if the helper has not been\ndestroyed since creation
  • \n
  • called after autotracked state has changed, if the helper has not been\ndestroyed during render
  • \n
\n

Never

\n
    \n
  • called if the hasScheduledEffect capability is disabled
  • \n
  • called in SSR
  • \n
\n

getDestroyable

\n

getDestroyable is an optional hook that users can use to register a\ndestroyable object for the helper. This destroyable will be registered to the\ncontaining block or template parent, and will be destroyed when it is destroyed.\nSee the Destroyables RFC\nfor more details.

\n

getDestroyable is only called if the hasDestroyable capability is enabled.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called immediately after the createHelper hook is called
  • \n
\n

Never

\n
    \n
  • called if the hasDestroyable capability is disabled
  • \n
\n", + "itemtype": "method", + "name": "setHelperManager", + "static": 1, + "params": [ + { + "name": "factory", + "description": "A factory function which receives an optional owner, and returns a helper manager", + "type": "Function" + }, + { + "name": "definition", + "description": "The definition to associate the manager factory with", + "type": "Object" + } + ], + "return": { + "description": "The definition passed into setHelperManager", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 251, + "description": "

The invokeHelper function can be used to create a helper instance in\nJavaScript.

\n

To access a helper's value you have to use getValue from\n@glimmer/tracking/primitives/cache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
// app/components/data-loader.js\nimport Component from '@glimmer/component';\nimport { getValue } from '@glimmer/tracking/primitives/cache';\nimport Helper from '@ember/component/helper';\nimport { invokeHelper } from '@ember/helper';\n\nclass PlusOne extends Helper {\n  compute([number]) {\n    return number + 1;\n  }\n}\n\nexport default class PlusOneComponent extends Component {\n  plusOne = invokeHelper(this, PlusOne, () => {\n    return {\n      positional: [this.args.number],\n    };\n  });\n\n  get value() {\n    return getValue(this.plusOne);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{this.value}}
\n
\n
\n \n

It receives three arguments:

\n
    \n
  • context: The parent context of the helper. When the parent is torn down and\nremoved, the helper will be as well.
  • \n
  • definition: The definition of the helper.
  • \n
  • computeArgs: An optional function that produces the arguments to the helper.\nThe function receives the parent context as an argument, and must return an\nobject with a positional property that is an array and/or a named\nproperty that is an object.
  • \n
\n

And it returns a Cache instance that contains the most recent value of the\nhelper. You can access the helper using getValue() like any other cache. The\ncache is also destroyable, and using the destroy() function on it will cause\nthe helper to be torn down.

\n

Note that using getValue() on helpers that have scheduled effects will not\ntrigger the effect early. Effects will continue to run at their scheduled time.

\n", + "itemtype": "method", + "name": "invokeHelper", + "static": 1, + "params": [ + { + "name": "context", + "description": "The parent context of the helper", + "type": "Object" + }, + { + "name": "definition", + "description": "The helper definition", + "type": "Object" + }, + { + "name": "computeArgs", + "description": "An optional function that produces args", + "type": "Function" + } + ], + "return": { + "description": "" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/helper", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/object-c607604d1b.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/object-c607604d1b.json new file mode 100644 index 000000000..1a77c9a2d --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/object-c607604d1b.json @@ -0,0 +1,521 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/object", + "type": "class", + "attributes": { + "name": "@ember/object", + "shortname": "@ember/object", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 723, + "description": "

This helper returns a new property descriptor that wraps the passed\ncomputed property function. You can use this helper to define properties with\nnative decorator syntax, mixins, or via defineProperty().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', function() {\n    return `${this.get('firstName')} ${this.get('lastName')}`;\n  })\n});\n\nlet client = Person.create();\n\nclient.get('fullName'); // 'Betty Jones'\n\nclient.set('lastName', 'Fuller');\nclient.get('fullName'); // 'Betty Fuller'
\n
\n
\n \n

You can also provide a setter, either directly on the class using native class\nsyntax, or by passing a hash with get and set functions.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(/\\s+/);\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n\n    return value;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', {\n    get(key) {\n      return `${this.get('firstName')} ${this.get('lastName')}`;\n    },\n    set(key, value) {\n      let [firstName, lastName] = value.split(/\\s+/);\n      this.setProperties({ firstName, lastName });\n      return value;\n    }\n  })\n});\n\nlet client = Person.create();\nclient.get('firstName'); // 'Betty'\n\nclient.set('fullName', 'Carroll Fuller');\nclient.get('firstName'); // 'Carroll'
\n
\n
\n \n

When passed as an argument, the set function should accept two parameters,\nkey and value. The value returned from set will be the new value of the\nproperty.

\n

Note: This is the preferred way to define computed properties when writing third-party\nlibraries that depend on or use Ember, since there is no guarantee that the user\nwill have prototype Extensions enabled.

\n", + "itemtype": "method", + "name": "computed", + "static": 1, + "params": [ + { + "name": "dependentKeys*", + "description": "Optional dependent keys that trigger this computed property.", + "type": "String", + "optional": true + }, + { + "name": "func", + "description": "The computed property function.", + "type": "Function" + } + ], + "return": { + "description": "property decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/get_properties.ts", + "line": 6, + "description": "

To get multiple properties at once, call getProperties\nwith an object followed by a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, 'firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, ['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + }, + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 766, + "description": "

Specify a method that observes property changes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nimport { observer } from '@ember/object';\n\nexport default EmberObject.extend({\n  valueObserver: observer('value', function() {\n    // Executes whenever the "value" property changes\n  })\n});
\n
\n
\n \n

Also available as Function.prototype.observes if prototype extensions are\nenabled.

\n", + "itemtype": "method", + "name": "observer", + "params": [ + { + "name": "propertyNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "func" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/properties.ts", + "line": 11, + "description": "

NOTE: This is a low-level method used by other parts of the API. You almost\nnever want to call this method directly. Instead you should use\nmixin() to define new properties.

\n

Defines a property on an object. This method works much like the ES5\nObject.defineProperty() method except that it can also accept computed\nproperties and other special descriptors.

\n

Normally this method takes only three parameters. However if you pass an\ninstance of Descriptor as the third param then you can pass an\noptional value as the fourth parameter. This is often more efficient than\ncreating new descriptor hashes for each property.

\n

Examples

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { defineProperty, computed } from '@ember/object';\n\n// ES5 compatible mode\ndefineProperty(contact, 'firstName', {\n  writable: true,\n  configurable: false,\n  enumerable: true,\n  value: 'Charles'\n});\n\n// define a simple property\ndefineProperty(contact, 'lastName', undefined, 'Jolley');\n\n// define a computed property\ndefineProperty(contact, 'fullName', computed('firstName', 'lastName', function() {\n  return this.firstName+' '+this.lastName;\n}));
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "defineProperty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "the object to define this property on. This may be a prototype.", + "type": "Object" + }, + { + "name": "keyName", + "description": "the name of the property", + "type": "String" + }, + { + "name": "desc", + "description": "an instance of `Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.", + "type": "Descriptor", + "optional": true + }, + { + "name": "data", + "description": "something other than a descriptor, that will\n become the explicit value of this property.", + "type": "*", + "optional": true + } + ], + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 19, + "description": "

This function is called just after an object property has changed.\nIt will notify any observers and clear caches among other things.

\n

Normally you will not need to call this method directly but if for some\nreason you can't directly watch a property you can invoke this method\nmanually.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "obj", + "description": "The object with the property that will change", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key (or path) that will change.", + "type": "String" + }, + { + "name": "_meta", + "description": "The objects meta.", + "type": "Meta", + "optional": true + }, + { + "name": "value", + "description": "The new value to set for the property", + "type": "Unknown", + "optional": true + } + ], + "return": { + "description": "", + "type": "Void" + }, + "since": "3.1.0", + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 67, + "itemtype": "method", + "name": "beginPropertyChanges", + "chainable": 1, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 77, + "itemtype": "method", + "name": "endPropertyChanges", + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 89, + "description": "

Make a series of property changes together in an\nexception-safe way.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
Ember.changeProperties(function() {\n  obj1.set('foo', mayBlowUpWhenSet);\n  obj2.set('bar', baz);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "changeProperties", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_get.ts", + "line": 41, + "description": "

Gets the value of a property on an object. If the property is computed,\nthe function will be invoked. If the property is not defined but the\nobject implements the unknownProperty method then that will be invoked.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { get } from '@ember/object';\nget(obj, "name");
\n
\n
\n \n

If you plan to run on IE8 and older browsers then you should use this\nmethod anytime you want to retrieve a property on an object that you don't\nknow for sure is private. (Properties beginning with an underscore '_'\nare considered private.)

\n

On all newer browsers, you only need to use this method to retrieve\nproperties if the property might not be defined on the object and you want\nto respect the unknownProperty handler. Otherwise you can ignore this\nmethod.

\n

Note that if the object itself is undefined, this method will throw\nan error.

\n", + "itemtype": "method", + "name": "get", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to retrieve from.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to retrieve", + "type": "String" + } + ], + "return": { + "description": "the property value or `null`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 18, + "description": "

Sets the value of a property on an object, respecting computed properties\nand notifying observers and other listeners of the change.\nIf the specified property is not defined on the object and the object\nimplements the setUnknownProperty method, then instead of setting the\nvalue of the property on the object, its setUnknownProperty handler\nwill be invoked with the two parameters keyName and value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { set } from '@ember/object';\nset(obj, "name", value);
\n
\n
\n \n", + "itemtype": "method", + "name": "set", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "return": { + "description": "the passed value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 124, + "description": "

Error-tolerant form of set. Will not blow up if any part of the\nchain is undefined, null, or destroyed.

\n

This is primarily used when syncing bindings, which may try to update after\nan object has been destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { trySet } from '@ember/object';\n\nlet obj = { name: "Zoey" };\ntrySet(obj, "contacts.twitter", "@emberjs");
\n
\n
\n \n", + "itemtype": "method", + "name": "trySet", + "static": 1, + "params": [ + { + "name": "root", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "path", + "description": "The property path to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/set_properties.ts", + "line": 6, + "description": "

Set a list of properties on an object. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nlet anObject = EmberObject.create();\n\nanObject.setProperties({\n  firstName: 'Stanley',\n  lastName: 'Stuart',\n  age: 21\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "properties", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "properties" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 575, + "description": "

Creates a new subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(thing);\n   }\n});
\n
\n
\n \n

This defines a new subclass of EmberObject: Person. It contains one method: say().

\n

You can also create a subclass from any existing class by calling its extend() method.\nFor example, you might want to create a subclass of Ember's built-in Component class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nconst PersonComponent = Component.extend({\n  tagName: 'li',\n  classNameBindings: ['isAdministrator']\n});
\n
\n
\n \n

When defining a subclass, you can override methods but still access the\nimplementation of your parent class by calling the special _super() method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    let name = this.get('name');\n    alert(`${name} says: ${thing}`);\n  }\n});\n\nconst Soldier = Person.extend({\n  say(thing) {\n    this._super(`${thing}, sir!`);\n  },\n  march(numberOfHours) {\n    alert(`${this.get('name')} marches for ${numberOfHours} hours.`);\n  }\n});\n\nlet yehuda = Soldier.create({\n  name: 'Yehuda Katz'\n});\n\nyehuda.say('Yes');  // alerts "Yehuda Katz says: Yes, sir!"
\n
\n
\n \n

The create() on line #17 creates an instance of the Soldier class.\nThe extend() on line #8 creates a subclass of Person. Any instance\nof the Person class will not have the march() method.

\n

You can also pass Mixin classes to add additional properties to the subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import EmberObject from '@ember/object';\nimport Mixin from '@ember/object/mixin';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(`${this.get('name')} says: ${thing}`);\n  }\n});\n\nconst SingingMixin = Mixin.create({\n  sing(thing) {\n    alert(`${this.get('name')} sings: la la la ${thing}`);\n  }\n});\n\nconst BroadwayStar = Person.extend(SingingMixin, {\n  dance() {\n    alert(`${this.get('name')} dances: tap tap tap tap `);\n  }\n});
\n
\n
\n \n

The BroadwayStar class contains three methods: say(), sing(), and dance().

\n", + "itemtype": "method", + "name": "extend", + "static": 1, + "params": [ + { + "name": "mixins", + "description": "One or more Mixin classes", + "type": "Mixin", + "optional": true, + "multiple": true + }, + { + "name": "arguments", + "description": "Object containing values to use within the new class", + "type": "Object", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 675, + "description": "

Creates an instance of a class. Accepts either no arguments, or an object\ncontaining values to initialize the newly instantiated object with.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  helloWorld() {\n    alert(`Hi, my name is ${this.get('name')}`);\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\n\ntom.helloWorld(); // alerts "Hi, my name is Tom Dale".
\n
\n
\n \n

create will call the init function if defined during\nAnyObject.extend

\n

If no arguments are passed to create, it will not set values to the new\ninstance during initialization:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let noName = Person.create();\nnoName.helloWorld(); // alerts undefined
\n
\n
\n \n

NOTE: For performance reasons, you cannot declare methods or computed\nproperties during create. You should instead declare methods and computed\nproperties when using extend.

\n", + "itemtype": "method", + "name": "create", + "static": 1, + "params": [ + { + "name": "arguments", + "description": "", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 735, + "description": "

Augments a constructor's prototype with additional\nproperties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\no = MyObject.create();\no.get('name'); // 'an object'\n\nMyObject.reopen({\n  say(msg) {\n    console.log(msg);\n  }\n});\n\no2 = MyObject.create();\no2.say('hello'); // logs "hello"\n\no.say('goodbye'); // logs "goodbye"
\n
\n
\n \n

To add functions and properties to the constructor itself,\nsee reopenClass

\n", + "itemtype": "method", + "name": "reopen", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 789, + "description": "

Augments a constructor's own properties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\nMyObject.reopenClass({\n  canBuild: false\n});\n\nMyObject.canBuild; // false\no = MyObject.create();
\n
\n
\n \n

In other words, this creates static properties and functions for the class.\nThese are only available on the class and not on any instance of that class.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  name: '',\n  sayHello() {\n    alert(`Hello. My name is ${this.get('name')}`);\n  }\n});\n\nPerson.reopenClass({\n  species: 'Homo sapiens',\n\n  createPerson(name) {\n    return Person.create({ name });\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\nlet yehuda = Person.createPerson('Yehuda Katz');\n\ntom.sayHello(); // "Hello. My name is Tom Dale"\nyehuda.sayHello(); // "Hello. My name is Yehuda Katz"\nalert(Person.species); // "Homo sapiens"
\n
\n
\n \n

Note that species and createPerson are not valid on the tom and yehuda\nvariables. They are only valid on Person.

\n

To add functions and properties to instances of\na constructor by extending the constructor's prototype\nsee reopen

\n", + "itemtype": "method", + "name": "reopenClass", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 872, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For\nexample, computed property functions may close over variables that are then\nno longer available for introspection.

\n

You can pass a hash of these values to a computed property like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { computed } from '@ember/object';\n\nperson: computed(function() {\n  let personId = this.get('personId');\n  return Person.create({ id: personId });\n}).meta({ type: Person })
\n
\n
\n \n

Once you've done this, you can retrieve the values saved to the computed\nproperty from your class like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyClass.metaForProperty('person');
\n
\n
\n \n

This will return the original hash that was passed to meta().

\n", + "static": 1, + "itemtype": "method", + "name": "metaForProperty", + "params": [ + { + "name": "key", + "description": "property name", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 915, + "description": "

Iterate over each computed property for the class, passing its name\nand any associated metadata (see metaForProperty) to the callback.

\n", + "static": 1, + "itemtype": "method", + "name": "eachComputedProperty", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "binding", + "description": "", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 1025, + "description": "

Provides lookup-time type validation for injected properties.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_onLookup", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 1046, + "description": "

Returns a hash of property names and container names that injected\nproperties will lookup on the container lazily.

\n", + "itemtype": "method", + "name": "_lazyInjections", + "return": { + "description": "Hash of all lazy injected property keys to container names", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/index.js", + "line": 18, + "description": "

Decorator that turns the target function into an Action which can be accessed\ndirectly by reference.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action this.toggleShowing}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

Decorated actions also interop with the string style template actions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action "toggleShowing"}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

It also binds the function directly to the instance, so it can be used in any\ncontext and will correctly refer to the class it came from:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert this.toggleShowing}}\n  {{on "click" this.toggleShowing}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

This can also be used in JavaScript code directly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  constructor() {\n    super(...arguments);\n\n    // this.toggleShowing is still bound correctly when added to\n    // the event listener\n    document.addEventListener('click', this.toggleShowing);\n  }\n\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n

This is considered best practice, since it means that methods will be bound\ncorrectly no matter where they are used. By contrast, the {{action}} helper\nand modifier can also be used to bind context, but it will be required for\nevery usage of the method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert (action this.toggleShowing)}}\n  {{on "click" (action this.toggleShowing)}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

They also do not have equivalents in JavaScript directly, so they cannot be\nused for other situations where binding would be useful.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "action", + "static": 1, + "params": [ + { + "name": "callback", + "description": "The function to turn into an action,\n when used in classic classes", + "type": "Function|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/object/compat-ea6b801de0.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/object/compat-ea6b801de0.json new file mode 100644 index 000000000..15556c131 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/object/compat-ea6b801de0.json @@ -0,0 +1,64 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/object/compat", + "type": "class", + "attributes": { + "name": "@ember/object/compat", + "shortname": "@ember/object/compat", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/object/compat.ts", + "line": 40, + "description": "

@dependentKeyCompat is decorator that can be used on native getters that\nuse tracked properties. It exposes the getter to Ember's classic computed\nproperty and observer systems, so they can watch it for changes. It can be\nused in both native and classic classes.

\n

Native Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { computed, set } from '@ember/object';\n\nclass Person {\n  @tracked firstName;\n  @tracked lastName;\n\n  @dependentKeyCompat\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nclass Profile {\n  constructor(person) {\n    set(this, 'person', person);\n  }\n\n  @computed('person.fullName')\n  get helloMessage() {\n    return `Hello, ${this.person.fullName}!`;\n  }\n}
\n
\n
\n \n

Classic Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport EmberObject, { computed, observer, set } from '@ember/object';\n\nconst Person = EmberObject.extend({\n  firstName: tracked(),\n  lastName: tracked(),\n\n  fullName: dependentKeyCompat(function() {\n    return `${this.firstName} ${this.lastName}`;\n  }),\n});\n\nconst Profile = EmberObject.extend({\n  person: null,\n\n  helloMessage: computed('person.fullName', function() {\n    return `Hello, ${this.person.fullName}!`;\n  }),\n\n  onNameUpdated: observer('person.fullName', function() {\n    console.log('person name updated!');\n  }),\n});
\n
\n
\n \n

dependentKeyCompat() can receive a getter function or an object containing\nget/set methods when used in classic classes, like computed properties.

\n

In general, only properties which you expect to be watched by older,\nuntracked clases should be marked as dependency compatible. The decorator is\nmeant as an interop layer for parts of Ember's older classic APIs, and should\nnot be applied to every possible getter/setter in classes. The number of\ndependency compatible getters should be minimized wherever possible. New\napplication code should not need to use @dependentKeyCompat, since it is\nonly for interoperation with older code.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "dependentKeyCompat", + "static": 1, + "params": [ + { + "name": "desc", + "description": "A property descriptor containing\n the getter and setter (when used in\n classic classes)", + "type": "PropertyDescriptor|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object/compat", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/object/computed-0992115d21.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/object/computed-0992115d21.json new file mode 100644 index 000000000..0e4d547f5 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/object/computed-0992115d21.json @@ -0,0 +1,903 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/object/computed", + "type": "class", + "attributes": { + "name": "@ember/object/computed", + "shortname": "@ember/object/computed", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/expand_properties.ts", + "line": 9, + "description": "

Expands pattern, invoking callback for each expansion.

\n

The only pattern supported is brace-expansion, anything else will be passed\nonce to callback directly.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { expandProperties } from '@ember/object/computed';\n\nfunction echo(arg){ console.log(arg); }\n\nexpandProperties('foo.bar', echo);              //=> 'foo.bar'\nexpandProperties('{foo,bar}', echo);            //=> 'foo', 'bar'\nexpandProperties('foo.{bar,baz}', echo);        //=> 'foo.bar', 'foo.baz'\nexpandProperties('{foo,bar}.baz', echo);        //=> 'foo.baz', 'bar.baz'\nexpandProperties('foo.{bar,baz}.[]', echo)      //=> 'foo.bar.[]', 'foo.baz.[]'\nexpandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs'\nexpandProperties('{foo}.bar.{baz}')             //=> 'foo.bar.baz'
\n
\n
\n \n", + "itemtype": "method", + "name": "expandProperties", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "pattern", + "description": "The property pattern to expand.", + "type": "String" + }, + { + "name": "callback", + "description": "The callback to invoke. It is invoked once per\nexpansion, and is passed the expansion.", + "type": "Function" + } + ], + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 63, + "description": "

A computed property macro that returns true if the value of the dependent\nproperty is null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { empty } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  @empty('todos') isDone;\n}\n\nlet todoList = new ToDoList(\n  ['Unit Test', 'Documentation', 'Release']\n);\n\ntodoList.isDone; // false\nset(todoList, 'todos', []);\ntodoList.isDone; // true
\n
\n
\n \n", + "since": "1.6.0", + "itemtype": "method", + "name": "empty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if the value\nof the dependent property is null, an empty string, empty array, or empty\nfunction and false if the underlying value is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 112, + "description": "

A computed property that returns true if the value of the dependent property\nis NOT null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { notEmpty } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(backpack) {\n    set(this, 'backpack', backpack);\n  }\n\n  @notEmpty('backpack') hasStuff\n}\n\nlet hamster = new Hamster(\n  ['Food', 'Sleeping Bag', 'Tent']\n);\n\nhamster.hasStuff; // true\nset(hamster, 'backpack', []);\nhamster.hasStuff; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "notEmpty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 158, + "description": "

A computed property that returns true if the value of the dependent property\nis null or undefined. This avoids errors from JSLint complaining about use of\n==, which can be technically confusing.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { none } from '@ember/object/computed';\n\nclass Hamster {\n  @none('food') isHungry;\n}\n\nlet hamster = new Hamster();\n\nhamster.isHungry; // true\n\nset(hamster, 'food', 'Banana');\nhamster.isHungry; // false\n\nset(hamster, 'food', null);\nhamster.isHungry; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "none", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is null or undefined.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 201, + "description": "

A computed property that returns the inverse boolean value of the original\nvalue for the dependent property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { not } from '@ember/object/computed';\n\nclass User {\n  loggedIn = false;\n\n  @not('loggedIn') isAnonymous;\n}\n\nlet user = new User();\n\nuser.isAnonymous; // true\nset(user, 'loggedIn', true);\nuser.isAnonymous; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "not", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns inverse of the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 243, + "description": "

A computed property that converts the provided dependent property into a\nboolean value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { bool } from '@ember/object/computed';\n\n\nclass Hamster {\n  @bool('numBananas') hasBananas\n}\n\nlet hamster = new Hamster();\n\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 0);\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 1);\nhamster.hasBananas; // true\n\nset(hamster, 'numBananas', null);\nhamster.hasBananas; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "bool", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which converts to boolean the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 291, + "description": "

A computed property which matches the original value for the dependent\nproperty against a given RegExp, returning true if the value matches the\nRegExp and false if it does not.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { match } from '@ember/object/computed';\n\nclass User {\n  @match('email', /^.+@.+\\..+$/) hasValidEmail;\n}\n\nlet user = new User();\n\nuser.hasValidEmail; // false\n\nset(user, 'email', '');\nuser.hasValidEmail; // false\n\nset(user, 'email', 'ember_hamster@example.com');\nuser.hasValidEmail; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "match", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "regexp", + "description": "", + "type": "RegExp" + } + ], + "return": { + "description": "computed property which match the original value\nfor property against a given RegExp", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 338, + "description": "

A computed property that returns true if the provided dependent property is\nequal to the given value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { equal } from '@ember/object/computed';\n\nclass Hamster {\n  @equal('percentCarrotsEaten', 100) satisfied;\n}\n\nlet hamster = new Hamster();\n\nhamster.satisfied; // false\n\nset(hamster, 'percentCarrotsEaten', 100);\nhamster.satisfied; // true\n\nset(hamster, 'percentCarrotsEaten', 50);\nhamster.satisfied; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "equal", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "String|Number|Object" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is equal to the given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 383, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gt } from '@ember/object/computed';\n\nclass Hamster {\n  @gt('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 11);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 428, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gte } from '@ember/object/computed';\n\nclass Hamster {\n  @gte('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 10);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater or equal then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 473, + "description": "

A computed property that returns true if the provided dependent property is\nless than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lt } from '@ember/object/computed';\n\nclass Hamster {\n  @lt('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 2);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 518, + "description": "

A computed property that returns true if the provided dependent property is\nless than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lte } from '@ember/object/computed';\n\nclass Hamster {\n  @lte('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 5);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less or equal than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 563, + "description": "

A computed property that performs a logical and on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first falsy value or last\ntruthy value just like JavaScript's && operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { and } from '@ember/object/computed';\n\nclass Hamster {\n  @and('hasTent', 'hasBackpack') readyForCamp;\n  @and('hasWalkingStick', 'hasBackpack') readyForHike;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForCamp; // false\n\nset(tomster, 'hasTent', true);\ntomster.readyForCamp; // false\n\nset(tomster, 'hasBackpack', true);\ntomster.readyForCamp; // true\n\nset(tomster, 'hasBackpack', 'Yes');\ntomster.readyForCamp; // 'Yes'\n\nset(tomster, 'hasWalkingStick', null);\ntomster.readyForHike; // null
\n
\n
\n \n", + "itemtype": "method", + "name": "and", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `and` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 609, + "description": "

A computed property which performs a logical or on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first truthy value or last\nfalsy value just like JavaScript's || operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { or } from '@ember/object/computed';\n\nclass Hamster {\n  @or('hasJacket', 'hasUmbrella') readyForRain;\n  @or('hasSunscreen', 'hasUmbrella') readyForBeach;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForRain; // undefined\n\nset(tomster, 'hasUmbrella', true);\ntomster.readyForRain; // true\n\nset(tomster, 'hasJacket', 'Yes');\ntomster.readyForRain; // 'Yes'\n\nset(tomster, 'hasSunscreen', 'Check');\ntomster.readyForBeach; // 'Check'
\n
\n
\n \n", + "itemtype": "method", + "name": "or", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `or` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 652, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { alias } from '@ember/object/computed';\n\nclass Person {\n  name = 'Alex Matchneer';\n\n  @alias('name') nomen;\n}\n\nlet alex = new Person();\n\nalex.nomen; // 'Alex Matchneer'\nalex.name;  // 'Alex Matchneer'\n\nset(alex, 'nomen', '@machty');\nalex.name;  // '@machty'
\n
\n
\n \n", + "itemtype": "method", + "name": "alias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates an alias to the\noriginal value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 687, + "description": "

Where the alias computed macro aliases get and set, and allows for\nbidirectional data flow, the oneWay computed macro only provides an aliased\nget. The set will not mutate the upstream property, rather causes the\ncurrent property to become the value set. This causes the downstream property\nto permanently diverge from the upstream property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { oneWay }from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @oneWay('firstName') nickName;\n}\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear');\nteddy.firstName; // 'Teddy'\nteddy.nickName; // 'TeddyBear'
\n
\n
\n \n", + "itemtype": "method", + "name": "oneWay", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 735, + "description": "

This is a more semantically meaningful alias of the oneWay computed macro,\nwhose name is somewhat ambiguous as to which direction the data flows.

\n", + "itemtype": "method", + "name": "reads", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\n property to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 748, + "description": "

Where oneWay computed macro provides oneWay bindings, the readOnly\ncomputed macro provides a readOnly one way binding. Very often when using\nthe oneWay macro one does not also want changes to propagate back up, as\nthey will replace the value.

\n

This prevents the reverse flow, and also throws an exception when it occurs.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { readOnly } from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @readOnly('firstName') nickName;\n});\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear'); // throws Exception\n// throw new EmberError('Cannot Set: nickName on: <User:ember27288>' );`\n\nteddy.firstName; // 'Teddy'
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 799, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property, but also print a deprecation warning.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { set } from '@ember/object';\nimport { deprecatingAlias } from '@ember/object/computed';\n\nclass Hamster {\n  @deprecatingAlias('cavendishCount', {\n    id: 'hamster.deprecate-banana',\n    until: '3.0.0'\n  })\n  bananaCount;\n}\n\nlet hamster = new Hamster();\n\nset(hamster, 'bananaCount', 5); // Prints a deprecation warning.\nhamster.cavendishCount; // 5
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecatingAlias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "Options for `deprecate`.", + "type": "Object" + } + ], + "return": { + "description": "computed property which creates an alias with a\ndeprecation to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 56, + "description": "

A computed property that returns the sum of the values in the dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { sum } from '@ember/object/computed';\n\nclass Invoice {\n  lineItems = [1.00, 2.50, 9.99];\n\n  @sum('lineItems') total;\n}\n\nlet invoice = new Invoice();\n\ninvoice.total; // 13.49
\n
\n
\n \n", + "itemtype": "method", + "name": "sum", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the sum of all values in the\ndependentKey's array", + "type": "ComputedProperty" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 93, + "description": "

A computed property that calculates the maximum value in the dependent array.\nThis will return -Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, max } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @max('childAges') maxChildAge;\n}\n\nlet lordByron = new Person();\n\nlordByron.maxChildAge; // -Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.maxChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.maxChildAge; // 8
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe max of a list of Date objects will be the highest timestamp as a Number.\nThis behavior is consistent with Math.max.

\n", + "itemtype": "method", + "name": "max", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the largest value in the dependentKey's\narray", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 157, + "description": "

A computed property that calculates the minimum value in the dependent array.\nThis will return Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, min } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @min('childAges') minChildAge;\n}\n\nlet lordByron = Person.create({ children: [] });\n\nlordByron.minChildAge; // Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.minChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.minChildAge; // 5
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe min of a list of Date objects will be the lowest timestamp as a Number.\nThis behavior is consistent with Math.min.

\n", + "itemtype": "method", + "name": "min", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the smallest value in the dependentKey's array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 220, + "description": "

Returns an array mapped via the callback

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function mapCallback(item, index);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', function(chore, index) {\n    return `${chore.toUpperCase()}!`;\n  })\n  excitingChores;\n});\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n

You can optionally pass an array of additional dependent keys as the second\nparameter to the macro, if your map function relies on any external values:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  shouldUpperCase = false;\n\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', ['shouldUpperCase'], function(chore, index) {\n    if (this.shouldUpperCase) {\n      return `${chore.toUpperCase()}!`;\n    } else {\n      return `${chore}!`;\n    }\n  })\n  excitingChores;\n}\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['clean!', 'write more unit tests!']\n\nset(hamster, 'shouldUpperCase', true);\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional\ndependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "an array mapped via the callback", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 321, + "description": "

Returns an array mapped to the specified key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import { set } from '@ember/object';\nimport { mapBy } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n}\n\nlet lordByron = new Person();\n\nlordByron.childAges; // []\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.childAges; // [7]\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.childAges; // [7, 5, 8]
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "an array mapped to the specified key", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 388, + "description": "

Filters the array by the callback.

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
  • array is the dependant array itself.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function filterCallback(item, index, array);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = Hamster.create([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]
\n
\n
\n \n

You can also use @each.property in your dependent key, the callback will\nstill use the underlying array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores.@each.done', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n\nset(hamster.chores[2], 'done', true);\nhamster.remainingChores; // []
\n
\n
\n \n

Finally, you can optionally pass an array of additional dependent keys as the\nsecond parameter to the macro, if your filter function relies on any external\nvalues:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  doneKey = 'finished';\n\n  @filter('chores', ['doneKey'], function(chore, index, array) {\n    return !chore[this.doneKey];\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', finished: true },\n  { name: 'clean', finished: true },\n  { name: 'write more unit tests', finished: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', finished: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional dependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 519, + "description": "

Filters the array by the property and value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { filterBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filterBy('chores', 'done', false) remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{ name: 'write more unit tests', done: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "*" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 575, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniq } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniq('fruits') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  'banana',\n  'grape',\n  'kale',\n  'banana'\n]);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale']
\n
\n
\n \n", + "itemtype": "method", + "name": "uniq", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 641, + "description": "

A computed property which returns a new array with all the unique elements\nfrom an array, with uniqueness determined by specific key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniqBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniqBy('fruits', 'id') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  { id: 1, 'banana' },\n  { id: 2, 'grape' },\n  { id: 3, 'peach' },\n  { id: 1, 'banana' }\n]);\n\nhamster.uniqueFruits; // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 695, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { union } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits, vegetables) {\n    set(this, 'fruits', fruits);\n    set(this, 'vegetables', vegetables);\n  }\n\n  @union('fruits', 'vegetables') uniqueFruits;\n});\n\nlet hamster = new, Hamster(\n  [\n    'banana',\n    'grape',\n    'kale',\n    'banana',\n    'tomato'\n  ],\n  [\n    'tomato',\n    'carrot',\n    'lettuce'\n  ]\n);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale', 'tomato', 'carrot', 'lettuce']
\n
\n
\n \n", + "itemtype": "method", + "name": "union", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the unique elements\nfrom one or more dependent arrays.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 742, + "description": "

A computed property which returns a new array with all the elements\ntwo or more dependent arrays have in common.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { intersect } from '@ember/object/computed';\n\nclass FriendGroups {\n  constructor(adaFriends, charlesFriends) {\n    set(this, 'adaFriends', adaFriends);\n    set(this, 'charlesFriends', charlesFriends);\n  }\n\n  @intersect('adaFriends', 'charlesFriends') friendsInCommon;\n}\n\nlet groups = new FriendGroups(\n  ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n  ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock']\n);\n\ngroups.friendsInCommon; // ['William King', 'Mary Somerville']
\n
\n
\n \n", + "itemtype": "method", + "name": "intersect", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the duplicated\nelements from the dependent arrays", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 816, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array that are not in the second dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { setDiff } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(likes, fruits) {\n    set(this, 'likes', likes);\n    set(this, 'fruits', fruits);\n  }\n\n  @setDiff('likes', 'fruits') wants;\n}\n\nlet hamster = new Hamster(\n  [\n    'banana',\n    'grape',\n    'kale'\n  ],\n  [\n    'grape',\n    'kale',\n  ]\n);\n\nhamster.wants; // ['banana']
\n
\n
\n \n", + "itemtype": "method", + "name": "setDiff", + "static": 1, + "params": [ + { + "name": "setAProperty", + "description": "", + "type": "String" + }, + { + "name": "setBProperty", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the items from the\nfirst dependent array that are not in the second dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 886, + "description": "

A computed property that returns the array of values for the provided\ndependent properties.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { collect } from '@ember/object/computed';\n\nclass Hamster {\n  @collect('hat', 'shirt') clothes;\n}\n\nlet hamster = new Hamster();\n\nhamster.clothes; // [null, null]\n\nset(hamster, 'hat', 'Camp Hat');\nset(hamster, 'shirt', 'Camp Shirt');\nhamster.clothes; // ['Camp Hat', 'Camp Shirt']
\n
\n
\n \n", + "itemtype": "method", + "name": "collect", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which maps values of all passed\nin properties to an array.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 937, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array sorted based on a property or sort function. The sort\nmacro can be used in two different ways:

\n
    \n
  1. By providing a sort callback function
  2. \n
  3. By providing an array of keys to sort the array
  4. \n
\n

In the first form, the callback method you provide should have the following\nsignature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function sortCallback(itemA, itemB);
\n
\n
\n \n
    \n
  • itemA the first item to compare.
  • \n
  • itemB the second item to compare.
  • \n
\n

This function should return negative number (e.g. -1) when itemA should\ncome before itemB. It should return positive number (e.g. 1) when itemA\nshould come after itemB. If the itemA and itemB are equal this function\nshould return 0.

\n

Therefore, if this function is comparing some numeric values, simple itemA - itemB or itemA.get( 'foo' ) - itemB.get( 'foo' ) can be used instead of\nseries of if.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', function(a, b){\n    if (a.priority > b.priority) {\n      return 1;\n    } else if (a.priority < b.priority) {\n      return -1;\n    }\n\n    return 0;\n  })\n  priorityTodos;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

You can also optionally pass an array of additional dependent keys as the\nsecond parameter, if your sort function is dependent on additional values that\ncould changes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n
import EmberObject, { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  sortKey = 'priority';\n\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', ['sortKey'], function(a, b){\n    if (a[this.sortKey] > b[this.sortKey]) {\n      return 1;\n    } else if (a[this.sortKey] < b[this.sortKey]) {\n      return -1;\n    }\n\n    return 0;\n  })\n  sortedTodos;\n});\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

In the second form, you should provide the key of the array of sort values as\nthe second parameter:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using standard ascending sort\n  todosSorting = ['name'];\n  @sort('todos', 'todosSorting') sortedTodos;\n\n  // using descending sort\n  todosSortingDesc = ['name:desc'];\n  @sort('todos', 'todosSortingDesc') sortedTodosDesc;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.sortedTodos; // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\ntodoList.sortedTodosDesc; // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n", + "itemtype": "method", + "name": "sort", + "static": 1, + "params": [ + { + "name": "itemsKey", + "description": "", + "type": "String" + }, + { + "name": "sortDefinitionOrDependentKeys", + "description": "The key of the sort definition (an array of sort properties),\nthe sort function, or an array of additional dependent keys", + "type": "String|Function|Array" + }, + { + "name": "sortDefinition", + "description": "the sort function (when used with additional dependent keys)", + "type": "Function?" + } + ], + "return": { + "description": "computes a new sorted array based on the sort\nproperty array or callback function", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/object/evented-88ca2b5a2f.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/object/evented-88ca2b5a2f.json new file mode 100644 index 000000000..a312f7b40 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/object/evented-88ca2b5a2f.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/object/evented", + "type": "class", + "attributes": { + "name": "@ember/object/evented", + "shortname": "@ember/object/evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 178, + "description": "

Define a property as a function that should be executed when\na specified event or events are triggered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\nimport { on } from '@ember/object/evented';\nimport { sendEvent } from '@ember/object/events';\n\nlet Job = EmberObject.extend({\n  logCompleted: on('completed', function() {\n    console.log('Job completed!');\n  })\n});\n\nlet job = Job.create();\n\nsendEvent(job, 'completed'); // Logs 'Job completed!'
\n
\n
\n \n", + "itemtype": "method", + "name": "on", + "static": 1, + "params": [ + { + "name": "eventNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the listener function, passed as last argument to on(...)", + "type": "Function" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/polyfills-483e90f840.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/polyfills-483e90f840.json new file mode 100644 index 000000000..05d533f9c --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/polyfills-483e90f840.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/polyfills", + "type": "class", + "attributes": { + "name": "@ember/polyfills", + "shortname": "@ember/polyfills", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/polyfills", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/polyfills/lib/assign.ts", + "line": 11, + "description": "

Copy properties from a source object to a target object. Source arguments remain unchanged.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assign } from '@ember/polyfills';\n\nvar a = { first: 'Yehuda' };\nvar b = { last: 'Katz' };\nvar c = { company: 'Other Company' };\nvar d = { company: 'Tilde Inc.' };\nassign(a, b, c, d); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' };
\n
\n
\n \n", + "itemtype": "method", + "name": "assign", + "params": [ + { + "name": "target", + "description": "The object to assign into", + "type": "Object" + }, + { + "name": "args", + "description": "The objects to copy properties from", + "type": "Object", + "multiple": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/polyfills", + "module": "@ember/polyfills" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/polyfills", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/runloop-e256b8d7f7.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/runloop-e256b8d7f7.json new file mode 100644 index 000000000..0da7add5a --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/runloop-e256b8d7f7.json @@ -0,0 +1,497 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/runloop", + "type": "class", + "attributes": { + "name": "@ember/runloop", + "shortname": "@ember/runloop", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/runloop", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/runloop/index.js", + "line": 74, + "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

Normally 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { run } from '@ember/runloop';\n\nrun(function() {\n  // code to be executed within a RunLoop\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "run", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "return value from invoking the passed function.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 106, + "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

Please note: This is not for normal usage, and should be used sparingly.

\n

If invoked when not within a run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { join } from '@ember/runloop';\n\njoin(function() {\n  // creates a new run-loop\n});
\n
\n
\n \n

Alternatively, if called within an existing run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "join", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Return value from invoking the passed function. Please note,\nwhen called within an existing loop, no return value is possible.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 154, + "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

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

Let'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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import 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
\n \n

In 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.

\n", + "itemtype": "method", + "name": "bind", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "returns a new function that will always have a particular context", + "type": "Function" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 241, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "begin", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 264, + "description": "

Ends a RunLoop. This must be called sometime after you call\nbegin() to flush any deferred actions. This is a lower-level way\nto use a RunLoop instead of using run().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "end", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 287, + "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

At 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "schedule", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'", + "type": "String" + }, + { + "name": "target", + "description": "target object to use as the context when invoking a method.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.", + "type": "String|Function" + }, + { + "name": "arguments*", + "description": "Optional arguments to be passed to the queued method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 342, + "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

You 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "later", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 376, + "description": "

Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling scheduleOnce with the "actions" queue.

\n", + "itemtype": "method", + "name": "once", + "static": 1, + "params": [ + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 396, + "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

Note that although you can pass optional arguments these will not be\nconsidered when looking for duplicates. New arguments will replace previous\ncalls.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Also note that for scheduleOnce to prevent additional calls, you need to\npass the same function instance. The following case works as expected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
function log() {\n  console.log('Logging only once');\n}\n\nfunction scheduleIt() {\n  scheduleOnce('actions', myContext, log);\n}\n\nscheduleIt();\nscheduleIt();
\n
\n
\n \n

But this other case will schedule the function multiple times:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { 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
\n \n

Available queues, and their order, can be found at queues

\n", + "itemtype": "method", + "name": "scheduleOnce", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'.", + "type": "String", + "optional": true + }, + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 472, + "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\nlater with a wait time of 1ms.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { 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
\n \n

Multiple 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

Note 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

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

One 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

The 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.

\n", + "itemtype": "method", + "name": "next", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 547, + "description": "

Cancels a scheduled item. Must be a value returned by later(),\nonce(), scheduleOnce(), next(), debounce(), or\nthrottle().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n
import {\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
\n
\n \n", + "itemtype": "method", + "name": "cancel", + "static": 1, + "params": [ + { + "name": "timer", + "description": "Timer object to cancel", + "type": "Object" + } + ], + "return": { + "description": "true if canceled or false/undefined if it wasn't found", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 618, + "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

This 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n \n

Immediate allows you to run the function immediately, but debounce\nother calls for this function until the wait time has elapsed. If\ndebounce 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "debounce", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to false.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.js", + "line": 696, + "description": "

Ensure that the target method is never called more frequently than\nthe specified spacing period. The target method is called immediately.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "throttle", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "spacing", + "description": "Number of milliseconds to space out requests.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to true.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/runloop/index.js", + "line": 31, + "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.

\n", + "itemtype": "property", + "name": "queues", + "type": "Array", + "default": "['actions', 'destroy']", + "access": "private", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/polyfills" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/runloop", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/service-254ef7a7c9.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/service-254ef7a7c9.json new file mode 100644 index 000000000..72cd139c5 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/service-254ef7a7c9.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/service", + "type": "class", + "attributes": { + "name": "@ember/service", + "shortname": "@ember/service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/service/index.ts", + "line": 13, + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + }, + { + "file": "packages/@ember/service/index.ts", + "line": 33, + "description": "

Creates a property that lazily looks up a service in the container. There are\nno restrictions as to what objects a service can be injected into.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service('auth') authManager;\n\n  model() {\n    return this.authManager.findCurrentUser();\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default Route.extend({\n  authManager: service('auth'),\n\n  model() {\n    return this.get('authManager').findCurrentUser();\n  }\n});
\n
\n
\n \n

This example will create an authManager property on the application route\nthat looks up the auth service in the container, making it easily accessible\nin the model hook.

\n", + "itemtype": "method", + "name": "service", + "static": 1, + "since": "4.1.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/test-4858798fd4.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/test-4858798fd4.json new file mode 100644 index 000000000..58b1aea06 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/test-4858798fd4.json @@ -0,0 +1,395 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/test", + "type": "class", + "attributes": { + "name": "@ember/test", + "shortname": "@ember/test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/test", + "namespace": "", + "methods": [ + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 51, + "description": "

This hook defers the readiness of the application, so that you can start\nthe app when your tests are ready to run. It also sets the router's\nlocation to 'none', so that the window's location will not be modified\n(preventing both accidental leaking of state between tests and interference\nwith your testing framework). setupForTesting should only be called after\nsetting a custom router class (for example App.Router = Router.extend().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.setupForTesting();
\n
\n
\n \n", + "itemtype": "method", + "name": "setupForTesting", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 90, + "description": "

This injects the test helpers into the helperContainer object. If an object is provided\nit will be used as the helperContainer. If helperContainer is not set it will default\nto window. If a function of the same name has already been defined it will be cached\n(so that it can be reset if the helper is removed with unregisterHelper or\nremoveTestHelpers).

\n

Any callbacks registered with onInjectHelpers will be called once the\nhelpers have been injected.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.injectTestHelpers();
\n
\n
\n \n", + "itemtype": "method", + "name": "injectTestHelpers", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 132, + "description": "

This removes all helpers that have been registered, and resets and functions\nthat were overridden by the helpers.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.removeTestHelpers();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "removeTestHelpers", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/helpers/current_path.js", + "line": 6, + "description": "

Returns the current path.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentPath(), 'some.path.index', "correct path was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentPath", + "return": { + "description": "The currently active path.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_route_name.js", + "line": 5, + "description": "

Returns the currently active route name.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
function validateRouteName() {\nequal(currentRouteName(), 'some.path', "correct route was transitioned into.");\n}\nvisit('/some/path').then(validateRouteName)
\n
\n
\n \n", + "itemtype": "method", + "name": "currentRouteName", + "return": { + "description": "The name of the currently active route.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_url.js", + "line": 6, + "description": "

Returns the current URL.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentURL(), '/some/path', "correct URL was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentURL", + "return": { + "description": "The currently active URL.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.js", + "line": 9, + "description": "

Resumes a test paused by pauseTest.

\n", + "itemtype": "method", + "name": "resumeTest", + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.js", + "line": 22, + "description": "

Pauses the current test - this is useful for debugging while testing or for test-driving.\nIt allows you to inspect the state of your application at any point.\nExample (The test will pause before clicking the button):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('/')\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

You may want to turn off the timeout before pausing.

\n

qunit (timeout available to use as of 2.4.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nassert.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

mocha (timeout happens automatically as of ember-mocha v0.14.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nthis.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n", + "since": "1.9.0", + "itemtype": "method", + "name": "pauseTest", + "return": { + "description": "A promise that will never resolve", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/visit.js", + "line": 3, + "description": "

Loads a route, sets up any controllers, and renders any templates associated\nwith the route as though a real user had triggered the route change while\nusing your app.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('posts/index').then(function() {\n  // assert something\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/wait.js", + "line": 9, + "description": "

Causes the run loop to process any pending events. This is used to ensure that\nany async operations from other helpers (or your assertions) have been processed.

\n

This is most often used as the return value for the helper functions (see 'click',\n'fillIn','visit',etc). However, there is a method to register a test helper which\nutilizes this method without the need to actually call wait() in your helpers.

\n

The wait helper is built into registerAsyncHelper by default. You will not need\nto return app.testHelpers.wait(); - the wait behavior is provided for you.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('loginUser', function(app, username, password) {\n  visit('secured/path/here')\n    .fillIn('#username', username)\n    .fillIn('#password', password)\n    .click('.submit');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "wait", + "params": [ + { + "name": "value", + "description": "The value to be returned.", + "type": "Object" + } + ], + "return": { + "description": "Promise that resolves to the passed value.", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/test/helpers.js", + "line": 8, + "description": "

registerHelper is used to register a test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

This helper can later be called without arguments because it will be\ncalled with app as the first parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nApp = Application.create();\nApp.injectTestHelpers();\nboot();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.js", + "line": 52, + "description": "

registerAsyncHelper is used to register an async test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerAsyncHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterAsyncHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

The advantage of an async helper is that it will not run\nuntil the last async helper has completed. All async helpers\nafter it will wait for it complete before running.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('deletePost', function(app, postId) {\n  click('.delete-' + postId);\n});\n\n// ... in your test\nvisit('/post/2');\ndeletePost(2);\nvisit('/post/3');\ndeletePost(3);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerAsyncHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.js", + "line": 105, + "description": "

Remove a previously added helper method.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { unregisterHelper } from '@ember/test';\n\nunregisterHelper('wait');
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregisterHelper", + "static": 1, + "params": [ + { + "name": "name", + "description": "The helper to remove.", + "type": "String" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.js", + "line": 7, + "description": "

This allows ember-testing to play nicely with other asynchronous\nevents, such as an application that is waiting for a CSS3\ntransition or an IndexDB transaction. The waiter runs periodically\nafter each async helper (i.e. click, andThen, visit, etc) has executed,\nuntil the returning result is truthy. After the waiters finish, the next async helper\nis executed and the process repeats.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(function() {\n  return myPendingTransactions() === 0;\n});
\n
\n
\n \n

The context argument allows you to optionally specify the this\nwith which your callback will be invoked.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(MyDB, MyDB.hasPendingTransactions);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.js", + "line": 55, + "description": "

unregisterWaiter is used to unregister a callback that was\nregistered with registerWaiter.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "unregisterWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.js", + "line": 83, + "description": "

Iterates through each registered test waiter, and invokes\nits callback. If any waiter returns false, this method will return\ntrue indicating that the waiters have not settled yet.

\n

This is generally used internally from the acceptance/integration test\ninfrastructure.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "checkWaiters", + "class": "@ember/test", + "module": "@ember/test" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 10, + "description": "

This property contains the testing helpers for the current application. These\nare created once you call injectTestHelpers on your Application\ninstance. The included helpers are also available on the window object by\ndefault, but can be used from this object on the individual application also.

\n", + "itemtype": "property", + "name": "testHelpers", + "type": "{Object}", + "default": "{}", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 23, + "description": "

This property will contain the original methods that were registered\non the helperContainer before injectTestHelpers is called.

\n

When removeTestHelpers is called, these methods are restored to the\nhelperContainer.

\n", + "itemtype": "property", + "name": "originalMethods", + "type": "{Object}", + "default": "{}", + "access": "private", + "tagname": "", + "since": "1.3.0", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 38, + "description": "

This property indicates whether or not this application is currently in\ntesting mode. This is set when setupForTesting is called on the current\napplication.

\n", + "itemtype": "property", + "name": "testing", + "type": "{Boolean}", + "default": "false", + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 78, + "description": "

This will be used as the container to inject the test helpers into. By\ndefault the helpers are injected into window.

\n", + "itemtype": "property", + "name": "helperContainer", + "type": "{Object} The object to be used for test helpers.", + "default": "window", + "since": "1.2.0", + "access": "private", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/test", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/utils-8480194c33.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/utils-8480194c33.json new file mode 100644 index 000000000..a8411ead1 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@ember/utils-8480194c33.json @@ -0,0 +1,213 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/utils", + "type": "class", + "attributes": { + "name": "@ember/utils", + "shortname": "@ember/utils", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/utils", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/is_blank.ts", + "line": 5, + "description": "

A value is blank if it is empty or a whitespace string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import { isBlank } from '@ember/utils';\n\nisBlank();                // true\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
\n
\n \n", + "itemtype": "method", + "name": "isBlank", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_empty.ts", + "line": 5, + "description": "

Verifies that a value is null or undefined, an empty string, or an empty\narray.

\n

Constrains the rules on isNone by returning true for empty strings and\nempty arrays.

\n

If the value is an object with a size property of type number, it is used\nto check emptiness.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
isEmpty();                 // true\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
\n
\n \n", + "itemtype": "method", + "name": "isEmpty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_none.ts", + "line": 4, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
isNone();              // true\nisNone(null);          // true\nisNone(undefined);     // true\nisNone('');            // false\nisNone([]);            // false\nisNone(function() {}); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isNone", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_present.ts", + "line": 5, + "description": "

A value is present if it not isBlank.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
isPresent();                // false\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
\n
\n \n", + "itemtype": "method", + "name": "isPresent", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.8.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/compare.js", + "line": 44, + "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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { compare } from '@ember/utils';\n\ncompare('hello', 'hello');  // 0\ncompare('abc', 'dfg');      // -1\ncompare(2, 1);              // 1
\n
\n
\n \n

If 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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { compare } from '@ember/utils';\n\ncompare('hello', 50);       // 1\ncompare(50, 'hello');       // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "compare", + "static": 1, + "params": [ + { + "name": "v", + "description": "First value to compare", + "type": "Object" + }, + { + "name": "w", + "description": "Second value to compare", + "type": "Object" + } + ], + "return": { + "description": "-1 if v < w, 0 if v = w and 1 if v > w.", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/is-equal.js", + "line": 4, + "description": "

Compares two objects, returning true if they are equal.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { isEqual } from '@ember/utils';\n\nisEqual('hello', 'hello');                   // true\nisEqual(1, 2);                               // false
\n
\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Due 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { isEqual } from '@ember/utils';\n\nisEqual([4, 2], [4, 2]);                     // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEqual", + "static": 1, + "params": [ + { + "name": "a", + "description": "first object to compare", + "type": "Object" + }, + { + "name": "b", + "description": "second object to compare", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/type-of.js", + "line": 24, + "description": "

Returns a consistent type for the passed object.

\n

Use 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\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
\n
\n \n

Examples:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "typeOf", + "params": [ + { + "name": "item", + "description": "the item to check" + } + ], + "return": { + "description": "the type", + "type": "String" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/utils", + "module": "@ember/utils" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/utils", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@glimmer/tracking-dc2a3e521f.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@glimmer/tracking-dc2a3e521f.json new file mode 100644 index 000000000..ea4a034ca --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@glimmer/tracking-dc2a3e521f.json @@ -0,0 +1,53 @@ +{ + "data": { + "id": "ember-4.3.0-@glimmer/tracking", + "type": "class", + "attributes": { + "name": "@glimmer/tracking", + "shortname": "@glimmer/tracking", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 14, + "description": "

Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are static, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>Count: {{this.count}}</div>\n<div>Times Ten: {{this.timesTen}}</div>\n<div>\n  <button {{on "click" this.plusOne}}>\n    Plus One\n  </button>\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class CounterComponent extends Component {\n  @tracked count = 0;\n\n  get timesTen() {\n    return this.count * 10;\n  }\n\n  @action\n  plusOne() {\n    this.count += 1;\n  }\n}
\n
\n
\n \n

Both the {{this.count}} and the {{this.timesTen}} properties in the\ntemplate will update whenever the button is clicked. Any tracked properties\nthat are used in any way to calculate a value that is used in the template\nwill cause a rerender when updated - this includes through method calls and\nother means:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nclass Entry {\n  @tracked name;\n  @tracked phoneNumber;\n\n  constructor(name, phoneNumber) {\n    this.name = name;\n    this.phoneNumber = phoneNumber;\n  }\n}\n\nexport default class PhoneBookComponent extends Component {\n  entries = [\n    new Entry('Pizza Palace', 5551234),\n    new Entry('1st Street Cleaners', 5554321),\n    new Entry('Plants R Us', 5552468),\n  ];\n\n  // Any usage of this property will update whenever any of the names in the\n  // entries arrays are updated\n  get names() {\n    return this.entries.map(e => e.name);\n  }\n\n  // Any usage of this property will update whenever any of the numbers in the\n  // entries arrays are updated\n  get numbers() {\n    return this.getFormattedNumbers();\n  }\n\n  getFormattedNumbers() {\n    return this.entries\n      .map(e => e.phoneNumber)\n      .map(number => {\n        let numberString = '' + number;\n\n        return numberString.slice(0, 3) + '-' + numberString.slice(3);\n      });\n  }\n}
\n
\n
\n \n

It's important to note that setting tracked properties will always trigger an\nupdate, even if the property is set to the same value as it was before.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let entry = new Entry('Pizza Palace', 5551234);\n\n// if entry was used when rendering, this would cause a rerender, even though\n// the name is being set to the same value as it was before\nentry.name = entry.name;
\n
\n
\n \n

tracked can also be used with the classic Ember object model in a similar\nmanner to classic computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked(),\n  phoneNumber: tracked()\n});
\n
\n
\n \n

Often this is unnecessary, but to ensure robust auto-tracking behavior it is\nadvisable to mark tracked state appropriately wherever possible.

\n

This form of tracked also accepts an optional configuration object\ncontaining either an initial value or an initializer function (but not\nboth).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked({ value: 'Zoey' }),\n  favoriteSongs: tracked({\n    initializer: () => ['Raspberry Beret', 'Time After Time']\n  })\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "tracked", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@glimmer/tracking", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-@glimmer/tracking/primitives/cache-dc71d3587c.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-@glimmer/tracking/primitives/cache-dc71d3587c.json new file mode 100644 index 000000000..4171393a6 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-@glimmer/tracking/primitives/cache-dc71d3587c.json @@ -0,0 +1,77 @@ +{ + "data": { + "id": "ember-4.3.0-@glimmer/tracking/primitives/cache", + "type": "class", + "attributes": { + "name": "@glimmer/tracking/primitives/cache", + "shortname": "@glimmer/tracking/primitives/cache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking/primitives/cache", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 14, + "description": "

Receives a function, and returns a wrapped version of it that memoizes based on\nautotracking. The function will only rerun whenever any tracked values used\nwithin it have changed. Otherwise, it will return the previous value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state. Now, `counter` will\n  // only rerun if `state.value` changes.\n  state.value;\n\n  return ++computeCount;\n});\n\ngetValue(counter); // 1\n\n// returns the same value because no tracked state has changed\ngetValue(counter); // 1\n\nstate.value = 'foo';\n\n// reruns because a tracked value used in the function has changed,\n// incermenting the counter\ngetValue(counter); // 2
\n
\n
\n \n", + "itemtype": "method", + "name": "createCache", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 56, + "description": "

Gets the value of a cache created with createCache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  return ++computeCount;\n});\n\ngetValue(counter); // 1
\n
\n
\n \n", + "itemtype": "method", + "name": "getValue", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 78, + "description": "

Can be used to check if a memoized function is constant. If no tracked state\nwas used while running a memoized function, it will never rerun, because nothing\ncan invalidate its result. isConst can be used to determine if a memoized\nfunction is constant or not, in order to optimize code surrounding that\nfunction.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue, isConst } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state\n  state.value;\n\n  return computeCount++;\n});\n\nlet constCounter = createCache(() => {\n  return computeCount++;\n});\n\ngetValue(counter);\ngetValue(constCounter);\n\nisConst(counter); // false\nisConst(constCounter); // true
\n
\n
\n \n

If called on a cache that hasn't been accessed yet, it will throw an\nerror. This is because there's no way to know if the function will be constant\nor not yet, and so this helps prevent missing an optimization opportunity on\naccident.

\n", + "itemtype": "method", + "name": "isConst", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@glimmer/tracking/primitives/cache", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Application-6e2c620443.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Application-6e2c620443.json new file mode 100644 index 000000000..83826527d --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Application-6e2c620443.json @@ -0,0 +1,802 @@ +{ + "data": { + "id": "ember-4.3.0-Application", + "type": "class", + "attributes": { + "name": "Application", + "shortname": "Application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/lib/application.js", + "line": 30, + "description": "

An instance of Application is the starting point for every Ember\napplication. It instantiates, initializes and coordinates the\nobjects that make up your app.

\n

Each Ember app has one and only one Application object. Although\nEmber CLI creates this object implicitly, the Application class\nis defined in the app/app.js. You can define a ready method on the\nApplication class, which will be run by Ember when the application is\ninitialized.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
const App = Application.extend({\n  ready() {\n    // your code here\n  }\n})
\n
\n
\n \n

Because Application ultimately inherits from Ember.Namespace, any classes\nyou create will have useful string representations when calling toString().\nSee the Ember.Namespace documentation for more information.

\n

While you can think of your Application as a container that holds the\nother classes in your application, there are several other responsibilities\ngoing on under-the-hood that you may want to understand. It is also important\nto understand that an Application is different from an ApplicationInstance.\nRefer to the Guides to understand the difference between these.

\n

Event Delegation

\n

Ember uses a technique called event delegation. This allows the framework\nto set up a global, shared event listener instead of requiring each view to\ndo it manually. For example, instead of each view registering its own\nmousedown listener on its associated element, Ember sets up a mousedown\nlistener on the body.

\n

If a mousedown event occurs, Ember will look at the target of the event and\nstart walking up the DOM node tree, finding corresponding views and invoking\ntheir mouseDown method as it goes.

\n

Application has a number of default events that it listens for, as\nwell as a mapping from lowercase events to camel-cased view method names. For\nexample, the keypress event causes the keyPress method on the view to be\ncalled, the dblclick event causes doubleClick to be called, and so on.

\n

If there is a bubbling browser event that Ember does not listen for by\ndefault, you can specify custom events and their corresponding view method\nnames by setting the application's customEvents property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // add support for the paste event\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent Ember from setting up a listener for a default event,\nspecify the event name with a null value in the customEvents\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // prevent listeners for mouseenter/mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n

By default, the application sets up these event listeners on the document\nbody. However, in cases where you are embedding an Ember application inside\nan existing page, you may want it to set up the listeners on an element\ninside the body.

\n

For example, if only events inside a DOM element with the ID of ember-app\nshould be delegated, set your application's rootElement property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  rootElement: '#ember-app'\n});
\n
\n
\n \n

The rootElement can be either a DOM element or a CSS selector\nstring. Note that views appended to the DOM outside the root element will\nnot receive events. If you specify a custom root element, make sure you only\nappend views inside it!

\n

To learn more about the events Ember components use, see

\n

components/handling-events.

\n

Initializers

\n

To add behavior to the Application's boot process, you can define initializers in\nthe app/initializers directory, or with ember generate initializer using Ember CLI.\nThese files should export a named initialize function which will receive the created application\nobject as its first argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
export function initialize(application) {\n  // application.inject('route', 'foo', 'service:foo');\n}
\n
\n
\n \n

Application initializers can be used for a variety of reasons including:

\n
    \n
  • setting up external libraries
  • \n
  • injecting dependencies
  • \n
  • setting up event listeners in embedded apps
  • \n
  • deferring the boot process using the deferReadiness and advanceReadiness APIs.
  • \n
\n

Routing

\n

In addition to creating your application's router, Application is\nalso responsible for telling the router when to start routing. Transitions\nbetween routes can be logged with the LOG_TRANSITIONS flag, and more\ndetailed intra-transition logging can be logged with\nthe LOG_TRANSITIONS_INTERNAL flag:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  LOG_TRANSITIONS: true, // basic logging of successful transitions\n  LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n});
\n
\n
\n \n

By default, the router will begin trying to translate the current URL into\napplication state once the browser emits the DOMContentReady event. If you\nneed to defer routing, you can call the application's deferReadiness()\nmethod. Once routing can begin, call the advanceReadiness() method.

\n

If there is any setup required before routing begins, you can implement a\nready() method on your app that will be invoked immediately before routing\nbegins.

\n", + "extends": "Engine", + "uses": [ + "RegistryProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/application/lib/application.js", + "line": 376, + "description": "

Create an ApplicationInstance for this application.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the application instance", + "type": "ApplicationInstance" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 399, + "description": "

Start tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is created.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_watchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 410, + "description": "

Stop tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is about to be destroyed.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_unwatchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 421, + "description": "

Enable the legacy globals mode by allowing this application to act\nas a global namespace. See the docs on the _globalsMode property\nfor details.

\n

Most of these features are already deprecated in 1.x, so we can\nstop using them internally and try to remove them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareForGlobalsMode", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 465, + "description": "

Automatically kick-off the boot process for the application once the\nDOM has become ready.

\n

The initialization itself is scheduled on the actions queue which\nensures that code-loading finishes before booting.

\n

If you are asynchronously loading code, you should call deferReadiness()\nto defer booting, and then call advanceReadiness() once all of your code\nhas finished loading.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "waitForDOMReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 492, + "description": "

This is the autoboot flow:

\n
    \n
  1. Boot the app by calling this.boot()
  2. \n
  3. Create an instance (or use the __deprecatedInstance__ in globals mode)
  4. \n
  5. Boot the instance by calling instance.boot()
  6. \n
  7. Invoke the App.ready() callback
  8. \n
  9. Kick-off routing on the instance
  10. \n
\n

Ideally, this is all we would need to do:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
_autoBoot() {\n  this.boot().then(() => {\n    let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance();\n    return instance.boot();\n  }).then((instance) => {\n    App.ready();\n    instance.startRouting();\n  });\n}
\n
\n
\n \n

Unfortunately, we cannot actually write this because we need to participate\nin the "synchronous" boot process. While the code above would work fine on\nthe initial boot (i.e. DOM ready), when App.reset() is called, we need to\nboot a new instance synchronously (see the documentation on _bootSync()\nfor details).

\n

Because of this restriction, the actual logic of this method is located\ninside didBecomeReady().

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "domReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 537, + "description": "

Use this to defer readiness until some condition is true.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Application from '@ember/application';\n\nlet App = Application.create();\n\nApp.deferReadiness();\n\nfetch('/auth-token')\n.then(response => response.json())\n.then(data => {\n  App.token = data.token;\n  App.advanceReadiness();\n});
\n
\n
\n \n

This allows you to perform asynchronous setup logic and defer\nbooting your application until the setup has finished.

\n

However, if the setup requires a loading UI, it might be better\nto use the router for this purpose.

\n", + "itemtype": "method", + "name": "deferReadiness", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 587, + "description": "

Call advanceReadiness after any asynchronous setup logic has completed.\nEach call to deferReadiness must be matched by a call to advanceReadiness\nor the application will never become ready and routing will not begin.

\n", + "itemtype": "method", + "name": "advanceReadiness", + "see": [ + "{Application#deferReadiness}" + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 624, + "description": "

Initialize the application and return a promise that resolves with the Application\nobject when the boot process is complete.

\n

Run any application initializers and run the application load hook. These hooks may\nchoose to defer readiness. For example, an authentication hook might want to defer\nreadiness until the auth token has been retrieved.

\n

By default, this method is called automatically on "DOM ready"; however, if autoboot\nis disabled, this is automatically called when the first application instance is\ncreated via visit.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 701, + "description": "

Reset the application. This is typically used only in tests. It cleans up\nthe application in the following order:

\n
    \n
  1. Deactivate existing routes
  2. \n
  3. Destroy all objects in the container
  4. \n
  5. Create a new application container
  6. \n
  7. Re-route to the existing url
  8. \n
\n

Typical Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    App.reset();\n  }\n});\n\ntest('first test', function() {\n  // App is freshly reset\n});\n\ntest('second test', function() {\n  // App is again freshly reset\n});
\n
\n
\n \n

Advanced Example:

\n

Occasionally you may want to prevent the app from initializing during\nsetup. This could enable extra configuration, or enable asserting prior\nto the app becoming ready.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    run(function() {\n      App.reset();\n      App.deferReadiness();\n    });\n  }\n});\n\ntest('first test', function() {\n  ok(true, 'something before app is initialized');\n\n  run(function() {\n    App.advanceReadiness();\n  });\n\n  ok(true, 'something after app is initialized');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reset", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 804, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "didBecomeReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 879, + "description": "

Boot a new instance of ApplicationInstance for the current\napplication and navigate it to the given url. Returns a Promise that\nresolves with the instance when the initial routing and rendering is\ncomplete, or rejects with any error that occurred during the boot process.

\n

When autoboot is disabled, calling visit would first cause the\napplication to boot, which runs the application initializers.

\n

This method also takes a hash of boot-time configuration options for\ncustomizing the instance's behavior. See the documentation on\nApplicationInstance.BootOptions for details.

\n

ApplicationInstance.BootOptions is an interface class that exists\npurely to document the available options; you do not need to construct it\nmanually. Simply pass a regular JavaScript object containing of the\ndesired options:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Supported Scenarios

\n

While the BootOptions class exposes a large number of knobs, not all\ncombinations of them are valid; certain incompatible combinations might\nresult in unexpected behavior.

\n

For example, booting the instance in the full browser environment\nwhile specifying a foreign document object (e.g. { isBrowser: true, document: iframe.contentDocument }) does not work correctly today,\nlargely due to Ember's jQuery dependency.

\n

Currently, there are three officially supported scenarios/configurations.\nUsages outside of these scenarios are not guaranteed to work, but please\nfeel free to file bug reports documenting your experience and any issues\nyou encountered to help expand support.

\n

Browser Applications (Manual Boot)

\n

The setup is largely similar to how Ember works out-of-the-box. Normally,\nEmber will boot a default instance for your Application on "DOM ready".\nHowever, you can customize this behavior by disabling autoboot.

\n

For example, this allows you to render a miniture demo of your application\ninto a specific area on your marketing website:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let options = {\n    // Override the router's location adapter to prevent it from updating\n    // the URL in the address bar\n    location: 'none',\n\n    // Override the default `rootElement` on the app to render into a\n    // specific `div` on the page\n    rootElement: '#demo'\n  };\n\n  // Start the app at the special demo URL\n  App.visit('/demo', options);\n});
\n
\n
\n \n

Or perhaps you might want to boot two instances of your app on the same\npage for a split-screen multiplayer experience:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let sessionId = MyApp.generateSessionID();\n\n  let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' });\n  let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' });\n\n  Promise.all([player1, player2]).then(() => {\n    // Both apps have completed the initial render\n    $('#loading').fadeOut();\n  });\n});
\n
\n
\n \n

Do note that each app instance maintains their own registry/container, so\nthey will run in complete isolation by default.

\n

Server-Side Rendering (also known as FastBoot)

\n

This setup allows you to run your Ember app in a server environment using\nNode.js and render its content into static HTML for SEO purposes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap);\n\nfunction renderURL(url) {\n  let dom = new SimpleDOM.Document();\n  let rootElement = dom.body;\n  let options = { isBrowser: false, document: dom, rootElement: rootElement };\n\n  return MyApp.visit(options).then(instance => {\n    try {\n      return HTMLSerializer.serialize(rootElement.firstChild);\n    } finally {\n      instance.destroy();\n    }\n  });\n}
\n
\n
\n \n

In this scenario, because Ember does not have access to a global document\nobject in the Node.js environment, you must provide one explicitly. In practice,\nin the non-browser environment, the stand-in document object only needs to\nimplement a limited subset of the full DOM API. The SimpleDOM library is known\nto work.

\n

Since there is no DOM access in the non-browser environment, you must also\nspecify a DOM Element object in the same document for the rootElement option\n(as opposed to a selector string like "body").

\n

See the documentation on the isBrowser, document and rootElement properties\non ApplicationInstance.BootOptions for details.

\n

Server-Side Resource Discovery

\n

This setup allows you to run the routing layer of your Ember app in a server\nenvironment using Node.js and completely disable rendering. This allows you\nto simulate and discover the resources (i.e. AJAX requests) needed to fulfill\na given request and eagerly "push" these resources to the client.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
service.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import BrowserNetworkService from 'app/services/network/browser';\nimport NodeNetworkService from 'app/services/network/node';\n\n// Inject a (hypothetical) service for abstracting all AJAX calls and use\n// the appropriate implementation on the client/server. This also allows the\n// server to log all the AJAX calls made during a particular request and use\n// that for resource-discovery purpose.\n\nexport function initialize(application) {\n  if (window) { // browser\n    application.register('service:network', BrowserNetworkService);\n  } else { // node\n    application.register('service:network', NodeNetworkService);\n  }\n};\n\nexport default {\n  name: 'network-service',\n  initialize: initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\n// An example of how the (hypothetical) service is used in routes.\n\nexport default class IndexRoute extends Route {\n  @service network;\n\n  model(params) {\n    return this.network.fetch(`/api/posts/${params.post_id}.json`);\n  }\n\n  afterModel(post) {\n    if (post.isExternalContent) {\n      return this.network.fetch(`/api/external/?url=${post.externalURL}`);\n    } else {\n      return post;\n    }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
// Finally, put all the pieces together\n\nfunction discoverResourcesFor(url) {\n  return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => {\n    let networkService = instance.lookup('service:network');\n    return networkService.requests; // => { "/api/posts/123.json": "..." }\n  });\n}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "The initial URL to navigate to", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "ApplicationInstance.BootOptions" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 1100, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 61, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 74, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 87, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 100, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 108, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 116, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 127, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 158, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 305, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 378, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 427, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Namespace" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 18, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 31, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 101, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 124, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 134, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 145, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 155, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 165, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 198, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 208, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + } + ], + "events": [ + { + "file": "packages/@ember/application/lib/application.js", + "line": 854, + "description": "

Called when the Application has become ready, immediately before routing\nbegins. The call will be delayed until the DOM has become ready.

\n", + "itemtype": "event", + "name": "ready", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + } + ], + "properties": [ + { + "file": "packages/@ember/application/lib/application.js", + "line": 185, + "description": "

The root DOM element of the Application. This can be specified as an\nelement or a selector string.

\n

This is the element that will be passed to the Application's,\neventDispatcher, which sets up the listeners for event delegation. Every\nview in your application should be a child of the element you specify here.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 200, + "itemtype": "property", + "name": "_document", + "type": "Document | null", + "default": "'window.document'", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 209, + "description": "

The Ember.EventDispatcher responsible for delegating events to this\napplication's views.

\n

The event dispatcher is created by the application at initialization time\nand sets up event listeners on the DOM element described by the\napplication's rootElement property.

\n

See the documentation for Ember.EventDispatcher for more information.

\n", + "itemtype": "property", + "name": "eventDispatcher", + "type": "Ember.EventDispatcher", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 226, + "description": "

The DOM events for which the event dispatcher should listen.

\n

By default, the application's Ember.EventDispatcher listens\nfor a set of standard DOM events, such as mousedown and\nkeyup, and delegates them to your application's Ember.View\ninstances.

\n

If you would like additional bubbling events to be delegated to your\nviews, set your Application's customEvents property\nto a hash containing the DOM event name as the key and the\ncorresponding view method name as the value. Setting an event to\na value of null will prevent a default event listener from being\nadded for that event.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // add support for the paste event\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // remove support for mouseenter / mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "customEvents", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 274, + "description": "

Whether the application should automatically start routing and render\ntemplates to the rootElement on DOM ready. While default by true,\nother environments such as FastBoot or a testing harness can set this\nproperty to false and control the precise timing and behavior of the boot\nprocess.

\n", + "itemtype": "property", + "name": "autoboot", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 288, + "description": "

Whether the application should be configured for the legacy "globals mode".\nUnder this mode, the Application object serves as a global namespace for all\nclasses.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Application from '@ember/application';\nimport Component from '@ember/component';\n\nlet App = Application.create({\n  ...\n});\n\nApp.Router.reopen({\n  location: 'none'\n});\n\nApp.Router.map({\n  ...\n});\n\nApp.MyComponent = Component.extend({\n  ...\n});
\n
\n
\n \n

This flag also exposes other internal APIs that assumes the existence of\na special "default instance", like App.__container__.lookup(...).

\n

This option is currently not configurable, its value is derived from\nthe autoboot flag – disabling autoboot also implies opting-out of\nglobals mode support, although they are ultimately orthogonal concerns.

\n

Some of the global modes features are already deprecated in 1.x. The\nexistence of this flag is to untangle the globals mode code paths from\nthe autoboot code paths, so that these legacy features can be reviewed\nfor deprecation/removal separately.

\n

Forcing the (autoboot=true, _globalsMode=false) here and running the tests\nwould reveal all the places where we are still relying on these legacy\nbehavior internally (mostly just tests).

\n", + "itemtype": "property", + "name": "_globalsMode", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.js", + "line": 337, + "description": "

An array of application instances created by buildInstance(). Used\ninternally to ensure that all instances get destroyed.

\n", + "itemtype": "property", + "name": "_applicationInstances", + "type": "Array", + "default": "null", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 53, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 418, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-Engine", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-ApplicationInstance-9ac6cb4a04.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-ApplicationInstance-9ac6cb4a04.json new file mode 100644 index 000000000..d43797a86 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-ApplicationInstance-9ac6cb4a04.json @@ -0,0 +1,1063 @@ +{ + "data": { + "id": "ember-4.3.0-ApplicationInstance", + "type": "class", + "attributes": { + "name": "ApplicationInstance", + "shortname": "ApplicationInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/instance.js", + "line": 10, + "description": "

The ApplicationInstance encapsulates all of the stateful aspects of a\nrunning Application.

\n

At a high-level, we break application boot into two distinct phases:

\n
    \n
  • Definition time, where all of the classes, templates, and other\ndependencies are loaded (typically in the browser).
  • \n
  • Run time, where we begin executing the application once everything\nhas loaded.
  • \n
\n

Definition time can be expensive and only needs to happen once since it is\nan idempotent operation. For example, between test runs and FastBoot\nrequests, the application stays the same. It is only the state that we want\nto reset.

\n

That state is what the ApplicationInstance manages: it is responsible for\ncreating the container that contains all application state, and disposing of\nit once the particular test run or FastBoot request has finished.

\n", + "access": "public", + "tagname": "", + "extends": "EngineInstance", + "methods": [ + { + "file": "packages/@ember/application/instance.js", + "line": 283, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 62, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 124, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 139, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 167, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 200, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 23, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 49, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 110, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 18, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 31, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 101, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 124, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 134, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 145, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 155, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 165, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 198, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 208, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.js", + "line": 36, + "description": "

The Application for which this is an instance.

\n", + "itemtype": "property", + "name": "application", + "type": "Application", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 44, + "description": "

The DOM events for which the event dispatcher should listen.

\n

By default, the application's Ember.EventDispatcher listens\nfor a set of standard DOM events, such as mousedown and\nkeyup, and delegates them to your application's Ember.View\ninstances.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "customEvents", + "type": "Object", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 57, + "description": "

The root DOM element of the Application as an element or a\nCSS selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "String|DOMElement", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 29, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 15, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-EngineInstance", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-ApplicationInstance.BootOptions-cccd41b1a3.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-ApplicationInstance.BootOptions-cccd41b1a3.json new file mode 100644 index 000000000..03275ba2a --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-ApplicationInstance.BootOptions-cccd41b1a3.json @@ -0,0 +1,143 @@ +{ + "data": { + "id": "ember-4.3.0-ApplicationInstance.BootOptions", + "type": "class", + "attributes": { + "name": "ApplicationInstance.BootOptions", + "shortname": "ApplicationInstance.BootOptions", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "ApplicationInstance", + "file": "packages/@ember/application/instance.js", + "line": 305, + "description": "

A list of boot-time configuration options for customizing the behavior of\nan ApplicationInstance.

\n

This is an interface class that exists purely to document the available\noptions; you do not need to construct it manually. Simply pass a regular\nJavaScript object containing the desired options into methods that require\none of these options object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Not all combinations of the supported options are valid. See the documentation\non Application#visit for the supported configurations.

\n

Internal, experimental or otherwise unstable flags are marked as private.

\n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.js", + "line": 329, + "description": "

Interactive mode: whether we need to set up event delegation and invoke\nlifecycle callbacks on Components.

\n", + "itemtype": "property", + "name": "isInteractive", + "type": "boolean", + "default": "auto-detected", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 340, + "itemtype": "property", + "name": "_renderMode", + "type": "string", + "default": "false", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 348, + "description": "

Run in a full browser environment.

\n

When this flag is set to false, it will disable most browser-specific\nand interactive features. Specifically:

\n
    \n
  • It does not use jQuery to append the root view; the rootElement\n(either specified as a subsequent option or on the application itself)\nmust already be an Element in the given document (as opposed to a\nstring selector).

    \n
  • \n
  • It does not set up an EventDispatcher.

    \n
  • \n
  • It does not run any Component lifecycle hooks (such as didInsertElement).

    \n
  • \n
  • It sets the location option to "none". (If you would like to use\nthe location adapter specified in the app's router instead, you can also\nspecify { location: null } to specifically opt-out.)

    \n
  • \n
\n", + "itemtype": "property", + "name": "isBrowser", + "type": "boolean", + "default": "auto-detected", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 383, + "description": "

Disable rendering completely.

\n

When this flag is set to false, it will disable the entire rendering\npipeline. Essentially, this puts the app into "routing-only" mode. No\ntemplates will be rendered, and no Components will be created.

\n", + "itemtype": "property", + "name": "shouldRender", + "type": "boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 405, + "description": "

If present, render into the given Document object instead of the\nglobal window.document object.

\n

In practice, this is only useful in non-browser environment or in\nnon-interactive mode, because Ember's jQuery dependency is\nimplicitly bound to the current document, causing event delegation\nto not work properly when the app is rendered into a foreign\ndocument object (such as an iframe's contentDocument).

\n

In non-browser mode, this could be a "Document-like" object as\nEmber only interact with a small subset of the DOM API in non-\ninteractive mode. While the exact requirements have not yet been\nformalized, the SimpleDOM library's implementation is known to\nwork.

\n", + "itemtype": "property", + "name": "document", + "type": "Document", + "default": "the global `document` object", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 432, + "description": "

If present, overrides the application's rootElement property on\nthe instance. This is useful for testing environment, where you\nmight want to append the root view to a fixture area.

\n

In non-browser mode, because Ember does not have access to jQuery,\nthis options must be specified as a DOM Element object instead of\na selector string.

\n

See the documentation on Application's rootElement for\ndetails.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "String|Element", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.js", + "line": 457, + "description": "

If present, overrides the router's location property with this\nvalue. This is useful for environments where trying to modify the\nURL would be inappropriate.

\n", + "itemtype": "property", + "name": "location", + "type": "string", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-ArrayProxy-ef54cc9b02.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-ArrayProxy-ef54cc9b02.json new file mode 100644 index 000000000..860b65ccf --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-ArrayProxy-ef54cc9b02.json @@ -0,0 +1,1833 @@ +{ + "data": { + "id": "ember-4.3.0-ArrayProxy", + "type": "class", + "attributes": { + "name": "ArrayProxy", + "shortname": "ArrayProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.js", + "line": 43, + "description": "

An ArrayProxy wraps any other object that implements Array and/or\nMutableArray, forwarding all requests. This makes it very useful for\na number of binding use cases or other cases where being able to swap\nout the underlying array is useful.

\n

A simple example of usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({ content: A(pets) });\n\nap.get('firstObject');                        // 'dog'\nap.set('content', ['amoeba', 'paramecium']);\nap.get('firstObject');                        // 'amoeba'
\n
\n
\n \n

This class can also be useful as a layer to transform the contents of\nan array, as they are accessed. This can be done by overriding\nobjectAtContent:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({\n    content: A(pets),\n    objectAtContent: function(idx) {\n        return this.get('content').objectAt(idx).toUpperCase();\n    }\n});\n\nap.get('firstObject'); // . 'DOG'
\n
\n
\n \n

When overriding this class, it is important to place the call to\n_super after setting content so the internal observers have\na chance to fire properly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nexport default ArrayProxy.extend({\n  init() {\n    this.set('content', A(['dog', 'cat', 'fish']));\n    this._super(...arguments);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.js", + "line": 150, + "description": "

Should actually retrieve the object at the specified index from the\ncontent. You can override this method in subclasses to transform the\ncontent item to something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "objectAtContent", + "params": [ + { + "name": "idx", + "description": "The index to retrieve.", + "type": "Number" + } + ], + "return": { + "description": "the value or undefined if none found", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.js", + "line": 176, + "description": "

Should actually replace the specified objects on the content array.\nYou can override this method in subclasses to transform the content item\ninto something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "replaceContent", + "params": [ + { + "name": "idx", + "description": "The starting index", + "type": "Number" + }, + { + "name": "amt", + "description": "The number of items to remove from the content.", + "type": "Number" + }, + { + "name": "objects", + "description": "Optional array of objects to insert or null if no\n objects.", + "type": "EmberArray" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1349, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray" + } + ], + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1368, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1394, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1416, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1441, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1461, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1481, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1507, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1532, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1552, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumberable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1573, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1592, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1619, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1647, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1664, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1690, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1117, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1155, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1167, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1183, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1216, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1260, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1279, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1301, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.js", + "line": 141, + "description": "

The content array. Must be an object that implements Array and/or\nMutableArray.

\n", + "itemtype": "property", + "name": "content", + "type": "EmberArray", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.js", + "line": 346, + "description": "

The array that the proxy pretends to be. In the default ArrayProxy\nimplementation, this and content are the same. Subclasses of ArrayProxy\ncan override this property to provide things like sorting and filtering.

\n", + "itemtype": "property", + "name": "arrangedContent", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Component-1ee9b7e1f0.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Component-1ee9b7e1f0.json new file mode 100644 index 000000000..01c4f5ca9 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Component-1ee9b7e1f0.json @@ -0,0 +1,1569 @@ +{ + "data": { + "id": "ember-4.3.0-Component", + "type": "class", + "attributes": { + "name": "Component", + "shortname": "Component", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 37, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault component's for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Classic components. If you are looking for the\nAPI documentation for Template-only or Glimmer components, it is\navailable here.

\n

Defining a Classic Component

\n

If you want to customize the component in order to handle events, transform\narguments or maintain internal state, you implement a subclass of Component.

\n

One example is to add computed properties to your component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  displayName: computed('person.title', 'person.firstName', 'person.lastName', function() {\n    let { title, firstName, lastName } = this.person;\n\n    if (title) {\n      return `${title} ${lastName}`;\n    } else {\n      return `${firstName} ${lastName}`;\n    }\n  })\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

Customizing a Classic Component's HTML Element in JavaScript

\n

HTML Tag

\n

The default HTML tag name used for a component's HTML representation is div.\nThis can be customized by setting the tagName property.

\n

Consider the following component class:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
paragraph.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'em'\n});
\n
\n
\n \n

When invoked, this component would produce output that looks something like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<em id="ember1" class="ember-view"></em>
\n
\n
\n \n

HTML class Attribute

\n

The HTML class attribute of a component's tag can be set by providing a\nclassNames property that is set to an array of strings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class']\n});
\n
\n
\n \n

Invoking this component will produce output that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class"></div>
\n
\n
\n \n

class attribute values can also be set by providing a classNameBindings\nproperty set to an array of properties names for the component. The return\nvalue of these properties will be added as part of the value for the\ncomponents's class attribute. These properties can be computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class'],\n  classNameBindings: ['propertyA', 'propertyB'],\n\n  propertyA: 'from-a',\n  propertyB: computed(function() {\n    if (someLogic) { return 'from-b'; }\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

Note that classNames and classNameBindings is in addition to the class\nattribute passed with the angle bracket invocation syntax. Therefore, if this\ncomponent was invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyWidget class="from-invocation" />
\n
\n
\n \n

The resulting HTML will look similar to this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="from-invocation ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

If the value of a class name binding returns a boolean the property name\nitself will be used as the class name if the property is true. The class name\nwill not be added if the value is false or undefined.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['hovered'],\n\n  hovered: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view hovered"></div>
\n
\n
\n \n

Custom Class Names for Boolean Values

\n

When using boolean class name bindings you can supply a string value other\nthan the property name for use as the class HTML attribute by appending the\npreferred value after a ":" character when defining the binding:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['awesome:so-very-cool'],\n\n  awesome: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view so-very-cool"></div>
\n
\n
\n \n

Boolean value class name bindings whose property names are in a\ncamelCase-style format will be converted to a dasherized format:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isUrgent'],\n\n  isUrgent: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view is-urgent"></div>
\n
\n
\n \n

Class name bindings can also refer to object values that are found by\ntraversing a path relative to the component itself:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport EmberObject from '@ember/object';\n\nexport default Component.extend({\n  classNameBindings: ['messages.empty'],\n\n  messages: EmberObject.create({\n    empty: true\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view empty"></div>
\n
\n
\n \n

If you want to add a class name for a property which evaluates to true and\nand a different class name if it evaluates to false, you can pass a binding\nlike this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isEnabled:enabled:disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view enabled"></div>
\n
\n
\n \n

When isEnabled is false, the resulting HTML representation looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

This syntax offers the convenience to add a class if a property is false:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\n// Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\nexport default Component.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component when the isEnabled property is true will produce\nHTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view"></div>
\n
\n
\n \n

Invoking it when the isEnabled property on the component is false will\nproduce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

Updates to the value of a class name binding will result in automatic update\nof the HTML class attribute in the component's rendered HTML\nrepresentation. If the value becomes false or undefined the class name\nwill be removed.

\n

Both classNames and classNameBindings are concatenated properties. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Other HTML Attributes

\n

The HTML attribute section of a component's tag can be set by providing an\nattributeBindings property set to an array of property names on the component.\nThe return value of these properties will be used as the value of the component's\nHTML associated attribute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['href'],\n\n  href: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

One property can be mapped on to another by placing a ":" between\nthe source property and the destination property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['url:href'],\n\n  url: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

HTML attributes passed with angle bracket invocations will take precedence\nover those specified in attributeBindings. Therefore, if this component was\ninvoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyAnchor href="http://bing.com" @url="http://google.com" />
\n
\n
\n \n

The resulting HTML will looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://bing.com"></a>
\n
\n
\n \n

Note that the href attribute is ultimately set to http://bing.com,\ndespite it having attribute binidng to the url property, which was\nset to http://google.com.

\n

Namespaced attributes (e.g. xlink:href) are supported, but have to be\nmapped, since : is not a valid character for properties in Javascript:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
use.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'use',\n  attributeBindings: ['xlinkHref:xlink:href'],\n\n  xlinkHref: '#triangle'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<use xlink:href="#triangle"></use>
\n
\n
\n \n

If the value of a property monitored by attributeBindings is a boolean, the\nattribute will be present or absent depending on the value:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: false\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id="ember1" class="ember-view" />
\n
\n
\n \n

attributeBindings can refer to computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: computed(function() {\n    if (someLogic) {\n      return true;\n    } else {\n      return false;\n    }\n  })\n});
\n
\n
\n \n

To prevent setting an attribute altogether, use null or undefined as the\nvalue of the property used in attributeBindings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'form',\n  attributeBindings: ['novalidate'],\n  novalidate: null\n});
\n
\n
\n \n

Updates to the property of an attribute binding will result in automatic\nupdate of the HTML attribute in the component's HTML output.

\n

attributeBindings is a concatenated property. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Layouts

\n

The layout property can be used to dynamically specify a template associated\nwith a component class, instead of relying on Ember to link together a\ncomponent class and a template based on file names.

\n

In general, applications should not use this feature, but it's commonly used\nin addons for historical reasons.

\n

The layout property should be set to the default export of a template\nmodule, which is the name of a template file without the .hbs extension.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>Person's Title</h1>\n<div class='details'>{{yield}}</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n
  import Component from '@ember/component';\n  import layout from '../templates/components/person-profile';\n\n  export default Component.extend({\n    layout\n  });
\n
\n
\n \n

If you invoke the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile>\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</PersonProfile>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#person-profile}}\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n{{/person-profile}}
\n
\n
\n \n

It will result in the following HTML output:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<h1>Person's Title</h1>\n  <div class="details">\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</div>
\n
\n
\n \n

Handling Browser Events

\n

Components can respond to user-initiated events in one of three ways: passing\nactions with angle bracket invocation, adding event handler methods to the\ncomponent's class, or adding actions to the component's template.

\n

Passing Actions With Angle Bracket Invocation

\n

For one-off events specific to particular instance of a component, it is possible\nto pass actions to the component's element using angle bracket invocation syntax.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyWidget {{action 'firstWidgetClicked'}} />\n\n<MyWidget {{action 'secondWidgetClicked'}} />
\n
\n
\n \n

In this case, when the first component is clicked on, Ember will invoke the\nfirstWidgetClicked action. When the second component is clicked on, Ember\nwill invoke the secondWidgetClicked action instead.

\n

Besides {{action}}, it is also possible to pass any arbitrary element modifiers\nusing the angle bracket invocation syntax.

\n

Event Handler Methods

\n

Components can also respond to user-initiated events by implementing a method\nthat matches the event name. This approach is appropriate when the same event\nshould be handled by all instances of the same component.

\n

An event object will be passed as the argument to the event handler method.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click(event) {\n    // `event.target` is either the component's element or one of its children\n    let tag = event.target.tagName.toLowerCase();\n    console.log('clicked on a `<${tag}>` HTML element!');\n  }\n});
\n
\n
\n \n

In this example, whenever the user clicked anywhere inside the component, it\nwill log a message to the console.

\n

It is possible to handle event types other than click by implementing the\nfollowing event handler methods. In addition, custom events can be registered\nby using Application.customEvents.

\n

Touch events:

\n
    \n
  • touchStart
  • \n
  • touchMove
  • \n
  • touchEnd
  • \n
  • touchCancel
  • \n
\n

Keyboard events:

\n
    \n
  • keyDown
  • \n
  • keyUp
  • \n
  • keyPress
  • \n
\n

Mouse events:

\n
    \n
  • mouseDown
  • \n
  • mouseUp
  • \n
  • contextMenu
  • \n
  • click
  • \n
  • doubleClick
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
\n

Form events:

\n
    \n
  • submit
  • \n
  • change
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
  • input
  • \n
\n

Drag and drop events:

\n
    \n
  • dragStart
  • \n
  • drag
  • \n
  • dragEnter
  • \n
  • dragLeave
  • \n
  • dragOver
  • \n
  • dragEnd
  • \n
  • drop
  • \n
\n

{{action}} Helper

\n

Instead of handling all events of a particular type anywhere inside the\ncomponent's element, you may instead want to limit it to a particular\nelement in the component's template. In this case, it would be more\nconvenient to implement an action instead.

\n

For example, you could implement the action hello for the person-profile\ncomponent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  actions: {\n    hello(name) {\n      console.log("Hello", name);\n    }\n  }\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
<h1>{{@person.name}}</h1>\n\n<button {{action 'hello' @person.name}}>\n  Say Hello to {{@person.name}}\n</button>
\n
\n
\n \n

When the user clicks the button, Ember will invoke the hello action,\npassing in the current value of @person.name as an argument.

\n

See Ember.Templates.helpers.action.

\n", + "extends": "Ember.CoreView", + "uses": [ + "Ember.ViewStateSupport", + "Ember.ViewMixin", + "Ember.ActionSupport", + "Ember.ClassNamesSupport", + "Ember.TargetActionSupport" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 752, + "description": "

Normally, Ember's component model is "write-only". The component takes a\nbunch of attributes that it got passed in, and uses them to render its\ntemplate.

\n

One nice thing about this model is that if you try to set a value to the\nsame thing as last time, Ember (through HTMLBars) will avoid doing any\nwork on the DOM.

\n

This is not just a performance optimization. If an attribute has not\nchanged, it is important not to clobber the element's "hidden state".\nFor example, if you set an input's value to the same value as before,\nit will clobber selection state and cursor position. In other words,\nsetting an attribute is not always idempotent.

\n

This method provides a way to read an element's attribute and also\nupdate the last value Ember knows about at the same time. This makes\nsetting an attribute idempotent.

\n

In particular, what this means is that if you get an <input> element's\nvalue attribute and then re-render the template with the same value,\nit will avoid clobbering the cursor and selection position.\nSince most attribute sets are idempotent in the browser, you typically\ncan get away with reading attributes using jQuery, but the most reliable\nway to do so is through this method.

\n", + "itemtype": "method", + "name": "readDOMAttr", + "params": [ + { + "name": "name", + "description": "the name of the attribute", + "type": "String" + } + ], + "return": { + "description": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 879, + "description": "

Called when the attributes passed into the component have been updated.\nCalled both during the initial render of a container and during a rerender.\nCan be used in place of an observer; code placed here will be executed\nevery time any attribute updates.

\n", + "itemtype": "method", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 900, + "description": "

Called after a component has been rendered, both on initial render and\nin subsequent rerenders.

\n", + "itemtype": "method", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 917, + "description": "

Called before a component has been rendered, both on initial render and\nin subsequent rerenders.

\n", + "itemtype": "method", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 934, + "description": "

Called when the attributes passed into the component have been changed.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 951, + "description": "

Called when the component is about to update and rerender itself.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 968, + "description": "

Called when the component has updated and rerendered itself.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 41, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 63, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 83, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 115, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 158, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 167, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 182, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 198, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 214, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.js", + "line": 52, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 70, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 96, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 116, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 156, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 214, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 299, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 373, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 407, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.js", + "line": 41, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.TargetActionSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 167, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 54, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 80, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 101, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 124, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 139, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 426, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Mixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 890, + "description": "

Called when the attributes passed into the component have been updated.\nCalled both during the initial render of a container and during a rerender.\nCan be used in place of an observer; code placed here will be executed\nevery time any attribute updates.

\n", + "itemtype": "event", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 909, + "description": "

Called after a component has been rendered, both on initial render and\nin subsequent rerenders.

\n", + "itemtype": "event", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 926, + "description": "

Called before a component has been rendered, both on initial render and\nin subsequent rerenders.

\n", + "itemtype": "event", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 943, + "description": "

Called when the attributes passed into the component have been changed.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 960, + "description": "

Called when the component is about to update and rerender itself.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 977, + "description": "

Called when the component has updated and rerendered itself.\nCalled only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 268, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 276, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 289, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 313, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 326, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 334, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 803, + "description": "

The WAI-ARIA role of the control represented by this view. For example, a\nbutton may have a role of type 'button', or a pane may have a role of\ntype 'alertdialog'. This property is used by assistive software to help\nvisually challenged users navigate rich web applications.

\n

The full list of valid WAI-ARIA roles is available at:\nhttps://www.w3.org/TR/wai-aria/#roles_categorization

\n", + "itemtype": "property", + "name": "ariaRole", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 818, + "description": "

Enables components to take a list of parameters as arguments.\nFor example, a component that takes two parameters with the names\nname and age:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: ['name', 'age']\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" 38}}
\n
\n
\n \n

The parameters can be referred to just like named parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Name: {{name}}, Age: {{age}}.
\n
\n
\n \n

Using a string instead of an array allows for an arbitrary number of\nparameters:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: 'names'\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" "Michael" "Scott"}}
\n
\n
\n \n

The parameters can then be referred to by enumerating over the list:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{#each names as |name|}}{{name}}{{/each}}
\n
\n
\n \n", + "static": 1, + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "positionalParams", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 985, + "description": "

Layout can be used to wrap content in a component.

\n", + "itemtype": "property", + "name": "layout", + "type": "Function", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 992, + "description": "

The name of the layout to lookup if no layout is provided.\nBy default Component will lookup a template with this name in\nEmber.TEMPLATES (a shared global object).

\n", + "itemtype": "property", + "name": "layoutName", + "type": "String", + "default": "null", + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1002, + "description": "

The HTML id of the component's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent @elementId="a-really-cool-id" />
\n
\n
\n \n

If not manually set a default value will be provided by the framework.\nOnce rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
export default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    var index = this.get('index');\n    this.set('elementId', `component-id${index}`);\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.js", + "line": 34, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 12, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 141, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 235, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 346, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/child_views_support.js", + "line": 8, + "description": "

Array of child views. You should never edit this array directly.

\n", + "itemtype": "property", + "name": "childViews", + "type": "Array", + "default": "[]", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.js", + "line": 31, + "description": "

Standard CSS class names to apply to the view's outer element. This\nproperty automatically inherits any class names defined by the view's\nsuperclasses as well.

\n", + "itemtype": "property", + "name": "classNames", + "type": "Array", + "default": "['ember-view']", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.js", + "line": 43, + "description": "

A list of properties of the view to apply as class names. If the property\nis a string value, the value of that string will be applied as a class\nname.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'high' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['priority'],\n  priority: 'high'\n});
\n
\n
\n \n

If the value of the property is a Boolean, the name of that property is\nadded as a dasherized class name.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'is-urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would prefer to use a custom value instead of the dasherized\nproperty name, you can pass a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent:urgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would like to specify a class that should only be added when the\nproperty is false, you can declare a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'disabled' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: false\n});
\n
\n
\n \n

This list of properties is inherited from the component's superclasses as well.

\n", + "itemtype": "property", + "name": "classNameBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 22, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-Ember.CoreView", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-ComputedProperty-b804ac6c7a.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-ComputedProperty-b804ac6c7a.json new file mode 100644 index 000000000..89432fe9f --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-ComputedProperty-b804ac6c7a.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-4.3.0-ComputedProperty", + "type": "class", + "attributes": { + "name": "ComputedProperty", + "shortname": "ComputedProperty", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 72, + "description": "

@computed is a decorator that turns a JavaScript getter and setter into a\ncomputed property, which is a cached, trackable value. By default the getter\nwill only be called once and the result will be cached. You can specify\nvarious properties that your computed property depends on. This will force the\ncached result to be cleared if the dependencies are modified, and lazily recomputed the next time something asks for it.

\n

In the following example we decorate a getter - fullName - by calling\ncomputed with the property dependencies (firstName and lastName) as\narguments. The fullName getter will be called once (regardless of how many\ntimes it is accessed) as long as its dependencies do not change. Once\nfirstName or lastName are updated any future calls to fullName will\nincorporate the new values, and any watchers of the value such as templates\nwill be updated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet tom = new Person('Tom', 'Dale');\n\ntom.fullName; // 'Tom Dale'
\n
\n
\n \n

You can also provide a setter, which will be used when updating the computed\nproperty. Ember's set function must be used to update the property\nsince it will also notify observers of the property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(' ');\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

You can also pass a getter function or object with get and set functions\nas the last argument to the computed decorator. This allows you to define\ncomputed property macros:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { computed } from '@ember/object';\n\nfunction join(...keys) {\n  return computed(...keys, function() {\n    return keys.map(key => this[key]).join(' ');\n  });\n}\n\nclass Person {\n  @join('firstName', 'lastName')\n  fullName;\n}
\n
\n
\n \n

Note that when defined this way, getters and setters receive the key of the\nproperty they are decorating as the first argument. Setters receive the value\nthey are setting to as the second argument instead. Additionally, setters must\nreturn the value that should be cached:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { computed, set } from '@ember/object';\n\nfunction fullNameMacro(firstNameKey, lastNameKey) {\n  return computed(firstNameKey, lastNameKey, {\n    get() {\n      return `${this[firstNameKey]} ${this[lastNameKey]}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, firstNameKey, firstName);\n      set(this, lastNameKey, lastName);\n\n      return value;\n    }\n  });\n}\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @fullNameMacro('firstName', 'lastName') fullName;\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

Computed properties can also be used in classic classes. To do this, we\nprovide the getter and setter as the last argument like we would for a macro,\nand we assign it to a property on the class definition. This is an anonymous\ncomputed macro:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import EmberObject, { computed, set } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  // these will be supplied by `create`\n  firstName: null,\n  lastName: null,\n\n  fullName: computed('firstName', 'lastName', {\n    get() {\n      return `${this.firstName} ${this.lastName}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, 'firstName', firstName);\n      set(this, 'lastName', lastName);\n\n      return value;\n    }\n  })\n});\n\nlet tom = Person.create({\n  firstName: 'Tom',\n  lastName: 'Dale'\n});\n\ntom.get('fullName') // 'Tom Dale'
\n
\n
\n \n

You can overwrite computed property without setters with a normal property (no\nlonger computed) that won't change if dependencies change. You can also mark\ncomputed property as .readOnly() and block all attempts to set it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName').readOnly()\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet person = new Person();\nperson.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX>
\n
\n
\n \n

Additional resources:

\n\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 600, + "description": "

Call on a computed property to set it into read-only mode. When in this\nmode the computed property will throw an error when set.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  @computed().readOnly()\n  get guid() {\n    return 'guid-guid-guid';\n  }\n}\n\nlet person = new Person();\nset(person, 'guid', 'new-guid'); // will throw an exception
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  guid: computed(function() {\n    return 'guid-guid-guid';\n  }).readOnly()\n});\n\nlet person = Person.create();\nperson.set('guid', 'new-guid'); // will throw an exception
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "return": { + "description": "this", + "type": "ComputedProperty" + }, + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 650, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For example,\ncomputed property functions may close over variables that are then no longer\navailable for introspection. You can pass a hash of these values to a\ncomputed property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nclass Store {\n  @computed().meta({ type: Person })\n  get person() {\n    let personId = this.personId;\n    return Person.create({ id: personId });\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nconst Store = EmberObject.extend({\n  person: computed(function() {\n    let personId = this.get('personId');\n    return Person.create({ id: personId });\n  }).meta({ type: Person })\n});
\n
\n
\n \n

The hash that you pass to the meta() function will be saved on the\ncomputed property descriptor under the _meta key. Ember runtime\nexposes a public API for retrieving these values from classes,\nvia the metaForProperty() function.

\n", + "itemtype": "method", + "name": "meta", + "params": [ + { + "name": "meta", + "description": "", + "type": "Object" + } + ], + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Container-4003e8981e.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Container-4003e8981e.json new file mode 100644 index 000000000..50679a542 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Container-4003e8981e.json @@ -0,0 +1,197 @@ +{ + "data": { + "id": "ember-4.3.0-Container", + "type": "class", + "attributes": { + "name": "Container", + "shortname": "Container", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 55, + "description": "

A container used to instantiate and cache objects.

\n

Every Container must be associated with a Registry, which is referenced\nto determine the factory and options that should be used to instantiate\nobjects.

\n

The public API for Container is still in flux and should not be considered\nstable.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 114, + "description": "

Given a fullName return a corresponding instance.\n The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter');\ntwitter instanceof Twitter; // => true\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted, an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "The fullname of the request source (used for local lookup)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 154, + "description": "

A depth first traversal, destroying the container, its descendant containers and all\ntheir managed objects.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "destroy", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 171, + "description": "

Clear either the entire cache or just the cache for a particular key.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "params": [ + { + "name": "fullName", + "description": "optional key to reset; if missing, resets everything", + "type": "String" + } + ], + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 188, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "return": { + "description": "", + "type": "Object" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 201, + "description": "

Given a fullName, return the corresponding factory. The consumer of the factory\nis responsible for the destruction of any factory instances, as there is no\nway for the container to ensure instances are destroyed when it itself is\ndestroyed.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "The fullname of the request source (used for local lookup)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 95, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registry", + "type": "Registry", + "since": "1.11.0", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 102, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "cache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 108, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "validationCache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-ContainerDebugAdapter-159b82e26a.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-ContainerDebugAdapter-159b82e26a.json new file mode 100644 index 000000000..f2e0c9464 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-ContainerDebugAdapter-159b82e26a.json @@ -0,0 +1,593 @@ +{ + "data": { + "id": "ember-4.3.0-ContainerDebugAdapter", + "type": "class", + "attributes": { + "name": "ContainerDebugAdapter", + "shortname": "ContainerDebugAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.js", + "line": 9, + "description": "

The ContainerDebugAdapter helps the container and resolver interface\nwith tools that debug Ember such as the\nEmber Inspector\nfor Chrome and Firefox.

\n

This class can be extended by a custom resolver implementer\nto override some of the methods with library-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • canCatalogEntriesByType
  • \n
  • catalogEntriesByType
  • \n
\n

The adapter will need to be registered\nin the application's container as container-debug-adapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "containerDebugAdapter",\n\n  initialize(application) {\n    application.register('container-debug-adapter:main', require('app/container-debug-adapter'));\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "since": "1.5.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.js", + "line": 61, + "description": "

Returns true if it is possible to catalog a list of available\nclasses in the resolver for a given type.

\n", + "itemtype": "method", + "name": "canCatalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "whether a list is available for this type.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.js", + "line": 78, + "description": "

Returns the available classes a given type.

\n", + "itemtype": "method", + "name": "catalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "An array of strings.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.js", + "line": 50, + "description": "

The resolver instance of the application\nbeing debugged. This property will be injected\non creation.

\n", + "itemtype": "property", + "name": "resolver", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-ContainerProxyMixin-5018218740.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-ContainerProxyMixin-5018218740.json new file mode 100644 index 000000000..49e484a5e --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-ContainerProxyMixin-5018218740.json @@ -0,0 +1,131 @@ +{ + "data": { + "id": "ember-4.3.0-ContainerProxyMixin", + "type": "class", + "attributes": { + "name": "ContainerProxyMixin", + "shortname": "ContainerProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 7, + "description": "

ContainerProxyMixin is used to provide public access to specific\ncontainer functionality.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 23, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "ContainerProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 49, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ContainerProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 110, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ContainerProxyMixin", + "module": "ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 15, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ContainerProxyMixin", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Controller-0fef0a544f.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Controller-0fef0a544f.json new file mode 100644 index 000000000..75726aab6 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Controller-0fef0a544f.json @@ -0,0 +1,724 @@ +{ + "data": { + "id": "ember-4.3.0-Controller", + "type": "class", + "attributes": { + "name": "Controller", + "shortname": "Controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "", + "file": "packages/@ember/controller/index.ts", + "line": 11, + "extends": "EmberObject", + "uses": [ + "Ember.ControllerMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 53, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 74, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 95, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 185, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 167, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 25, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 21, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 41, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 22, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-CoreObject-c1c5340263.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-CoreObject-c1c5340263.json new file mode 100644 index 000000000..43c81e45b --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-CoreObject-c1c5340263.json @@ -0,0 +1,158 @@ +{ + "data": { + "id": "ember-4.3.0-CoreObject", + "type": "class", + "attributes": { + "name": "CoreObject", + "shortname": "CoreObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 137, + "description": "

CoreObject is the base class for all Ember constructs. It establishes a\nclass system based on Ember's Mixin system, and provides the basis for the\nEmber Object Model. CoreObject should generally not be used directly,\ninstead you should use EmberObject.

\n

Usage

\n

You can define a class by extending from CoreObject using the extend\nmethod:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Person = CoreObject.extend({\n  name: 'Tomster',\n});
\n
\n
\n \n

For detailed usage, see the Object Model\nsection of the guides.

\n

Usage with Native Classes

\n

Native JavaScript class syntax can be used to extend from any CoreObject\nbased class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
class Person extends CoreObject {\n  init() {\n    super.init(...arguments);\n    this.name = 'Tomster';\n  }\n}
\n
\n
\n \n

Some notes about class usage:

\n
    \n
  • new syntax is not currently supported with classes that extend from\nEmberObject or CoreObject. You must continue to use the create method\nwhen making new instances of classes, even if they are defined using native\nclass syntax. If you want to use new syntax, consider creating classes\nwhich do not extend from EmberObject or CoreObject. Ember features,\nsuch as computed properties and decorators, will still work with base-less\nclasses.
  • \n
  • Instead of using this._super(), you must use standard super syntax in\nnative classes. See the MDN docs on classes\nfor more details.
  • \n
  • Native classes support using constructors\nto set up newly-created instances. Ember uses these to, among other things,\nsupport features that need to retrieve other entities by name, like Service\ninjection and getOwner. To ensure your custom instance setup logic takes\nplace after this important work is done, avoid using the constructor in\nfavor of init.
  • \n
  • Properties passed to create will be available on the instance by the time\ninit runs, so any code that requires these values should work at that\ntime.
  • \n
  • Using native classes, and switching back to the old Ember Object model is\nfully supported.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.3.0-Helper" + }, + { + "type": "class", + "id": "ember-4.3.0-EmberObject" + } + ] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-DataAdapter-c533722546.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-DataAdapter-c533722546.json new file mode 100644 index 000000000..2333749b2 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-DataAdapter-c533722546.json @@ -0,0 +1,935 @@ +{ + "data": { + "id": "ember-4.3.0-DataAdapter", + "type": "class", + "attributes": { + "name": "DataAdapter", + "shortname": "DataAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 125, + "description": "

The DataAdapter helps a data persistence library\ninterface with tools that debug Ember such\nas the Ember Inspector\nfor Chrome and Firefox.

\n

This class will be extended by a persistence library\nwhich will override some of the methods with\nlibrary-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • getFilters
  • \n
  • detect
  • \n
  • columnsForType
  • \n
  • getRecords
  • \n
  • getRecordColumnValues
  • \n
  • getRecordKeywords
  • \n
  • getRecordFilterValues
  • \n
  • getRecordColor
  • \n
\n

The adapter will need to be registered\nin the application's container as dataAdapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "data-adapter",\n\n  initialize: function(application) {\n    application.register('data-adapter:main', DS.DataAdapter);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 248, + "description": "

Specifies how records can be filtered.\nRecords returned will need to have a filterValues\nproperty with a key for every name in the returned array.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getFilters", + "return": { + "description": "List of objects defining filters.\n The object should have a `name` and `desc` property.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 262, + "description": "

Fetch the model types and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchModelTypes", + "params": [ + { + "name": "typesAdded", + "description": "Callback to call to add types.\nTakes an array of objects containing wrapped types (returned from `wrapModelType`).", + "type": "Function" + }, + { + "name": "typesUpdated", + "description": "Callback to call when a type has changed.\nTakes an array of objects containing wrapped types.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 307, + "description": "

Fetch the records of a given type and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchRecords", + "params": [ + { + "name": "modelName", + "description": "The model name.", + "type": "String" + }, + { + "name": "recordsAdded", + "description": "Callback to call to add records.\nTakes an array of objects containing wrapped records.\nThe object should have the following properties:\n columnValues: {Object} The key and value of a table cell.\n object: {Object} The actual record object.", + "type": "Function" + }, + { + "name": "recordsUpdated", + "description": "Callback to call when a record has changed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + }, + { + "name": "recordsRemoved", + "description": "Callback to call when a record has removed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 374, + "description": "

Clear all observers before destruction

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 392, + "description": "

Detect whether a class is a model.

\n

Test that against the model class\nof your persistence library.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "detect", + "return": { + "description": "boolean Whether the class is a model class or not." + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 406, + "description": "

Get the columns for a given model type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "columnsForType", + "return": { + "description": "An array of columns of the following format:\n name: {String} The name of the column.\n desc: {String} Humanized description (what would show in a table column name).", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 419, + "description": "

Adds observers to a model type class.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "observeModelType", + "params": [ + { + "name": "modelName", + "description": "The model type name.", + "type": "String" + }, + { + "name": "typesUpdated", + "description": "Called when a type is modified.", + "type": "Function" + } + ], + "return": { + "description": "The function to call to remove observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 456, + "description": "

Wraps a given model type and observes changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapModelType", + "params": [ + { + "name": "klass", + "description": "A model class.", + "type": "Class" + }, + { + "name": "modelName", + "description": "Name of the class.", + "type": "String" + } + ], + "return": { + "description": "Contains the wrapped type and the function to remove observers\nFormat:\n type: {Object} The wrapped type.\n The wrapped type has the following format:\n name: {String} The name of the type.\n count: {Integer} The number of records available.\n columns: {Columns} An array of columns to describe the record.\n object: {Class} The actual Model type class.\n release: {Function} The function to remove observers.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 487, + "description": "

Fetches all models defined in the application.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getModelTypes", + "return": { + "description": "Array of model types.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 516, + "description": "

Loops over all namespaces and all objects\nattached to them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getObjectsOnNamespaces", + "return": { + "description": "Array of model type strings.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 545, + "description": "

Fetches all loaded records for a given type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecords", + "return": { + "description": "An array of records.\n This array will be observed for changes,\n so it should update when new records are added/removed.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 558, + "description": "

Wraps a record and observers changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapRecord", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The wrapped record. Format:\ncolumnValues: {Array}\nsearchKeywords: {Array}", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 579, + "description": "

Gets the values for each column.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColumnValues", + "return": { + "description": "Keys should match column names defined\nby the model type.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 591, + "description": "

Returns keywords to match when searching records.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordKeywords", + "return": { + "description": "Relevant keywords for search.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 602, + "description": "

Returns the values of filters defined by getFilters.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordFilterValues", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The filter values.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 614, + "description": "

Each record can have a color that represents its state.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColor", + "params": [ + { + "name": "record", + "description": "The record instance", + "type": "Object" + } + ], + "return": { + "description": "The records color.\n Possible options: black, red, blue, green.", + "type": "String" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 177, + "description": "

The container-debug-adapter which is used\nto list all models.

\n", + "itemtype": "property", + "name": "containerDebugAdapter", + "default": "undefined", + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 187, + "description": "

The number of attributes to send\nas columns. (Enough to make the record\nidentifiable).

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "attributeLimit", + "default": "3", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 199, + "description": "

Ember Data > v1.0.0-beta.18\nrequires string model names to be passed\naround instead of the actual factories.

\n

This is a stamp for the Ember Inspector\nto differentiate between the versions\nto be able to support older versions too.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "acceptsModelName", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 213, + "description": "

Map from records arrays to RecordsWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "recordsWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 221, + "description": "

Map from records arrays to TypeWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "typeWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 229, + "description": "

Callback that is currently scheduled on backburner end to flush and check\nall active watchers.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "flushWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.js", + "line": 239, + "description": "

Stores all methods that clear observers.\nThese methods will be called on destruction.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "releaseMethods", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.ActionHandler-9057a63186.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.ActionHandler-9057a63186.json new file mode 100644 index 000000000..31e626aa4 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.ActionHandler-9057a63186.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.3.0-Ember.ActionHandler", + "type": "class", + "attributes": { + "name": "Ember.ActionHandler", + "shortname": "Ember.ActionHandler", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.ControllerMixin", + "Ember.CoreView" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 8, + "description": "

Ember.ActionHandler is available on some familiar classes including\nRoute, Component, and Controller.\n(Internally the mixin is used by Ember.CoreView, Ember.ControllerMixin,\nand Route and available to the above classes through\ninheritance.)

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 167, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 22, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.ControllerMixin-babdab641d.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.ControllerMixin-babdab641d.json new file mode 100644 index 000000000..318207d6c --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.ControllerMixin-babdab641d.json @@ -0,0 +1,223 @@ +{ + "data": { + "id": "ember-4.3.0-Ember.ControllerMixin", + "type": "class", + "attributes": { + "name": "Ember.ControllerMixin", + "shortname": "Ember.ControllerMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Controller" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 11, + "uses": [ + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 53, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 74, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 95, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 185, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 167, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 25, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 21, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 41, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 22, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.CoreView-dfcf4113c1.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.CoreView-dfcf4113c1.json new file mode 100644 index 000000000..00e0d004d --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.CoreView-dfcf4113c1.json @@ -0,0 +1,933 @@ +{ + "data": { + "id": "ember-4.3.0-Ember.CoreView", + "type": "class", + "attributes": { + "name": "Ember.CoreView", + "shortname": "Ember.CoreView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/views/core_view.js", + "line": 5, + "description": "

Ember.CoreView is an abstract class that exists to give view-like behavior\nto both Ember's main view class Component and other classes that don't need\nthe full functionality of Component.

\n

Unless you have specific needs for CoreView, you will use Component\nin your applications.

\n", + "extends": "EmberObject", + "deprecated": true, + "deprecationMessage": "Use `Component` instead.", + "uses": [ + "Evented", + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 41, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 63, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 83, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 115, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 158, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 167, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 182, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 198, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 214, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.js", + "line": 52, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 54, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 80, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 101, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 124, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 139, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 167, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/views/core_view.js", + "line": 34, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.js", + "line": 22, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.3.0-Component" + } + ] + }, + "module": { + "data": { + "id": "ember-4.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.EventDispatcher-580d247646.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.EventDispatcher-580d247646.json new file mode 100644 index 000000000..0e3431efd --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.EventDispatcher-580d247646.json @@ -0,0 +1,174 @@ +{ + "data": { + "id": "ember-4.3.0-Ember.EventDispatcher", + "type": "class", + "attributes": { + "name": "Ember.EventDispatcher", + "shortname": "Ember.EventDispatcher", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 15, + "description": "

Ember.EventDispatcher handles delegating browser events to their\ncorresponding Ember.Views. For example, when you click on a view,\nEmber.EventDispatcher ensures that that view's mouseDown method gets\ncalled.

\n", + "access": "private", + "tagname": "", + "extends": "Ember.Object", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 112, + "description": "

Sets up event listeners for standard browser events.

\n

This will be called after the browser sends a DOMContentReady event. By\ndefault, it will set up all of the listeners on the document body. If you\nwould like to register the listeners on a different element, set the event\ndispatcher's root property.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "params": [ + { + "name": "addedEvents", + "description": "", + "type": "Object" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 202, + "description": "

Setup event listeners for the given browser event name

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForBrowserEvent", + "params": [ + { + "name": "event", + "description": "the name of the event in the browser" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 213, + "description": "

Setup event listeners for the given Ember event name (camel case)

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForEmberEvent", + "params": [ + { + "name": "eventName", + "description": "" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 228, + "description": "

Registers an event listener on the rootElement. If the given event is\ntriggered, the provided event handler will be triggered on the target view.

\n

If the target view does not implement the event handler, or if the handler\nreturns false, the parent view will be called. The event will continue to\nbubble to each successive parent view until it reaches the top.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandler", + "params": [ + { + "name": "rootElement", + "description": "", + "type": "Element" + }, + { + "name": "event", + "description": "the name of the event in the browser", + "type": "String" + }, + { + "name": "eventName", + "description": "the name of the method to call on the view", + "type": "String" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/system/action_manager.js", + "line": 7, + "description": "

Global action id hash.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registeredActions", + "type": "Object", + "class": "Ember.EventDispatcher", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 27, + "description": "

The set of events names (and associated handler function names) to be setup\nand dispatched by the EventDispatcher. Modifications to this list can be done\nat setup time, generally via the Application.customEvents hash.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "events", + "type": "Object", + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.js", + "line": 87, + "description": "

The root DOM element to which event listeners should be attached. Event\nlisteners will be attached to the document unless this is overridden.

\n

Can be specified as a DOMElement or a selector string.

\n

The default body is a string since this may be evaluated before document.body\nexists in the DOM.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.Object", + "type": "missing" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.NativeArray-2f07a774e6.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.NativeArray-2f07a774e6.json new file mode 100644 index 000000000..89fc0b090 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.NativeArray-2f07a774e6.json @@ -0,0 +1,1635 @@ +{ + "data": { + "id": "ember-4.3.0-Ember.NativeArray", + "type": "class", + "attributes": { + "name": "Ember.NativeArray", + "shortname": "Ember.NativeArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1748, + "description": "

The NativeArray mixin contains the properties needed to make the native\nArray support MutableArray and all of its dependent APIs. Unless you\nhave EmberENV.EXTEND_PROTOTYPES or EmberENV.EXTEND_PROTOTYPES.Array set to\nfalse, this will be applied automatically. Otherwise you can apply the mixin\nat anytime by calling Ember.NativeArray.apply(Array.prototype).

\n", + "uses": [ + "Observable", + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1349, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1368, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1394, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1416, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1441, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1461, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1481, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1507, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1532, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1552, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumberable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1573, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1592, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1619, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1647, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1664, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1690, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1117, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1155, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1167, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1183, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1216, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1260, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1279, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1301, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.TargetActionSupport-1bc1f63fbe.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.TargetActionSupport-1bc1f63fbe.json new file mode 100644 index 000000000..5d94d4084 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.TargetActionSupport-1bc1f63fbe.json @@ -0,0 +1,101 @@ +{ + "data": { + "id": "ember-4.3.0-Ember.TargetActionSupport", + "type": "class", + "attributes": { + "name": "Ember.TargetActionSupport", + "shortname": "Ember.TargetActionSupport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.js", + "line": 10, + "description": "

Ember.TargetActionSupport is a mixin that can be included in a class\nto add a triggerAction method with semantics similar to the Handlebars\n{{action}} helper. In normal Ember usage, the {{action}} helper is\nusually the best choice. This mixin is most often useful when you are\ndoing more complex event handling in Components.

\n", + "extends": "Mixin", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.js", + "line": 41, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 426, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Mixin" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-Mixin", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.Templates.components-f20d031f2e.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.Templates.components-f20d031f2e.json new file mode 100644 index 000000000..1c83dd4d9 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.Templates.components-f20d031f2e.json @@ -0,0 +1,85 @@ +{ + "data": { + "id": "ember-4.3.0-Ember.Templates.components", + "type": "class", + "attributes": { + "name": "Ember.Templates.components", + "shortname": "Ember.Templates.components", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 66, + "description": "

The Input component lets you create an HTML <input> element.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value="987" />
\n
\n
\n \n

creates an <input> element with type="text" and value set to 987.

\n

Text field

\n

If no type argument is specified, a default of type 'text' is used.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Search:\n<Input @value={{this.searchWord}} />
\n
\n
\n \n

In this example, the initial value in the <input> will be set to the value of\nthis.searchWord. If the user changes the text, the value of this.searchWord will also be\nupdated.

\n

Actions

\n

The Input component takes a number of arguments with callbacks that are invoked in response to\nuser events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-down
  • \n
  • key-press
  • \n
  • key-up
  • \n
\n

These callbacks are passed to Input like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Starting with Ember Octane, we recommend using the {{on}} modifier to call actions\non specific events, such as the input event.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
<label for="input-name">Name:</label>\n<Input\n  @id="input-name"\n  @value={{this.name}}\n  {{on "input" this.validateName}}\n/>
\n
\n
\n \n

The event name (e.g. focusout, input, keydown) always follows the casing\nthat the HTML standard uses.

\n

<input> HTML Attributes to Avoid

\n

In most cases, if you want to pass an attribute to the underlying HTML <input> element, you\ncan pass the attribute directly, just like any other Ember component.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @type="text" size="10" />
\n
\n
\n \n

In this example, the size attribute will be applied to the underlying <input> element in the\noutputted HTML.

\n

However, there are a few attributes where you must use the @ version.

\n
    \n
  • @type: This argument is used to control which Ember component is used under the hood
  • \n
  • @value: The @value argument installs a two-way binding onto the element. If you wanted a\none-way binding, use <input> with the value property and the input event instead.
  • \n
  • @checked (for checkboxes): like @value, the @checked argument installs a two-way binding\nonto the element. If you wanted a one-way binding, use <input type="checkbox"> with\nchecked and the input event instead.
  • \n
\n

Extending TextField

\n

Internally, <Input @type="text" /> creates an instance of TextField, passing arguments from\nthe helper to TextField's create method. Subclassing TextField is supported but not\nrecommended.

\n

See TextField

\n

Checkbox

\n

To create an <input type="checkbox">:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Emberize Everything:\n<Input @type="checkbox" @checked={{this.isEmberized}} name="isEmberized" />
\n
\n
\n \n

This will bind the checked state of this checkbox to the value of isEmberized -- if either one\nchanges, it will be reflected in the other.

\n

Extending Checkbox

\n

Internally, <Input @type="checkbox" /> creates an instance of Checkbox. Subclassing\nTextField is supported but not recommended.

\n

See Checkbox

\n", + "itemtype": "method", + "name": "Input", + "see": [ + "{TextField}", + "{Checkbox}" + ], + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 39, + "description": "

The LinkTo component renders a link to the supplied routeName passing an optionally\nsupplied model to the route as its model context of the route. The block for LinkTo\nbecomes the contents of the rendered element:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

Disabling the LinkTo component

\n

The LinkTo component can be disabled by using the disabled argument. A disabled link\ndoesn't result in a transition when activated, and adds the disabled class to the <a>\nelement.

\n

(The class name to apply to the element can be overridden by using the disabledClass\nargument)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @disabled={{true}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

Handling href

\n

<LinkTo> will use your application's Router to fill the element's href property with a URL\nthat matches the path to the supplied routeName.

\n

Handling current route

\n

The LinkTo component will apply a CSS class name of 'active' when the application's current\nroute matches the supplied routeName. For example, if the application's current route is\n'photoGallery.recent', then the following invocation of LinkTo:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

will result in

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="active">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

The CSS class used for active classes can be customized by passing an activeClass argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent' @activeClass="current-url">\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="current-url">\n  Great Hamster Photos\n</a>
\n
\n
\n \n\n

If you need a link to be 'active' even when it doesn't match the current route, you can use the\ncurrent-when argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @current-when='photos'>\n  Photo Gallery\n</LinkTo>
\n
\n
\n \n

This may be helpful for keeping links active for:

\n
    \n
  • non-nested routes that are logically related
  • \n
  • some secondary menu approaches
  • \n
  • 'top navigation' with 'sub navigation' scenarios
  • \n
\n

A link will be active if current-when is true or the current\nroute is the route this link would transition to.

\n

To match multiple routes 'space-separate' the routes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='gallery' @current-when='photos drawings paintings'>\n  Art Gallery\n</LinkTo>
\n
\n
\n \n

Supplying a model

\n

An optional model argument can be used for routes whose\npaths contain dynamic segments. This argument will become\nthe model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", {path: "hamster-photos/:photo_id"});\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{this.aPhoto}}>\n  {{aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

Supplying multiple models

\n

For deep-linking to route paths that contain multiple\ndynamic segments, the models argument can be used.

\n

As the router transitions through the route path, each\nsupplied model argument will become the context for the\nroute with the dynamic segments:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() {\n    this.route("comment", {path: "comments/:comment_id"});\n  });\n});
\n
\n
\n \n

This argument will become the model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.comment' @models={{array this.aPhoto this.comment}}>\n  {{comment.body}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42/comments/718">\n  A+++ would snuggle again.\n</a>
\n
\n
\n \n

Supplying an explicit dynamic segment value

\n

If you don't have a model object available to pass to LinkTo,\nan optional string or integer argument can be passed for routes whose\npaths contain dynamic segments. This argument will become the value\nof the dynamic segment:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{aPhotoId}}>\n  {{this.aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

When transitioning into the linked route, the model hook will\nbe triggered with parameters including this passed identifier.

\n

Supplying query parameters

\n

If you need to add optional key-value pairs that appear to the right of the ? in a URL,\nyou can use the query argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @query={{hash page=1 per_page=20}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos?page=1&per_page=20">\n  Great Hamster Photos\n</a>
\n
\n
\n \n", + "itemtype": "method", + "name": "LinkTo", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 9, + "description": "

The Textarea component inserts a new instance of <textarea> tag into the template.

\n

The @value argument provides the content of the <textarea>.

\n

This template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value="A bunch of text" />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  A bunch of text\n</textarea>
\n
\n
\n \n

The @value argument is two-way bound. If the user types text into the textarea, the @value\nargument is updated. If the @value argument is updated, the text in the textarea is updated.

\n

In the following example, the writtenWords property on the component will be updated as the user\ntypes 'Lots of text' into the text area of their browser's window.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class WordEditorComponent extends Component {\n  @tracked writtenWords = "Lots of text that IS bound";\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{writtenWords}} />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  Lots of text that IS bound\n</textarea>
\n
\n
\n \n

If you wanted a one way binding, you could use the <textarea> element directly, and use the\nvalue DOM property and the input event.

\n

Actions

\n

The Textarea component takes a number of arguments with callbacks that are invoked in\nresponse to user events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-press
  • \n
\n

These callbacks are passed to Textarea like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Classic Invocation Syntax

\n

The Textarea component can also be invoked using curly braces, just like any other Ember\ncomponent.

\n

For example, this is an invocation using angle-bracket notation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

You could accomplish the same thing using classic invocation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{textarea value=this.searchWord enter=this.query}}
\n
\n
\n \n

The main difference is that angle-bracket invocation supports any HTML attribute using HTML\nattribute syntax, because attributes and arguments have different syntax when using angle-bracket\ninvocation. Curly brace invocation, on the other hand, only has a single syntax for arguments,\nand components must manually map attributes onto component arguments.

\n

When using classic invocation with {{textarea}}, only the following attributes are mapped onto\narguments:

\n
    \n
  • rows
  • \n
  • cols
  • \n
  • name
  • \n
  • selectionEnd
  • \n
  • selectionStart
  • \n
  • autocomplete
  • \n
  • wrap
  • \n
  • lang
  • \n
  • dir
  • \n
  • value
  • \n
\n

Classic layout and layoutName properties

\n

Because HTML textarea elements do not contain inner HTML the layout and\nlayoutName properties will not be applied.

\n", + "itemtype": "method", + "name": "Textarea", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.Templates.helpers-4cdf501702.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.Templates.helpers-4cdf501702.json new file mode 100644 index 000000000..c8c436f6f --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.Templates.helpers-4cdf501702.json @@ -0,0 +1,480 @@ +{ + "data": { + "id": "ember-4.3.0-Ember.Templates.helpers", + "type": "class", + "attributes": { + "name": "Ember.Templates.helpers", + "shortname": "Ember.Templates.helpers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 86, + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 45, + "description": "

See Ember.Templates.components.Input.

\n", + "itemtype": "method", + "name": "input", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 251, + "description": "

See Ember.Templates.components.LinkTo.

\n", + "itemtype": "method", + "name": "link-to", + "see": [ + "{Ember.Templates.components.LinkTo}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 122, + "description": "

See Ember.Templates.components.Textarea.

\n", + "itemtype": "method", + "name": "textarea", + "see": [ + "{Ember.Templates.components.Textarea}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/action.ts", + "line": 22, + "description": "

The {{action}} helper provides a way to pass triggers for behavior (usually\njust a function) between components, and into components from controllers.

\n

Passing functions with the action helper

\n

There are three contexts an action helper can be used in. The first two\ncontexts to discuss are attribute context, and Handlebars value context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>\n{{! Examples of Handlebars value context }}\n{{input on-input=(action "save")}}\n{{yield (action "refreshData") andAnotherParam}}
\n
\n
\n \n

In these contexts,\nthe helper is called a "closure action" helper. Its behavior is simple:\nIf passed a function name, read that function off the actions property\nof the current context. Once that function is read, or immediately if a function was\npassed, create a closure over that function and any arguments.\nThe resulting value of an action helper used this way is simply a function.

\n

For example, in the attribute context:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>
\n
\n
\n \n

The resulting template render logic would be:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
var div = document.createElement('div');\nvar actionFunction = (function(context){\n  return function() {\n    return context.actions.save.apply(context, arguments);\n  };\n})(context);\ndiv.onclick = actionFunction;
\n
\n
\n \n

Thus when the div is clicked, the action on that context is called.\nBecause the actionFunction is just a function, closure actions can be\npassed between components and still execute in the correct context.

\n

Here is an example action handler on a component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  save() {\n    this.model.save();\n  }\n}
\n
\n
\n \n

Actions are always looked up on the actions property of the current context.\nThis avoids collisions in the naming of common actions, such as destroy.\nTwo options can be passed to the action helper when it is used in this way.

\n
    \n
  • target=someProperty will look to someProperty instead of the current\ncontext for the actions hash. This can be useful when targeting a\nservice for actions.
  • \n
  • value="target.value" will read the path target.value off the first\nargument to the action when it is called and rewrite the first argument\nto be that value. This is useful when attaching actions to event listeners.
  • \n
\n

Invoking an action

\n

Closure actions curry both their scope and any arguments. When invoked, any\nadditional arguments are added to the already curried list.\nActions are presented in JavaScript as callbacks, and are\ninvoked like any other JavaScript function.

\n

For example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.hbs
1\n
{{input on-input=(action (action 'setName' @model) value="target.value")}}
\n
\n
\n \n

The first argument (@model) was curried over, and the run-time argument (event)\nbecomes a second argument. Action calls can be nested this way because each simply\nreturns a function. Any function can be passed to the {{action}} helper, including\nother actions.

\n

Actions invoked with sendAction have the same currying behavior as demonstrated\nwith on-input above. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyInput @submit={{action 'setName' @model}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-input submit=(action 'setName' @model)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    // Note that model is not passed, it was curried in the template\n    this.submit('bob');\n  }\n});
\n
\n
\n \n

Attaching actions to DOM elements

\n

The third context of the {{action}} helper can be called "element space".\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of element space }}\n<div {{action "save"}}></div>
\n
\n
\n \n

Used this way, the {{action}} helper provides a useful shortcut for\nregistering an HTML element in a template for a single DOM event and\nforwarding that interaction to the template's context (controller or component).\nIf the context of a template is a controller, actions used this way will\nbubble to routes when the controller does not implement the specified action.\nOnce an action hits a route, it will bubble through the route hierarchy.

\n

Event Propagation

\n

{{action}} helpers called in element space can control event bubbling. Note\nthat the closure style actions cannot.

\n

Events triggered through the action helper will automatically have\n.preventDefault() called on them. You do not need to do so in your event\nhandlers. If you need to allow event propagation (to handle file inputs for\nexample) you can supply the preventDefault=false option to the {{action}} helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<div {{action "sayHello" preventDefault=false}}>\n  <input type="file" />\n  <input type="checkbox" />\n</div>
\n
\n
\n \n

To disable bubbling, pass bubbles=false to the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<button {{action 'edit' post bubbles=false}}>Edit</button>
\n
\n
\n \n

To disable bubbling with closure style actions you must create your own\nwrapper helper that makes use of event.stopPropagation():

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div onclick={{disable-bubbling (action "sayHello")}}>Hello</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
bubbling.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { helper } from '@ember/component/helper';\n\nexport function disableBubbling([action]) {\n  return function(event) {\n    event.stopPropagation();\n    return action(event);\n  };\n}\nexport default helper(disableBubbling);
\n
\n
\n \n

If you need the default handler to trigger you should either register your\nown event handler, or use event methods on your view class. See\n"Responding to Browser Events"\nin the documentation for Component for more information.

\n

Specifying DOM event type

\n

{{action}} helpers called in element space can specify an event type.\nBy default the {{action}} helper registers for DOM click events. You can\nsupply an on option to the helper to specify a different DOM event name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" on="doubleClick"}}>\n  click me\n</div>
\n
\n
\n \n

See "Event Names" for a list of\nacceptable DOM event names.

\n

Specifying whitelisted modifier keys

\n

{{action}} helpers called in element space can specify modifier keys.\nBy default the {{action}} helper will ignore click events with pressed modifier\nkeys. You can supply an allowedKeys option to specify which keys should not be ignored.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="alt"}}>\n  click me\n</div>
\n
\n
\n \n

This way the action will fire when clicking with the alt key pressed down.\nAlternatively, supply "any" to the allowedKeys option to accept any combination of modifier keys.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="any"}}>\n  click me with any key pressed\n</div>
\n
\n
\n \n

Specifying a Target

\n

A target option can be provided to the helper to change\nwhich object will receive the method call. This option must be a path\nto an object, accessible in the current context:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<div {{action "anActionName" target=someService}}>\n  click me\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n
import Controller from '@ember/controller';\nimport { service } from '@ember/service';\n\nexport default class extends Controller {\n  @service someService;\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "action", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/array.ts", + "line": 5, + "description": "

Use the {{array}} helper to create an array to pass as an option to your\ncomponents.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<MyComponent @people={{array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson}}\n/>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{my-component people=(array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson)\n}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Tom Dale', 'Yehuda Katz', this.get('myOtherPerson')]
\n
\n
\n \n

Where the 3rd item in the array is bound to updates of the myOtherPerson property.

\n", + "itemtype": "method", + "name": "array", + "params": [ + { + "name": "options", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "Array", + "type": "Array" + }, + "since": "3.8.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/component.ts", + "line": 5, + "description": "

The {{component}} helper lets you add instances of Component to a\ntemplate. See Component for\nadditional information on how a Component functions.\n{{component}}'s primary use is for cases where you want to dynamically\nchange which type of component is rendered as the state of your application\nchanges. This helper has three modes: inline, block, and nested.

\n

Inline Form

\n

Given the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/application.hbs
1\n
{{component this.infographicComponentName}}
\n
\n
\n \n

And the following application code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Controller from '@ember/controller';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

The live-updating-chart component will be appended when isMarketOpen is\ntrue, and the market-close-summary component will be appended when\nisMarketOpen is false. If the value changes while the app is running,\nthe component will be automatically swapped out accordingly.\nNote: You should not use this helper when you are consistently rendering the same\ncomponent. In that case, use standard component syntax, for example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LiveUpdatingChart />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{live-updating-chart}}
\n
\n
\n \n

Block Form

\n

Using the block form of this helper is similar to using the block form\nof a component. Given the following application template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
{{#component this.infographicComponentName}}\n  Last update: {{this.lastUpdateTimestamp}}\n{{/component}}
\n
\n
\n \n

The following controller code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Controller from '@ember/controller';\nimport { computed } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get lastUpdateTimestamp() {\n    return new Date();\n  }\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

And the following component template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
chart.hbs
1\n2\n
{{! chart }}\n{{yield}}
\n
\n
\n \n

The Last Update: {{this.lastUpdateTimestamp}} will be rendered in place of the {{yield}}.

\n

Nested Usage

\n

The component helper can be used to package a component path with initial attrs.\nThe included attrs can then be merged during the final invocation.\nFor example, given a person-form component with the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.hbs
1\n2\n3\n
{{yield (hash\n  nameInput=(component "my-input-component" value=@model.name placeholder="First Name")\n)}}
\n
\n
\n \n

When yielding the component via the hash helper, the component is invoked directly.\nSee the following snippet:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonForm as |form|>\n  <form.nameInput @placeholder="Username" />\n</PersonForm>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-form as |form|}}\n  {{form.nameInput placeholder="Username"}}\n{{/person-form}}
\n
\n
\n \n

Which outputs an input whose value is already bound to model.name and placeholder\nis "Username".

\n

When yielding the component without the hash helper use the component helper.\nFor example, below is a full-name component template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{yield (component "my-input-component" value=@model.name placeholder="Name")}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<FullName as |field|>\n  {{component field placeholder="Full name"}}\n</FullName>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#full-name as |field|}}\n  {{component field placeholder="Full name"}}\n{{/full-name}}
\n
\n
\n \n", + "itemtype": "method", + "name": "component", + "since": "1.11.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/concat.ts", + "line": 5, + "description": "

Concatenates the given arguments into a string.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{some-component name=(concat firstName " " lastName)}}\n\n{{! would pass name="<first name value> <last name value>" to the component}}
\n
\n
\n \n

or for angle bracket invocation, you actually don't need concat at all.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @name="{{firstName}} {{lastName}}" />
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "concat", + "since": "1.13.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 13, + "description": "

The {{#each}} helper loops over elements in a collection. It is an extension\nof the base Handlebars {{#each}} helper.

\n

The default behavior of {{#each}} is to yield its inner block once for every\nitem in an array passing the item as the first block parameter.

\n

Assuming the @developers argument contains this array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
[{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }];
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

The same rules apply to arrays of primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Yehuda', 'Tom', 'Paul']
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developerNames as |name|}}\n    <li>Hello, {{name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

During iteration, the index of each item in the array is provided as a second block\nparameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person index|}}\n    <li>Hello, {{person.name}}! You're number {{index}} in line</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

Specifying Keys

\n

In order to improve rendering speed, Ember will try to reuse the DOM elements\nwhere possible. Specifically, if the same item is present in the array both\nbefore and after the change, its DOM output will be reused.

\n

The key option is used to tell Ember how to determine if the items in the\narray being iterated over with {{#each}} has changed between renders. By\ndefault the item's object identity is used.

\n

This is usually sufficient, so in most cases, the key option is simply not\nneeded. However, in some rare cases, the objects' identities may change even\nthough they represent the same underlying data.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
people.map(person => {\n  return { ...person, type: 'developer' };\n});
\n
\n
\n \n

In this case, each time the people array is map-ed over, it will produce\nan new array with completely different objects between renders. In these cases,\nyou can help Ember determine how these objects related to each other with the\nkey option:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers key="name" as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

By doing so, Ember will use the value of the property specified (person.name\nin the example) to find a "match" from the previous render. That is, if Ember\nhas previously seen an object from the @developers array with a matching\nname, its DOM elements will be re-used.

\n

There are two special values for key:

\n
    \n
  • @index - The index of the item in the array.
  • \n
  • @identity - The item in the array itself.
  • \n
\n

{{else}} condition

\n

{{#each}} can have a matching {{else}}. The contents of this block will render\nif the collection is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<ul>\n  {{#each @developers as |person|}}\n    <li>{{person.name}} is available!</li>\n  {{else}}\n    <li>Sorry, nobody is available for this task.</li>\n  {{/each}}\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 124, + "description": "

The {{each-in}} helper loops over properties on an object.

\n

For example, given this component definition:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    "name": "Shelly Sails",\n    "age": 42\n  };\n}
\n
\n
\n \n

This template would display all properties on the developer\nobject in a list:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.hbs
1\n2\n3\n4\n5\n
<ul>\n  {{#each-in this.developer as |key value|}}\n    <li>{{key}}: {{value}}</li>\n  {{/each-in}}\n</ul>
\n
\n
\n \n

Outputting their name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<ul>\n  <li>name: Shelly Sails</li>\n  <li>age: 42</li>\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each-in", + "access": "public", + "tagname": "", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/fn.ts", + "line": 5, + "description": "

The fn helper allows you to ensure a function that you are passing off\nto another component, helper, or modifier has access to arguments that are\navailable in the template.

\n

For example, if you have an each helper looping over a number of items, you\nmay need to pass a function that expects to receive the item as an argument\nto a component invoked within the loop. Here's how you could use the fn\nhelper to pass both the function and its arguments together:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
listing.hbs
1\n2\n3\n
{{#each @items as |item|}}\n<DisplayItem @item=item @select={{fn this.handleSelected item}} />\n{{/each}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class ItemsList extends Component {\n  @action\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this case the display-item component will receive a normal function\nthat it can invoke. When it invokes the function, the handleSelected\nfunction will receive the item and any arguments passed, thanks to the\nfn helper.

\n

Let's take look at what that means in a couple circumstances:

\n
    \n
  • When invoked as this.args.select() the handleSelected function will\nreceive the item from the loop as its first and only argument.
  • \n
  • When invoked as this.args.select('foo') the handleSelected function\nwill receive the item from the loop as its first argument and the\nstring 'foo' as its second argument.
  • \n
\n

In the example above, we used @action to ensure that handleSelected is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class ItemsList extends Component {\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when handleSelected is invoked inside the display-item\ncomponent, it will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into fn!

\n

See also partial application.

\n", + "itemtype": "method", + "name": "fn", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/get.ts", + "line": 5, + "description": "

Dynamically look up a property on an object or an element in an array.\nThe second argument to {{get}} should have a string or number value,\nalthough it can be bound.

\n

For example, these two usages are equivalent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{this.developer.name}}\n{{get this.developer "name"}}
\n
\n
\n \n

If there were several facts about a person, the {{get}} helper can dynamically\npick one:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<DeveloperDetail @factName="language" />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.developer @factName}}
\n
\n
\n \n

For a more complex example, this template would allow the user to switch\nbetween showing the user's name and preferred coding language with a click:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n\n  @tracked currentFact = 'name'\n\n  @action\n  showFact(fact) {\n    this.currentFact = fact;\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
{{get this.developer this.currentFact}}\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

The {{get}} helper can also respect mutable values itself. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
<Input @value={{mut (get this.person this.currentFact)}} />\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

Would allow the user to swap what fact is being displayed, and also edit\nthat fact via a two-way mutable binding.

\n

The {{get}} helper can also be used for array element access via index.\nThis would display the value of the first element in the array this.names:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names 0}}
\n
\n
\n \n

Array element access also works with a dynamic second argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names @index}}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "get", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/hash.ts", + "line": 5, + "description": "

Use the {{hash}} helper to create a hash to pass as an option to your\ncomponents. This is specially useful for contextual components where you can\njust yield a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{yield (hash\n   name='Sarah'\n   title=office\n)}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ name: 'Sarah', title: this.get('office') }
\n
\n
\n \n

Where the title is bound to updates of the office property.

\n

Note that the hash is an empty object with no prototype chain, therefore\ncommon methods like toString are not available in the resulting hash.\nIf you need to use such a method, you can use the call or apply\napproach:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
function toString(obj) {\n  return Object.prototype.toString.apply(obj);\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "Hash", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 5, + "description": "

The if helper allows you to conditionally render one of two branches,\ndepending on the "truthiness" of a property.\nFor example the following values are all falsey: false, undefined, null, "", 0, NaN or an empty array.

\n

This helper has two forms, block and inline.

\n

Block form

\n

You can use the block form of if to conditionally render a section of the template.

\n

To use it, pass the conditional value to the if helper,\nusing the block form to wrap the section of template you want to conditionally render.\nLike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n
{{! will not render because greeting is undefined}}\n{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{/if}}
\n
\n
\n \n

You can also define what to show if the property is falsey by using\nthe else helper.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n
{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{else}}\n  No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

You are also able to combine else and if helpers to create more complex\nconditional logic.

\n

For the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if @isRaining}}\n Yes, grab an umbrella!\n{{else if @isCold}}\n Grab a coat, it's chilly!\n{{else}}\n No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

If you call it by saying isCold is true:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather @isCold={{true}} />
\n
\n
\n \n

Then Grab a coat, it's chilly! will be rendered.

\n

Inline form

\n

The inline if helper conditionally renders a single property or string.

\n

In this form, the if helper receives three arguments, the conditional value,\nthe value to render when truthy, and the value to render when falsey.

\n

For example, if useLongGreeting is truthy, the following:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{true}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{if @useLongGreeting "Hello" "Hi"}} Alex
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hello Alex
\n
\n
\n \n

One detail to keep in mind is that both branches of the if helper will be evaluated,\nso if you have {{if condition "foo" (expensive-operation "bar"),\nexpensive-operation will always calculate.

\n", + "itemtype": "method", + "name": "if", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 97, + "description": "

The unless helper is the inverse of the if helper. It displays if a value\nis falsey ("not true" or "is false"). Example values that will display with\nunless: false, undefined, null, "", 0, NaN or an empty array.

\n

Inline form

\n

The inline unless helper conditionally renders a single property or string.\nThis helper acts like a ternary operator. If the first property is falsy,\nthe second argument will be displayed, otherwise, the third argument will be\ndisplayed

\n

For example, if you pass a falsey useLongGreeting to the Greeting component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{false}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{unless @useLongGreeting "Hi" "Hello"}} Ben
\n
\n
\n \n

Then it will display:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hi Ben
\n
\n
\n \n

Block form

\n

Like the if helper, the unless helper also has a block form.

\n

The following will not render anything:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n2\n3\n
{{#unless @greeting}}\n  No greeting was found. Why not set one?\n{{/unless}}
\n
\n
\n \n

You can also use an else helper with the unless block. The\nelse will display if the value is truthy.

\n

If you have the following component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
in.hbs
1\n2\n3\n4\n5\n
{{#unless @userData}}\n  Please login.\n{{else}}\n  Welcome back!\n{{/unless}}
\n
\n
\n \n

Calling it with a truthy userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{hash username="Zoey"}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Welcome back!
\n
\n
\n \n

and calling it with a falsey userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{false}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Please login.
\n
\n
\n \n", + "itemtype": "method", + "name": "unless", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/log.ts", + "line": 5, + "description": "

log allows you to output the value of variables in the current rendering\ncontext. log also accepts primitive types such as strings or numbers.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{log "myVariable:" myVariable }}
\n
\n
\n \n", + "itemtype": "method", + "name": "log", + "params": [ + { + "name": "params", + "description": "", + "type": "Array" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/mut.ts", + "line": 9, + "description": "

The mut helper lets you clearly specify that a child Component can update the\n(mutable) value passed to it, which will change the value of the parent component.

\n

To specify that a parameter is mutable, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{fn (mut totalClicks)}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(mut totalClicks)}}
\n
\n
\n \n

The child Component can then modify the parent's value just by modifying its own\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

Note that for curly components ({{my-component}}) the bindings are already mutable,\nmaking the mut unnecessary.

\n

Additionally, the mut helper can be combined with the fn helper to\nmutate a value. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=totalClicks click-count-change=(fn (mut totalClicks))}}
\n
\n
\n \n

The child Component would invoke the function with the new click value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.get('click-count-change')(this.get('childClickCount') + 1);\n  }\n});
\n
\n
\n \n

The mut helper changes the totalClicks value to what was provided as the fn argument.

\n

The mut helper, when used with fn, will return a function that\nsets the value passed to mut to its first argument. As an example, we can create a\nbutton that increments a value passing the value directly to the fn:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{! inc helper is not provided by Ember }}\n<button onclick={{fn (mut count) (inc count)}}>\n  Increment count\n</button>
\n
\n
\n \n", + "itemtype": "method", + "name": "mut", + "params": [ + { + "name": "attr", + "description": "the \"two-way\" attribute that can be modified.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/page-title.ts", + "line": 5, + "description": "

page-title allows you to set the title of any page in your application and\nappend additional titles for each route. For complete documentation, see\nhttps://github.com/ember-cli/ember-page-title.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{page-title "My Page Title" }}
\n
\n
\n \n", + "itemtype": "method", + "name": "page-title", + "params": [ + { + "name": "param", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/readonly.ts", + "line": 9, + "description": "

The readonly helper let's you specify that a binding is one-way only,\ninstead of two-way.\nWhen you pass a readonly binding from an outer context (e.g. parent component),\nto to an inner context (e.g. child component), you are saying that changing that\nproperty in the inner context does not change the value in the outer context.

\n

To specify that a binding is read-only, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n
export default Component.extend({\n  totalClicks: 3\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} // -> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Now, when you update childClickCount:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n
export default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

The value updates in the child component, but not the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClickCount}} //-> 4
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Objects and Arrays

\n

When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string),\nonly the reference to the object is protected using the readonly helper.\nThis means that you can change properties of the object both on the parent component, as well as the child component.\nThe readonly binding behaves similar to the const keyword in JavaScript.

\n

Let's look at an example:

\n

First let's set up the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  clicks: null,\n\n  init() {\n    this._super(...arguments);\n    this.set('clicks', { total: 3 });\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n

Now, if you update the total property of childClicks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    this.get('clicks').incrementProperty('total');\n  }\n});
\n
\n
\n \n

You will see the following happen:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClicks.total}} //-> 4
\n
\n
\n \n", + "itemtype": "method", + "name": "readonly", + "params": [ + { + "name": "attr", + "description": "the read-only attribute.", + "type": "Object", + "optional": true + } + ], + "access": "private", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unbound.ts", + "line": 10, + "description": "

The {{unbound}} helper disconnects the one-way binding of a property,\nessentially freezing its value at the moment of rendering. For example,\nin this example the display of the variable name will not change even\nif it is set with a new value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{unbound this.name}}
\n
\n
\n \n

Like any helper, the unbound helper can accept a nested helper expression.\nThis allows for custom helpers to be rendered unbound:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{unbound (some-custom-helper)}}\n{{unbound (capitalize this.name)}}\n{{! You can use any helper, including unbound, in a nested expression }}\n{{capitalize (unbound this.name)}}
\n
\n
\n \n

The unbound helper only accepts a single argument, and it return an\nunbound value.

\n", + "itemtype": "method", + "name": "unbound", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/modifiers/on.ts", + "line": 5, + "description": "

The {{on}} modifier lets you easily add event listeners (it uses\nEventTarget.addEventListener\ninternally).

\n

For example, if you'd like to run a function on your component when a <button>\nin the components template is clicked you might do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' this.saveLike}}>Like this post!</button>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class LikePostComponent extends Component {\n  @action\n  saveLike() {\n    // someone likes your post!\n    // better send a request off to your server...\n  }\n}
\n
\n
\n \n

Arguments

\n

{{on}} accepts two positional arguments, and a few named arguments.

\n

The positional arguments are:

\n
    \n
  • event -- the name to use when calling addEventListener
  • \n
  • callback -- the function to be passed to addEventListener
  • \n
\n

The named arguments are:

\n
    \n
  • capture -- a true value indicates that events of this type will be dispatched\nto the registered listener before being dispatched to any EventTarget beneath it\nin the DOM tree.
  • \n
  • once -- indicates that the listener should be invoked at most once after being\nadded. If true, the listener would be automatically removed when invoked.
  • \n
  • passive -- if true, indicates that the function specified by listener will never\ncall preventDefault(). If a passive listener does call preventDefault(), the user\nagent will do nothing other than generate a console warning. See\nImproving scrolling performance with passive listeners\nto learn more.
  • \n
\n

The callback function passed to {{on}} will receive any arguments that are passed\nto the event handler. Most commonly this would be the event itself.

\n

If you would like to pass additional arguments to the function you should use\nthe {{fn}} helper.

\n

For example, in our example case above if you'd like to pass in the post that\nwas being liked when the button is clicked you could do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' (fn this.saveLike @post)}}>Like this post!</button>
\n
\n
\n \n

In this case, the saveLike function will receive two arguments: the click event\nand the value of @post.

\n

Function Context

\n

In the example above, we used @action to ensure that likePost is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class LikePostComponent extends Component {\n  saveLike() {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when the button is clicked saveLike will be invoked,\nit will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into on!

\n", + "itemtype": "method", + "name": "on", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/in-element.ts", + "line": 5, + "description": "

The in-element helper renders its block content outside of the regular flow,\ninto a DOM element given by its destinationElement positional argument.

\n

Common use cases - often referred to as "portals" or "wormholes" - are rendering\ndropdowns, modals or tooltips close to the root of the page to bypass CSS overflow\nrules, or to render content to parts of the page that are outside of the control\nof the Ember app itself (e.g. embedded into a static or server rendered HTML page).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#in-element this.destinationElement}}\n  <div>Some content</div>\n{{/in-element}}
\n
\n
\n \n

Arguments

\n

{{in-element}} requires a single positional argument:

\n
    \n
  • destinationElement -- the DOM element to render into. It must exist at the time\nof rendering.
  • \n
\n

It also supports an optional named argument:

\n
    \n
  • insertBefore -- by default the DOM element's content is replaced when used as\ndestinationElement. Passing null changes the behaviour to appended at the end\nof any existing content. Any other value than null is currently not supported.
  • \n
\n", + "itemtype": "method", + "name": "in-element", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/let.ts", + "line": 5, + "description": "

The let helper receives one or more positional arguments and yields\nthem out as block params.

\n

This allows the developer to introduce shorter names for certain computations\nin the template.

\n

This is especially useful if you are passing properties to a component\nthat receives a lot of options and you want to clean up the invocation.

\n

For the following example, the template receives a post object with\ncontent and title properties.

\n

We are going to call the my-post component, passing a title which is\nthe title of the post suffixed with the name of the blog, the content\nof the post, and a series of options defined in-place.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n    (concat post.title ' | The Ember.js Blog')\n    post.content\n    (hash\n      theme="high-contrast"\n      enableComments=true\n    )\n    as |title content options|\n}}\n  <MyPost @title={{title}} @content={{content}} @options={{options}} />\n{{/let}}
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n  (concat post.title ' | The Ember.js Blog')\n  post.content\n  (hash\n    theme="high-contrast"\n    enableComments=true\n  )\n  as |title content options|\n}}\n{{my-post title=title content=content options=options}}\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "let", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/mount.ts", + "line": 13, + "description": "

The {{mount}} helper lets you embed a routeless engine in a template.\nMounting an engine will cause an instance to be booted and its application\ntemplate to be rendered.

\n

For example, the following template mounts the ember-chat engine:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! application.hbs }}\n{{mount "ember-chat"}}
\n
\n
\n \n

Additionally, you can also pass in a model argument that will be\nset as the engines model. This can be an existing object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div>\n  {{mount 'admin' model=userSettings}}\n</div>
\n
\n
\n \n

Or an inline hash, and you can even pass components:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>\n  <h1>Application template!</h1>\n  {{mount 'admin' model=(hash\n      title='Secret Admin'\n      signInButton=(component 'sign-in-button')\n  )}}\n</div>
\n
\n
\n \n", + "itemtype": "method", + "name": "mount", + "params": [ + { + "name": "name", + "description": "Name of the engine to mount.", + "type": "String" + }, + { + "name": "model", + "description": "Object that will be set as\n the model of the engine.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/outlet.ts", + "line": 20, + "description": "

The {{outlet}} helper lets you specify where a child route will render in\nyour template. An important use of the {{outlet}} helper is in your\napplication's application.hbs file:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n7\n8\n
<MyHeader />\n\n<div class="my-dynamic-content">\n  <!-- this content will change based on the current route, which depends on the current URL -->\n  {{outlet}}\n</div>\n\n<MyFooter />
\n
\n
\n \n

See the routing guide for more\ninformation on how your route interacts with the {{outlet}} helper.\nNote: Your content will not render if there isn't an {{outlet}} for it.

\n", + "itemtype": "method", + "name": "outlet", + "params": [ + { + "name": "name", + "description": "", + "type": "String", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 91, + "description": "

{{yield}} denotes an area of a template that will be rendered inside\nof another template.

\n

Use with Component

\n

When designing components {{yield}} is used to denote where, inside the component's\ntemplate, an optional block passed to the component should render:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<LabeledTextfield @value={{@model.name}}>\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<label>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n

Additionally you can yield properties into the context for use by the consumer:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n
<LabeledTextfield @value={{@model.validation}} @validator={{this.firstNameValidator}} as |validationError|>\n  {{#if validationError}}\n    <p class="error">{{validationError}}</p>\n  {{/if}}\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield this.validationError}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<label>\n  <p class="error">First Name must be at least 3 characters long.</p>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n", + "itemtype": "method", + "name": "yield", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "return": { + "description": "HTML string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 152, + "description": "

{{(has-block)}} indicates if the component was invoked with a block.

\n

This component is invoked with a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component}}
\n
\n
\n \n

Using angle bracket invocation, this looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent>Hi Jen!</MyComponent> {{! with a block}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent/> {{! without a block}}
\n
\n
\n \n

This is useful when you want to create a component that can optionally take a block\nand then render a default template when it is not invoked with a block.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n
{{#if (has-block)}}\n  Welcome {{yield}}, we are happy you're here!\n{{else}}\n  Hey you! You're great!\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with a block", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 197, + "description": "

{{(has-block-params)}} indicates if the component was invoked with block params.

\n

This component is invoked with block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component as |favoriteFlavor|}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jenn!\n{{/my-component}}
\n
\n
\n \n

With angle bracket syntax, block params look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent as |favoriteFlavor|>\nHi Jen!\n</MyComponent>
\n
\n
\n \n

And without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent>\n  Hi Jen!\n</MyComponent>
\n
\n
\n \n

This is useful when you want to create a component that can render itself\ndifferently when it is not invoked with block params.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if (has-block-params)}}\n  Welcome {{yield this.favoriteFlavor}}, we're happy you're here and hope you\n  enjoy your favorite ice cream flavor.\n{{else}}\n  Welcome {{yield}}, we're happy you're here, but we're unsure what\n  flavor ice cream you would enjoy.\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block-params", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with block params", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 252, + "description": "

Execute the debugger statement in the current template's context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{debugger}}
\n
\n
\n \n

When using the debugger helper you will have access to a get function. This\nfunction retrieves values available in the context of the template.\nFor example, if you're wondering why a value {{foo}} isn't rendering as\nexpected within a template, you could place a {{debugger}} statement and,\nwhen the debugger; breakpoint is hit, you can attempt to retrieve this value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('foo')
\n
\n
\n \n

get is also aware of keywords. So in this situation

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#each this.items as |item|}}\n  {{debugger}}\n{{/each}}
\n
\n
\n \n

You'll be able to get values from the current item:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('item.name')
\n
\n
\n \n

You can also access the context of the view to make sure it is the object that\nyou expect:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> context
\n
\n
\n \n", + "itemtype": "method", + "name": "debugger", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.Test-38e0f492cb.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.Test-38e0f492cb.json new file mode 100644 index 000000000..3f550f60b --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.Test-38e0f492cb.json @@ -0,0 +1,147 @@ +{ + "data": { + "id": "ember-4.3.0-Ember.Test", + "type": "class", + "attributes": { + "name": "Ember.Test", + "shortname": "Ember.Test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/ember-testing/lib/test.js", + "line": 11, + "description": "

This is a container for an assortment of testing related functionality:

\n
    \n
  • Choose your default test adapter (for your framework of choice).
  • \n
  • Register/Unregister additional test helpers.
  • \n
  • Setup callbacks to be fired when the test helpers are injected into\nyour application.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/ember-testing/lib/test/on_inject_helpers.js", + "line": 3, + "description": "

Used to register callbacks to be fired whenever App.injectTestHelpers\nis called.

\n

The callback will receive the current application as an argument.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import $ from 'jquery';\n\nEmber.Test.onInjectHelpers(function() {\n  $(document).ajaxSend(function() {\n    Test.pendingRequests++;\n  });\n\n  $(document).ajaxComplete(function() {\n    Test.pendingRequests--;\n  });\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "onInjectHelpers", + "params": [ + { + "name": "callback", + "description": "The function to be called.", + "type": "Function" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.js", + "line": 21, + "description": "

This returns a thenable tailored for testing. It catches failed\nonSuccess callbacks and invokes the Ember.Test.adapter.exception\ncallback in the last chained then.

\n

This method should be returned by async helpers such as wait.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "promise", + "params": [ + { + "name": "resolver", + "description": "The function used to resolve the promise.", + "type": "Function" + }, + { + "name": "label", + "description": "An optional string for identifying the promise.", + "type": "String" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.js", + "line": 39, + "description": "

Replacement for Ember.RSVP.resolve\nThe only difference is this uses\nan instance of Ember.Test.Promise

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "The", + "description": "value to resolve", + "type": "Mixed" + } + ], + "since": "1.2.0", + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/setup_for_testing.js", + "line": 8, + "description": "

Sets Ember up for testing. This is useful to perform\nbasic setup steps in order to unit test.

\n

Use App.setupForTesting to perform integration tests (full\napplication testing).

\n", + "itemtype": "method", + "name": "setupForTesting", + "since": "1.5.0", + "access": "private", + "tagname": "", + "class": "Ember.Test", + "module": "@ember/test", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/test.js", + "line": 24, + "description": "

Hash containing all known test helpers.

\n", + "itemtype": "property", + "name": "_helpers", + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/ember-testing/lib/test.js", + "line": 45, + "description": "

Used to allow ember-testing to communicate with a specific testing\nframework.

\n

You can manually set it before calling App.setupForTesting().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Ember.Test.adapter = MyCustomAdapter.create()
\n
\n
\n \n

If you do not set it, ember-testing will default to Ember.Test.QUnitAdapter.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "adapter", + "type": "{Class} The adapter to be used.", + "default": "Ember.Test.QUnitAdapter", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.ViewMixin-a7e2febe1f.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.ViewMixin-a7e2febe1f.json new file mode 100644 index 000000000..2baaeb7fb --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Ember.ViewMixin-a7e2febe1f.json @@ -0,0 +1,304 @@ +{ + "data": { + "id": "ember-4.3.0-Ember.ViewMixin", + "type": "class", + "attributes": { + "name": "Ember.ViewMixin", + "shortname": "Ember.ViewMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 420, + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 70, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 96, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 116, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 156, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 214, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 299, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 373, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 407, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 268, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 276, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 289, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 313, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 326, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 334, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 12, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 141, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 235, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.js", + "line": 346, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-EmberArray-809404702f.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-EmberArray-809404702f.json new file mode 100644 index 000000000..890695ce7 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-EmberArray-809404702f.json @@ -0,0 +1,836 @@ +{ + "data": { + "id": "ember-4.3.0-EmberArray", + "type": "class", + "attributes": { + "name": "EmberArray", + "shortname": "EmberArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "MutableArray" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 179, + "description": "

This mixin implements Observer-friendly Array-like behavior. It is not a\nconcrete implementation, but it can be used up by other classes that want\nto appear like arrays.

\n

For example, ArrayProxy is a concrete class that can be instantiated to\nimplement array-like behavior. This class uses the Array Mixin by way of\nthe MutableArray mixin, which allows observable changes to be made to the\nunderlying array.

\n

This mixin defines methods specifically for collections that provide\nindex-ordered access to their contents. When you are designing code that\nneeds to accept any kind of Array-like object, you should use these methods\ninstead of Array primitives because these will properly notify observers of\nchanges to the array.

\n

Although these methods are efficient, they do add a layer of indirection to\nyour application so it is a good idea to use them only when you need the\nflexibility of using both true JavaScript arrays and "virtual" arrays such\nas controllers and collections.

\n

You can use the methods defined in this module to access and modify array\ncontents in an observable-friendly way. You can also be notified whenever\nthe membership of an array changes by using .observes('myArray.[]').

\n

To support EmberArray in your own class, you must override two\nprimitives to use it: length() and objectAt().

\n", + "uses": [ + "Enumerable" + ], + "since": "Ember 0.9.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1117, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1155, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1167, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1183, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1216, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1260, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1279, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1301, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-EmberObject-89cb64719c.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-EmberObject-89cb64719c.json new file mode 100644 index 000000000..a13740366 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-EmberObject-89cb64719c.json @@ -0,0 +1,596 @@ +{ + "data": { + "id": "ember-4.3.0-EmberObject", + "type": "class", + "attributes": { + "name": "EmberObject", + "shortname": "EmberObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/object.js", + "line": 13, + "description": "

EmberObject is the main base class for all Ember objects. It is a subclass\nof CoreObject with the Observable mixin applied. For details,\nsee the documentation for each of these.

\n", + "extends": "CoreObject", + "uses": [ + "Observable" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.3.0-ContainerDebugAdapter" + }, + { + "type": "class", + "id": "ember-4.3.0-DataAdapter" + }, + { + "type": "class", + "id": "ember-4.3.0-HashLocation" + }, + { + "type": "class", + "id": "ember-4.3.0-HistoryLocation" + }, + { + "type": "class", + "id": "ember-4.3.0-NoneLocation" + }, + { + "type": "class", + "id": "ember-4.3.0-Route" + }, + { + "type": "class", + "id": "ember-4.3.0-EmberRouter" + }, + { + "type": "class", + "id": "ember-4.3.0-ArrayProxy" + }, + { + "type": "class", + "id": "ember-4.3.0-Namespace" + }, + { + "type": "class", + "id": "ember-4.3.0-ObjectProxy" + }, + { + "type": "class", + "id": "ember-4.3.0-Ember.CoreView" + }, + { + "type": "class", + "id": "ember-4.3.0-Controller" + }, + { + "type": "class", + "id": "ember-4.3.0-EngineInstance" + }, + { + "type": "class", + "id": "ember-4.3.0-Service" + } + ] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-EmberRouter-7846337a35.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-EmberRouter-7846337a35.json new file mode 100644 index 000000000..522552e27 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-EmberRouter-7846337a35.json @@ -0,0 +1,1192 @@ +{ + "data": { + "id": "ember-4.3.0-EmberRouter", + "type": "class", + "attributes": { + "name": "EmberRouter", + "shortname": "EmberRouter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 143, + "description": "

The EmberRouter class manages the application state and URLs. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 222, + "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

The first parameter is the name of the route which is used by default as the\npath name as well.

\n

The 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\nsegments.
  • \n
  • resetNamespace: false by default; when nesting routes, ember will\ncombine the route names to form the fully-qualified route name, which is\nused with {{link-to}} or manually transitioning to routes. Setting\nresetNamespace: true will cause the route not to inherit from its\nparent route's names. This is handy for preventing extremely long route names.\nKeep in mind that the actual URL path behavior is still retained.
  • \n
\n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
Router.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
\n
\n \n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 551, + "description": "

Initializes the current router instance and sets up the change handling\nevent listeners used by the instances location implementation.

\n

A property named initialURL will be used to determine the initial URL.\nIf no value is found / will be used.

\n", + "itemtype": "method", + "name": "startRouting", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 674, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 719, + "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", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 746, + "description": "

Determines if the supplied route is currently active.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 758, + "description": "

An alternative form of isActive that doesn't require\nmanual concatenation of the arguments into a single\narray.

\n", + "itemtype": "method", + "name": "isActiveIntent", + "params": [ + { + "name": "routeName", + "description": "" + }, + { + "name": "models", + "description": "" + }, + { + "name": "queryParams", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 780, + "description": "

Does this router instance have the given route.

\n", + "itemtype": "method", + "name": "hasRoute", + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 791, + "description": "

Resets the state of the router by clearing the current route\nhandlers and deactivating them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 937, + "description": "

Serializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Arrray" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 967, + "description": "

Serializes the value of a query parameter based on a type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "type", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 985, + "description": "

Deserializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1013, + "description": "

Deserializes the value of a query parameter based on a default type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "defaultType", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1034, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_pruneDefaultQueryParamValues", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1115, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareQueryParams", + "params": [ + { + "name": "targetRouteName", + "description": "", + "type": "String" + }, + { + "name": "models", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + }, + { + "name": "keepDefaultQueryParamValues", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1142, + "description": "

Returns the meta information for the query params of a given route. This\nwill be overridden to allow support for lazy routes.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getQPMeta", + "params": [ + { + "name": "routeInfo", + "description": "", + "type": "RouteInfo" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1156, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_queryParamsFor", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1218, + "description": "

Maps all query param keys to their fully scoped property name of the form\ncontrollerName:propName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_fullyScopeQueryParams", + "params": [ + { + "name": "leafRouteName", + "description": "", + "type": "String" + }, + { + "name": "contexts", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1256, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_hydrateUnsuppliedQueryParams", + "params": [ + { + "name": "state", + "description": "", + "type": "TransitionState" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1427, + "description": "

Handles updating the paths and notifying any listeners of the URL\nchange.

\n

Triggers the router level didTransition hook.

\n

For example, to notify google analytics when the route changes,\nyou could use this hook. (Note: requires also including GA scripts, etc.)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "didTransition", + "access": "private", + "tagname": "", + "since": "1.2.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1464, + "description": "

Handles notifying any listeners of an impending URL\nchange.

\n

Triggers the router level willTransition hook.

\n", + "itemtype": "method", + "name": "willTransition", + "access": "private", + "tagname": "", + "since": "1.11.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 54, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 80, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 101, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 124, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 139, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 153, + "description": "

Represents the URL of the root of the application, often '/'. This prefix is\n assumed on all routes defined on this router.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 164, + "description": "

The location property determines the type of URL's that your\n application will use.

\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

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1477, + "description": "

Represents the current URL.

\n", + "itemtype": "property", + "name": "url", + "type": "{String}", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Engine-841c315a05.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Engine-841c315a05.json new file mode 100644 index 000000000..cc7be2313 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Engine-841c315a05.json @@ -0,0 +1,243 @@ +{ + "data": { + "id": "ember-4.3.0-Engine", + "type": "class", + "attributes": { + "name": "Engine", + "shortname": "Engine", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/index.js", + "line": 30, + "description": "

The Engine class contains core functionality for both applications and\nengines.

\n

Each engine manages a registry that's used for dependency injection and\nexposed through RegistryProxy.

\n

Engines also manage initializers and instance initializers.

\n

Engines can spawn EngineInstance instances via buildInstance().

\n", + "extends": "Ember.Namespace", + "uses": [ + "RegistryProxy" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/engine/index.js", + "line": 61, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 74, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 87, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 100, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 108, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 116, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 127, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 158, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 305, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 378, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 427, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Namespace" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Engine", + "module": "@ember/engine" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/index.js", + "line": 53, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.js", + "line": 418, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.Namespace", + "type": "missing" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.3.0-Application" + } + ] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-EngineInstance-7ef98012a7.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-EngineInstance-7ef98012a7.json new file mode 100644 index 000000000..f957aa92b --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-EngineInstance-7ef98012a7.json @@ -0,0 +1,1002 @@ +{ + "data": { + "id": "ember-4.3.0-EngineInstance", + "type": "class", + "attributes": { + "name": "EngineInstance", + "shortname": "EngineInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/instance.js", + "line": 17, + "description": "

The EngineInstance encapsulates all of the stateful aspects of a\nrunning Engine.

\n", + "access": "public", + "tagname": "", + "extends": "EmberObject", + "uses": [ + "RegistryProxyMixin", + "ContainerProxyMixin" + ], + "methods": [ + { + "file": "packages/@ember/engine/instance.js", + "line": 62, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 124, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 139, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 167, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.js", + "line": 200, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 18, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 31, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 101, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 124, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 134, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 145, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 155, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 165, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 198, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 208, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 23, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 49, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 110, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/instance.js", + "line": 29, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.js", + "line": 15, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.3.0-ApplicationInstance" + } + ] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Evented-05e295721a.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Evented-05e295721a.json new file mode 100644 index 000000000..62b3d7806 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Evented-05e295721a.json @@ -0,0 +1,190 @@ +{ + "data": { + "id": "ember-4.3.0-Evented", + "type": "class", + "attributes": { + "name": "Evented", + "shortname": "Evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Route", + "EmberRouter", + "Ember.CoreView" + ], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 13, + "description": "

This mixin allows for Ember objects to subscribe to and emit events.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/utils/person.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport Evented from '@ember/object/evented';\n\nexport default EmberObject.extend(Evented, {\n  greet() {\n    // ...\n    this.trigger('greet');\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
var person = Person.create();\n\nperson.on('greet', function() {\n  console.log('Our person has greeted');\n});\n\nperson.greet();\n\n// outputs: 'Our person has greeted'
\n
\n
\n \n

You can also chain multiple event subscriptions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
person.on('greet', function() {\n  console.log('Our person has greeted');\n}).one('greet', function() {\n  console.log('Offer one-time special');\n}).off('event', this, forgetThis);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 54, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 80, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 101, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 124, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 139, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-HashLocation-148ef430a3.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-HashLocation-148ef430a3.json new file mode 100644 index 000000000..013fc393b --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-HashLocation-148ef430a3.json @@ -0,0 +1,641 @@ +{ + "data": { + "id": "ember-4.3.0-HashLocation", + "type": "class", + "attributes": { + "name": "HashLocation", + "shortname": "HashLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 11, + "description": "

HashLocation implements the location API using the browser's\nhash. At present, it relies on a hashchange event existing in the\nbrowser.

\n

Using HashLocation results in URLs with a # (hash sign) separating the\nserver side URL portion of the URL from the portion that is used by Ember.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'hash'\n});
\n
\n
\n \n

This will result in a posts.new url of /#/posts/new.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 51, + "access": "private", + "tagname": "Returns normalized location.hash", + "since": "1.5.1", + "itemtype": "method", + "name": "getHash", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 63, + "description": "

Returns the normalized URL, constructed from location.hash.

\n

e.g. #/foo => /foo as well as #/foo#bar => /foo#bar.

\n

By convention, hashed paths must begin with a forward slash, otherwise they\nare not treated as a path so we can distinguish intent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 93, + "description": "

Set the location.hash and remembers what was set. This prevents\nonUpdateURL callbacks from triggering when the hash was set by\nHashLocation.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 107, + "description": "

Uses location.replace to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 122, + "description": "

Register a callback to be invoked when the hash changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 147, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 162, + "description": "

Cleans up the HashLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Helper-83273908c3.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Helper-83273908c3.json new file mode 100644 index 000000000..b13705c6e --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Helper-83273908c3.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.3.0-Helper", + "type": "class", + "attributes": { + "name": "Helper", + "shortname": "Helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 37, + "description": "

Ember Helpers are functions that can compute values, and are used in templates.\nFor example, this code calls a helper named format-currency:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Cost @cents={{230}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/cost.hbs
1\n
<div>{{format-currency @cents currency="$"}}</div>
\n
\n
\n \n

Additionally a helper can be called as a nested helper.\nIn this example, we show the formatted currency value if the showMoney\nnamed argument is truthy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{if @showMoney (format-currency @cents currency="$")}}
\n
\n
\n \n

Helpers defined using a class must provide a compute function. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n6\n7\n
import Helper from '@ember/component/helper';\n\nexport default class extends Helper {\n  compute([cents], { currency }) {\n    return `${currency}${cents * 0.01}`;\n  }\n}
\n
\n
\n \n

Each time the input to a helper changes, the compute function will be\ncalled again.

\n

As instances, these helpers also have access to the container and will accept\ninjected dependencies.

\n

Additionally, class helpers can call recompute to force a new computation.

\n", + "extends": "CoreObject", + "access": "public", + "tagname": "", + "since": "1.13.0", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 83, + "description": "

Override this function when writing a class-based helper.

\n", + "itemtype": "method", + "name": "compute", + "params": [ + { + "name": "params", + "description": "The positional arguments to the helper", + "type": "Array" + }, + { + "name": "hash", + "description": "The named arguments to the helper", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 103, + "description": "

On a class-based helper, it may be useful to force a recomputation of that\nhelpers value. This is akin to rerender on a component.

\n

For example, this component will rerender when the currentUser on a\nsession service changes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
email.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Helper from '@ember/component/helper'\nimport { service } from '@ember/service'\nimport { observer } from '@ember/object'\n\nexport default Helper.extend({\n  session: service(),\n\n  onNewUser: observer('session.currentUser', function() {\n    this.recompute();\n  }),\n\n  compute() {\n    return this.get('session.currentUser.email');\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "recompute", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-HistoryLocation-478ffb946e.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-HistoryLocation-478ffb946e.json new file mode 100644 index 000000000..3f949d0c2 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-HistoryLocation-478ffb946e.json @@ -0,0 +1,707 @@ +{ + "data": { + "id": "ember-4.3.0-HistoryLocation", + "type": "class", + "attributes": { + "name": "HistoryLocation", + "shortname": "HistoryLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 21, + "description": "

HistoryLocation implements the location API using the browser's\nhistory.pushState API.

\n

Using HistoryLocation results in URLs that are indistinguishable from a\nstandard URL. This relies upon the browser's history API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'history'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new.

\n

Keep in mind that your server must serve the Ember app at all the routes you\ndefine.

\n

Using HistoryLocation will also result in location states being recorded by\nthe browser history API with the following schema:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
window.history.state -> { path: '/', uuid: '3552e730-b4a6-46bd-b8bf-d8c3c1a97e0a' }
\n
\n
\n \n

This allows each in-app location state to be tracked uniquely across history\nstate changes via the uuid field.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 79, + "access": "private", + "tagname": "Returns normalized location.hash", + "itemtype": "method", + "name": "getHash", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 105, + "description": "

Used to set state on first call to setURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initState", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 126, + "description": "

Returns the current location.pathname without rootURL or baseURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 153, + "description": "

Uses history.pushState to update the url without a page reload.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 169, + "description": "

Uses history.replaceState to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 186, + "description": "

Pushes a new state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "pushState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 202, + "description": "

Replaces the current state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 218, + "description": "

Register a callback to be invoked whenever the browser\nhistory changes, including using forward and back buttons.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 243, + "description": "

Used when using {{action}} helper. The url is always appended to the rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "formatted url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 267, + "description": "

Cleans up the HistoryLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 71, + "description": "

Will be pre-pended to path upon state change

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Location-f7076a33e7.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Location-f7076a33e7.json new file mode 100644 index 000000000..7ce405a0e --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Location-f7076a33e7.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.3.0-Location", + "type": "class", + "attributes": { + "name": "Location", + "shortname": "Location", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/api.ts", + "line": 21, + "description": "

Location returns an instance of the correct implementation of\nthe location API.

\n

Implementations

\n

You can pass an implementation name (hash, history, none, auto) to force a\nparticular implementation to be used in your application.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n

Location API

\n

Each location implementation must provide the following methods:

\n
    \n
  • implementation: returns the string name used to reference the implementation.
  • \n
  • getURL: returns the current URL.
  • \n
  • setURL(path): sets the current URL.
  • \n
  • replaceURL(path): replace the current URL (optional).
  • \n
  • onUpdateURL(callback): triggers the callback when the URL changes.
  • \n
  • formatURL(url): formats url to be placed into href attribute.
  • \n
  • detect() (optional): instructs the location to do any feature detection\n necessary. If the location needs to redirect to a different URL, it\n can cancel routing by setting the cancelRouterSetup property on itself\n to false.
  • \n
\n

Calling setURL or replaceURL will not trigger onUpdateURL callbacks.

\n

Custom implementation

\n

Ember scans app/locations/* for extending the Location API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import HistoryLocation from '@ember/routing/history-location';\n\nexport default class MyHistory {\n  implementation = 'my-custom-history';\n\n  constructor() {\n    this._history = HistoryLocation.create(...arguments);\n  }\n\n  create() {\n    return new this(...arguments);\n  }\n\n  pushState(path) {\n     this._history.pushState(path);\n  }\n}
\n
\n
\n \n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/api.ts", + "line": 82, + "description": "

This is deprecated in favor of using the container to lookup the location\nimplementation as desired.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
// Given a location registered as follows:\ncontainer.register('location:history-test', HistoryTestLocation);\n\n// You could create a new instance via:\ncontainer.lookup('location:history-test');
\n
\n
\n \n", + "itemtype": "method", + "name": "create", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "an instance of an implementation of the `location` API", + "type": "Object" + }, + "deprecated": true, + "deprecationMessage": "Use the container to lookup the location implementation that you\n need.", + "access": "private", + "tagname": "", + "class": "Location", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Mixin-33919892db.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Mixin-33919892db.json new file mode 100644 index 000000000..6e2241c61 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Mixin-33919892db.json @@ -0,0 +1,75 @@ +{ + "data": { + "id": "ember-4.3.0-Mixin", + "type": "class", + "attributes": { + "name": "Mixin", + "shortname": "Mixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 440, + "description": "

The Mixin class allows you to create mixins, whose properties can be\nadded to other classes. For instance,

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nconst EditableMixin = Mixin.create({\n  edit() {\n    console.log('starting to edit');\n    this.set('isEditing', true);\n  },\n  isEditing: false\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import EmberObject from '@ember/object';\nimport EditableMixin from '../mixins/editable';\n\n// Mix mixins into classes by passing them as the first arguments to\n// `.extend.`\nconst Comment = EmberObject.extend(EditableMixin, {\n  post: null\n});\n\nlet comment = Comment.create({\n  post: somePost\n});\n\ncomment.edit(); // outputs 'starting to edit'
\n
\n
\n \n

Note that Mixins are created with Mixin.create, not\nMixin.extend.

\n

Note that mixins extend a constructor's prototype so arrays and object literals\ndefined as properties will be shared amongst objects that implement the mixin.\nIf you want to define a property in a mixin that is not shared, you can define\nit either as a computed property or have it be created on initialization of the object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
// filters array will be shared amongst any object implementing mixin\nimport Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\nconst FilterableMixin = Mixin.create({\n  filters: A()\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\nimport { computed } from '@ember/object';\n\n// filters will be a separate array for every object implementing the mixin\nconst FilterableMixin = Mixin.create({\n  filters: computed(function() {\n    return A();\n  })\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\n// filters will be created as a separate array during the object's initialization\nconst Filterable = Mixin.create({\n  filters: null,\n\n  init() {\n    this._super(...arguments);\n    this.set("filters", A());\n  }\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 426, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Mixin", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.3.0-Ember.TargetActionSupport" + } + ] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-MutableArray-1b8748f291.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-MutableArray-1b8748f291.json new file mode 100644 index 000000000..ab2e4a21b --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-MutableArray-1b8748f291.json @@ -0,0 +1,1239 @@ +{ + "data": { + "id": "ember-4.3.0-MutableArray", + "type": "class", + "attributes": { + "name": "MutableArray", + "shortname": "MutableArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "ArrayProxy" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1327, + "description": "

This mixin defines the API for modifying array-like objects. These methods\ncan be applied only to a collection that keeps its items in an ordered set.\nIt builds upon the Array mixin and adds methods to modify the array.\nOne concrete implementations of this class include ArrayProxy.

\n

It is important to use the methods in this class to modify arrays so that\nchanges are observable. This allows the binding system in Ember to function\ncorrectly.

\n

Note that an Array can change even if it does not implement this mixin.\nFor example, one might implement a SparseArray that cannot be directly\nmodified, but if its underlying enumerable changes, it will change also.

\n", + "uses": [ + "MutableEnumerable", + "EmberArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1349, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray" + } + ], + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1368, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1394, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1416, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1441, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1461, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1481, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1507, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1532, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1552, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumberable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1573, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1592, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1619, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1647, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1664, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1690, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1117, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1155, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1167, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1183, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1216, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1260, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1279, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1301, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Namespace-281460f032.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Namespace-281460f032.json new file mode 100644 index 000000000..728e4a1a6 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Namespace-281460f032.json @@ -0,0 +1,536 @@ +{ + "data": { + "id": "ember-4.3.0-Namespace", + "type": "class", + "attributes": { + "name": "Namespace", + "shortname": "Namespace", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/namespace.js", + "line": 19, + "description": "

A Namespace is an object usually used to contain other objects or methods\nsuch as an application or framework. Create a namespace anytime you want\nto define one of these new containers.

\n

Example Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
MyFramework = Ember.Namespace.create({\n  VERSION: '1.0.0'\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-NoneLocation-e60c140d56.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-NoneLocation-e60c140d56.json new file mode 100644 index 000000000..72cde658a --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-NoneLocation-e60c140d56.json @@ -0,0 +1,639 @@ +{ + "data": { + "id": "ember-4.3.0-NoneLocation", + "type": "class", + "attributes": { + "name": "NoneLocation", + "shortname": "NoneLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 10, + "description": "

NoneLocation does not interact with the browser. It is useful for\ntesting, or when you need to manage state with your Router, but temporarily\ndon't want it to muck with the URL (for example when you embed your\napplication in a larger page).

\n

Using NoneLocation causes Ember to not store the applications URL state\nin the actual URL. This is generally used for testing purposes, and is one\nof the changes made when calling App.setupForTesting().

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 55, + "description": "

Returns the current path without rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "path", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 72, + "description": "

Set the path and remembers what was set. Using this method\nto change the path will not invoke the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 84, + "description": "

Register a callback to be invoked when the path changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 97, + "description": "

Sets the path and calls the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "handleURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 109, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 31, + "description": "

Will be pre-pended to path.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-ObjectProxy-ae09ffd09e.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-ObjectProxy-ae09ffd09e.json new file mode 100644 index 000000000..22cc58113 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-ObjectProxy-ae09ffd09e.json @@ -0,0 +1,555 @@ +{ + "data": { + "id": "ember-4.3.0-ObjectProxy", + "type": "class", + "attributes": { + "name": "ObjectProxy", + "shortname": "ObjectProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/object_proxy.js", + "line": 4, + "description": "

ObjectProxy forwards all properties not defined by the proxy itself\nto a proxied content object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nlet exampleObject = EmberObject.create({\n  name: 'Foo'\n});\n\nlet exampleProxy = ObjectProxy.create({\n  content: exampleObject\n});\n\n// Access and change existing properties\nexampleProxy.get('name');          // 'Foo'\nexampleProxy.set('name', 'Bar');\nexampleObject.get('name');         // 'Bar'\n\n// Create new 'description' property on `exampleObject`\nexampleProxy.set('description', 'Foo is a whizboo baz');\nexampleObject.get('description');  // 'Foo is a whizboo baz'
\n
\n
\n \n

While content is unset, setting a property to be delegated will throw an\nError.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import ObjectProxy from '@ember/object/proxy';\n\nlet exampleProxy = ObjectProxy.create({\n  content: null,\n  flag: null\n});\nexampleProxy.set('flag', true);\nexampleProxy.get('flag');         // true\nexampleProxy.get('foo');          // undefined\nexampleProxy.set('foo', 'data');  // throws Error
\n
\n
\n \n

Delegated properties can be bound to and will change when content is updated.

\n

Computed properties on the proxy itself can depend on delegated properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { computed } from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nProxyWithComputedProperty = ObjectProxy.extend({\n  fullName: computed('firstName', 'lastName', function() {\n    var firstName = this.get('firstName'),\n        lastName = this.get('lastName');\n    if (firstName && lastName) {\n      return firstName + ' ' + lastName;\n    }\n    return firstName || lastName;\n  })\n});\n\nlet exampleProxy = ProxyWithComputedProperty.create();\n\nexampleProxy.get('fullName');  // undefined\nexampleProxy.set('content', {\n  firstName: 'Tom', lastName: 'Dale'\n}); // triggers property change for fullName on proxy\n\nexampleProxy.get('fullName');  // 'Tom Dale'
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "Ember.ProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.js", + "line": 64, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Observable-0e9aac8181.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Observable-0e9aac8181.json new file mode 100644 index 000000000..b075daee0 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Observable-0e9aac8181.json @@ -0,0 +1,388 @@ +{ + "data": { + "id": "ember-4.3.0-Observable", + "type": "class", + "attributes": { + "name": "Observable", + "shortname": "Observable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "EmberObject" + ], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 21, + "description": "

Overview

\n

This mixin provides properties and property observing functionality, core\nfeatures of the Ember object model.

\n

Properties and observers allow one object to observe changes to a\nproperty on another object. This is one of the fundamental ways that\nmodels, controllers and views communicate with each other in an Ember\napplication.

\n

Any object that has this mixin applied can be used in observer\noperations. That includes EmberObject and most objects you will\ninteract with as you write your Ember application.

\n

Note that you will not generally apply this mixin to classes yourself,\nbut you will use the features provided by this module frequently, so it\nis important to understand how to use it.

\n

Using get() and set()

\n

Because of Ember's support for bindings and observers, you will always\naccess properties using the get method, and set properties using the\nset method. This allows the observing objects to be notified and\ncomputed properties to be handled properly.

\n

More documentation about get and set are below.

\n

Observing Property Changes

\n

You typically observe property changes simply by using the observer\nfunction in classes that you write.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { observer } from '@ember/object';\nimport EmberObject from '@ember/object';\n\nEmberObject.extend({\n  valueObserver: observer('value', function(sender, key, value, rev) {\n    // Executes whenever the "value" property changes\n    // See the addObserver method for more information about the callback arguments\n  })\n});
\n
\n
\n \n

Although this is the most common way to add an observer, this capability\nis actually built into the EmberObject class on top of two methods\ndefined in this mixin: addObserver and removeObserver. You can use\nthese two methods to add and remove observers yourself if you need to\ndo so at runtime.

\n

To add an observer for a property, call:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
object.addObserver('propertyKey', targetObject, targetAction)
\n
\n
\n \n

This will call the targetAction method on the targetObject whenever\nthe value of the propertyKey changes.

\n

Note that if propertyKey is a computed property, the observer will be\ncalled when any of the property dependencies are changed, even if the\nresulting value of the computed property is unchanged. This is necessary\nbecause computed properties are not computed until get is called.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Promise-8fc1ed98f3.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Promise-8fc1ed98f3.json new file mode 100644 index 000000000..221f60082 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Promise-8fc1ed98f3.json @@ -0,0 +1,246 @@ +{ + "data": { + "id": "ember-4.3.0-Promise", + "type": "class", + "attributes": { + "name": "Promise", + "shortname": "Promise", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 26, + "description": "

Promise objects represent the eventual result of an asynchronous operation. The\nprimary way of interacting with a promise is through its then method, which\nregisters callbacks to receive either a promise’s eventual value or the reason\nwhy the promise cannot be fulfilled.

\n

Terminology

\n
    \n
  • promise is an object or function with a then method whose behavior conforms to this specification.
  • \n
  • thenable is an object or function that defines a then method.
  • \n
  • value is any legal JavaScript value (including undefined, a thenable, or a promise).
  • \n
  • exception is a value that is thrown using the throw statement.
  • \n
  • reason is a value that indicates why a promise was rejected.
  • \n
  • settled the final resting state of a promise, fulfilled or rejected.
  • \n
\n

A promise can be in one of three states: pending, fulfilled, or rejected.

\n

Promises that are fulfilled have a fulfillment value and are in the fulfilled\nstate. Promises that are rejected have a rejection reason and are in the\nrejected state. A fulfillment value is never a thenable.

\n

Promises can also be said to resolve a value. If this value is also a\npromise, then the original promise's settled state will match the value's\nsettled state. So a promise that resolves a promise that rejects will\nitself reject, and a promise that resolves a promise that fulfills will\nitself fulfill.

\n

Basic Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
let promise = new Promise(function(resolve, reject) {\n  // on success\n  resolve(value);\n\n  // on failure\n  reject(reason);\n});\n\npromise.then(function(value) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Advanced Usage:

\n

Promises shine when abstracting away asynchronous interactions such as\nXMLHttpRequests.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
function getJSON(url) {\n  return new Promise(function(resolve, reject){\n    let xhr = new XMLHttpRequest();\n\n    xhr.open('GET', url);\n    xhr.onreadystatechange = handler;\n    xhr.responseType = 'json';\n    xhr.setRequestHeader('Accept', 'application/json');\n    xhr.send();\n\n    function handler() {\n      if (this.readyState === this.DONE) {\n        if (this.status === 200) {\n          resolve(this.response);\n        } else {\n          reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n        }\n      }\n    };\n  });\n}\n\ngetJSON('/posts.json').then(function(json) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Unlike callbacks, promises are great composable primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Promise.all([\n  getJSON('/posts'),\n  getJSON('/comments')\n]).then(function(values){\n  values[0] // => postsJSON\n  values[1] // => commentsJSON\n\n  return values;\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "params": [ + { + "name": "resolver", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "is_constructor": 1, + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/promise/all.js", + "line": 3, + "description": "

Promise.all accepts an array of promises, and returns a new promise which\nis fulfilled with an array of fulfillment values for the passed promises, or\nrejected with the reason of the first passed promise to be rejected. It casts all\nelements of the passed iterable to promises as it runs this algorithm.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Promise, { resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // The array here would be [ 1, 2, 3 ];\n});
\n
\n
\n \n

If any of the promises given to RSVP.all are rejected, the first promise\nthat is rejected will be given as an argument to the returned promises's\nrejection handler. For example:

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Promise, { resolve, reject } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error("2"));\nlet promise3 = reject(new Error("3"));\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(error) {\n  // error.message === "2"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "all", + "params": [ + { + "name": "entries", + "description": "array of promises", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all `promises` have been\nfulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "static": 1, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/race.js", + "line": 9, + "description": "

Promise.race returns a new promise which is settled in the same way as the\nfirst passed promise to settle.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 2');\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // result === 'promise 2' because it was resolved before promise1\n  // was resolved.\n});
\n
\n
\n \n

Promise.race is deterministic in that only the state of the first\nsettled promise matters. For example, even if other promises given to the\npromises array argument are resolved, but the first settled promise has\nbecome rejected before the other promises became fulfilled, the returned\npromise will become rejected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    reject(new Error('promise 2'));\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // Code here never runs\n}, function(reason){\n  // reason.message === 'promise 2' because promise 2 became rejected before\n  // promise 1 became fulfilled\n});
\n
\n
\n \n

An example real-world use case is implementing timeouts:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import Promise from 'rsvp';\n\nPromise.race([ajax('foo.json'), timeout(5000)])
\n
\n
\n \n", + "itemtype": "method", + "name": "race", + "static": 1, + "params": [ + { + "name": "entries", + "description": "array of promises to observe", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for describing the promise returned.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise which settles in the same way as the first passed\npromise to settle.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/reject.js", + "line": 6, + "description": "

Promise.reject returns a promise rejected with the passed reason.\nIt is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  reject(new Error('WHOOPS'));\n});\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = Promise.reject(new Error('WHOOPS'));\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/resolve.js", + "line": 6, + "description": "

Promise.resolve returns a promise that will become resolved with the\npassed value. It is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  resolve(1);\n});\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Promise from 'rsvp';\n\nlet promise = RSVP.Promise.resolve(1);\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "resolve", + "static": 1, + "params": [ + { + "name": "object", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 155, + "description": "

catch is simply sugar for then(undefined, onRejection) which makes it the same\nas the catch block of a try/catch statement.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
function findAuthor(){\n  throw new Error('couldn\\'t find that author');\n}\n\n// synchronous\ntry {\n  findAuthor();\n} catch(reason) {\n  // something went wrong\n}\n\n// async with promises\nfindAuthor().catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 187, + "description": "

finally will be invoked regardless of the promise's fate just as native\ntry/catch/finally behaves

\n

Synchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
findAuthor() {\n  if (Math.random() > 0.5) {\n    throw new Error();\n  }\n  return new Author();\n}\n\ntry {\n  return findAuthor(); // succeed or fail\n} catch(error) {\n  return findOtherAuthor();\n} finally {\n  // always runs\n  // doesn't affect the return value\n}
\n
\n
\n \n

Asynchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findAuthor().catch(function(reason){\n  return findOtherAuthor();\n}).finally(function(){\n  // author was either found, or not\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 248, + "description": "

The primary way of interacting with a promise is through its then method,\nwhich registers callbacks to receive either a promise's eventual value or the\nreason why the promise cannot be fulfilled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function(user){\n  // user is available\n}, function(reason){\n  // user is unavailable, and you are given the reason why\n});
\n
\n
\n \n

Chaining

\n

The return value of then is itself a promise. This second, 'downstream'\npromise is resolved with the return value of the first promise's fulfillment\nor rejection handler, or rejected if the handler throws an exception.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
findUser().then(function (user) {\n  return user.name;\n}, function (reason) {\n  return 'default name';\n}).then(function (userName) {\n  // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n  // will be `'default name'`\n});\n\nfindUser().then(function (user) {\n  throw new Error('Found user, but still unhappy');\n}, function (reason) {\n  throw new Error('`findUser` rejected and we\\'re unhappy');\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n  // If `findUser` rejected, `reason` will be '`findUser` rejected and we\\'re unhappy'.\n});
\n
\n
\n \n

If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
findUser().then(function (user) {\n  throw new PedagogicalException('Upstream error');\n}).then(function (value) {\n  // never reached\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // The `PedgagocialException` is propagated all the way down to here\n});
\n
\n
\n \n

Assimilation

\n

Sometimes the value you want to propagate to a downstream promise can only be\nretrieved asynchronously. This can be achieved by returning a promise in the\nfulfillment or rejection handler. The downstream promise will then be pending\nuntil the returned promise is settled. This is called assimilation.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // The user's comments are now available\n});
\n
\n
\n \n

If the assimliated promise rejects, then the downstream promise will also reject.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // If `findCommentsByAuthor` fulfills, we'll have the value here\n}, function (reason) {\n  // If `findCommentsByAuthor` rejects, we'll have the reason here\n});
\n
\n
\n \n

Simple Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let result;\n\ntry {\n  result = findResult();\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findResult(function(result, err){\n  if (err) {\n    // failure\n  } else {\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findResult().then(function(result){\n  // success\n}, function(reason){\n  // failure\n});
\n
\n
\n \n

Advanced Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let author, books;\n\ntry {\n  author = findAuthor();\n  books  = findBooksByAuthor(author);\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
function foundBooks(books) {\n\n}\n\nfunction failure(reason) {\n\n}\n\nfindAuthor(function(author, err){\n  if (err) {\n    failure(err);\n    // failure\n  } else {\n    try {\n      findBoooksByAuthor(author, function(books, err) {\n        if (err) {\n          failure(err);\n        } else {\n          try {\n            foundBooks(books);\n          } catch(reason) {\n            failure(reason);\n          }\n        }\n      });\n    } catch(error) {\n      failure(err);\n    }\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findAuthor().\n  then(findBooksByAuthor).\n  then(function(books){\n    // found books\n}).catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "onFulfillment", + "description": "", + "type": "Function" + }, + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-PromiseProxyMixin-f4ff672507.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-PromiseProxyMixin-f4ff672507.json new file mode 100644 index 000000000..4c7e77b36 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-PromiseProxyMixin-f4ff672507.json @@ -0,0 +1,186 @@ +{ + "data": { + "id": "ember-4.3.0-PromiseProxyMixin", + "type": "class", + "attributes": { + "name": "PromiseProxyMixin", + "shortname": "PromiseProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 37, + "description": "

A low level mixin making ObjectProxy promise-aware.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { resolve } from 'rsvp';\nimport $ from 'jquery';\nimport ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nlet ObjectPromiseProxy = ObjectProxy.extend(PromiseProxyMixin);\n\nlet proxy = ObjectPromiseProxy.create({\n  promise: resolve($.getJSON('/some/remote/data.json'))\n});\n\nproxy.then(function(json){\n   // the json\n}, function(reason) {\n   // the reason why you have no json\n});
\n
\n
\n \n

the proxy has bindable attributes which\ntrack the promises life cycle

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> true\nproxy.get('isSettled')  //=> false\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> false
\n
\n
\n \n

When the $.getJSON completes, and the promise is fulfilled\nwith json, the life cycle attributes will update accordingly.\nNote that $.getJSON doesn't return an ECMA specified promise,\nit is useful to wrap this with an RSVP.resolve so that it behaves\nas a spec compliant promise.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> false\nproxy.get('isSettled')   //=> true\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> true
\n
\n
\n \n

As the proxy is an ObjectProxy, and the json now its content,\nall the json properties will be available directly from the proxy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// Assuming the following json:\n{\n  firstName: 'Stefan',\n  lastName: 'Penner'\n}\n\n// both properties will accessible on the proxy\nproxy.get('firstName') //=> 'Stefan'\nproxy.get('lastName')  //=> 'Penner'
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 180, + "description": "

An alias to the proxied promise's then.

\n

See RSVP.Promise.then.

\n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 192, + "description": "

An alias to the proxied promise's catch.

\n

See RSVP.Promise.catch.

\n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 205, + "description": "

An alias to the proxied promise's finally.

\n

See RSVP.Promise.finally.

\n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 101, + "description": "

If the proxied promise is rejected this will contain the reason\nprovided.

\n", + "itemtype": "property", + "name": "reason", + "default": "null", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 111, + "description": "

Once the proxied promise has settled this will become false.

\n", + "itemtype": "property", + "name": "isPending", + "default": "true", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 122, + "description": "

Once the proxied promise has settled this will become true.

\n", + "itemtype": "property", + "name": "isSettled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 133, + "description": "

Will become true if the proxied promise is rejected.

\n", + "itemtype": "property", + "name": "isRejected", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 142, + "description": "

Will become true if the proxied promise is fulfilled.

\n", + "itemtype": "property", + "name": "isFulfilled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js", + "line": 151, + "description": "

The promise whose fulfillment value is being proxied by this object.

\n

This property must be specified upon creation, and should not be\nchanged once created.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nObjectProxy.extend(PromiseProxyMixin).create({\n  promise: <thenable>\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "promise", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Registry-de553b1e0b.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Registry-de553b1e0b.json new file mode 100644 index 000000000..d26f68a27 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Registry-de553b1e0b.json @@ -0,0 +1,421 @@ +{ + "data": { + "id": "ember-4.3.0-Registry", + "type": "class", + "attributes": { + "name": "Registry", + "shortname": "Registry", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 65, + "description": "

A registry used to store factory and option information keyed\nby type.

\n

A Registry stores the factory and option information needed by a\nContainer to instantiate and cache objects.

\n

The API for Registry is still in flux and should not be considered stable.

\n", + "access": "private", + "tagname": "", + "since": "1.11.0", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 154, + "description": "

Creates a container based on this registry.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "container", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "created container", + "type": "Container" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 166, + "description": "

Registers a factory for later injection.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let registry = new Registry();\n\nregistry.register('model:user', Person, {singleton: false });\nregistry.register('fruit:favorite', Orange);\nregistry.register('communication:main', Email, {singleton: false});
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "factory", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 200, + "description": "

Unregister a fullName

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.register('model:user', User);\n\nregistry.resolve('model:user').create() instanceof User //=> true\n\nregistry.unregister('model:user')\nregistry.resolve('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 230, + "description": "

Given a fullName return the corresponding factory.

\n

By default resolve will retrieve the factory from\nthe registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let registry = new Registry();\nregistry.register('api:twitter', Twitter);\n\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n

Optionally the registry can be provided with a custom resolver.\nIf provided, resolve will first provide the custom resolver\nthe opportunity to resolve the fullName, otherwise it will fallback\nto the registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.resolver = function(fullName) {\n   // lookup via the module system of choice\n };\n\n// the twitter factory is added to the module system\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "the fullname of the request source (used for local lookups)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 273, + "description": "

A hook that can be used to describe how the resolver will\nattempt to find the factory.

\n

For example, the default Ember .describe returns the full\nclass name (including namespace) where Ember's resolver expects\nto find the fullName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "describe", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "described fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 296, + "description": "

A hook to enable custom fullName normalization behavior

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalizeFullName", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 314, + "description": "

Normalize a fullName based on the application's conventions

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalize", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 329, + "itemtype": "method", + "name": "makeToString", + "access": "private", + "tagname": "", + "params": [ + { + "name": "factory", + "description": "", + "type": "Any" + }, + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "toString function", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 347, + "description": "

Given a fullName check if the container is aware of its factory\nor singleton instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "the fullname of the request source (used for local lookups)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 366, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let registry = new Registry();\nlet container = registry.container();\n\n// if all of type `connection` must not be singletons\nregistry.optionsForType('connection', { singleton: false });\n\nregistry.register('connection:twitter', TwitterConnection);\nregistry.register('connection:facebook', FacebookConnection);\n\nlet twitter = container.lookup('connection:twitter');\nlet twitter2 = container.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = container.lookup('connection:facebook');\nlet facebook2 = container.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "optionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 407, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "options", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 480, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "knownForType", + "params": [ + { + "name": "type", + "description": "the type to iterate over", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 104, + "description": "

A backup registry for resolving registrations when no matches can be found.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "fallback", + "type": "Registry", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 112, + "description": "

An object that has a resolve method that resolves a name.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "resolver", + "type": "Resolver", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 120, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registrations", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 126, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_normalizeCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 133, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_resolveCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 140, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_options", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 147, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_typeOptions", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-RegistryProxyMixin-943153f25e.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-RegistryProxyMixin-943153f25e.json new file mode 100644 index 000000000..436b1fb58 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-RegistryProxyMixin-943153f25e.json @@ -0,0 +1,284 @@ +{ + "data": { + "id": "ember-4.3.0-RegistryProxyMixin", + "type": "class", + "attributes": { + "name": "RegistryProxyMixin", + "shortname": "RegistryProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Application", + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 8, + "description": "

RegistryProxyMixin is used to provide public access to specific\nregistry functionality.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 18, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 31, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 101, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 124, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 134, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 145, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 155, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 165, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 198, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js", + "line": 208, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Route-bd160e0495.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Route-bd160e0495.json new file mode 100644 index 000000000..d98d302d0 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Route-bd160e0495.json @@ -0,0 +1,1706 @@ +{ + "data": { + "id": "ember-4.3.0-Route", + "type": "class", + "attributes": { + "name": "Route", + "shortname": "Route", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 79, + "description": "

The Route class is used to define individual routes. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented", + "ActionHandler" + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 304, + "description": "

A hook you can implement to convert the route's model into parameters\nfor the URL.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model({ post_id }) {\n    // the server returns `{ id: 12 }`\n    return fetch(`/posts/${post_id}`;\n  }\n\n  serialize(model) {\n    // this will make the URL `/posts/12`\n    return { post_id: model.id };\n  }\n}
\n
\n
\n \n

The default serialize method will insert the model's id into the\nroute's dynamic segment (in this case, :post_id) if the segment contains '_id'.\nIf the route has multiple dynamic segments or does not contain '_id', serialize\nwill return getProperties(model, params)

\n

This method is called when transitionTo is called with a context\nin order to populate the URL.

\n", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "model", + "description": "the routes model", + "type": "Object" + }, + { + "name": "params", + "description": "an Array of parameter names for the current\n route (in the example, `['post_id']`.", + "type": "Array" + } + ], + "return": { + "description": "the serialized parameters", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 541, + "description": "

Sets the name for this route, including a fully resolved name for routes\ninside engines.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_setRouteName", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 556, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_stashNames", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 596, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_updatingQPChanged", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 604, + "description": "

Returns a hash containing the parameters of an ancestor route.

\n

You may notice that this.paramsFor sometimes works when referring to a\nchild route, but this behavior should not be relied upon as only ancestor\nroutes are certain to be loaded in time.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('member', { path: ':name' }, function() {\n    this.route('interest', { path: ':interest' });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class MemberRoute extends Route {\n  queryParams = {\n    memberQp: { refreshModel: true }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member/interest.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default class MemberInterestRoute extends Route {\n  queryParams = {\n    interestQp: { refreshModel: true }\n  }\n\n  model() {\n    return this.paramsFor('member');\n  }\n}
\n
\n
\n \n

If we visit /turing/maths?memberQp=member&interestQp=interest the model for\nthe member.interest route is a hash with:

\n
    \n
  • name: turing
  • \n
  • memberQp: member
  • \n
\n", + "itemtype": "method", + "name": "paramsFor", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "return": { + "description": "hash containing the parameters of the route `name`", + "type": "Object" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 685, + "description": "

Serializes the query parameter key

\n", + "itemtype": "method", + "name": "serializeQueryParamKey", + "params": [ + { + "name": "controllerPropertyName", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 696, + "description": "

Serializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 712, + "description": "

Deserializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 744, + "description": "

A hook you can use to reset controller values either when the model\nchanges or the route is exiting.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/articles.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class ArticlesRoute extends Route {\n  resetController(controller, isExiting, transition) {\n    if (isExiting && transition.targetName !== 'error') {\n      controller.set('page', 1);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "resetController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "isExiting", + "description": "", + "type": "Boolean" + }, + { + "name": "transition", + "description": "", + "type": "Object" + } + ], + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 771, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "exit", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 782, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_internalReset", + "since": "3.6.0", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 796, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "enter", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 847, + "description": "

This hook is executed when the router completely exits this route. It is\nnot executed when the model for the route changes.

\n", + "itemtype": "method", + "name": "deactivate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 858, + "description": "

This hook is executed when the router enters the route. It is not executed\nwhen the model for the route changes.

\n", + "itemtype": "method", + "name": "activate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 869, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogPosts');\nthis.transitionTo('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('blogPost', { path:':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogComment', aPost, aComment);\nthis.transitionTo('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
this.transitionTo('/');\nthis.transitionTo('/blog/post/1/comment/13');\nthis.transitionTo('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
this.transitionTo('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\nthis.transitionTo({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceWith.

\n

Simple Transition Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n  this.route('fourOhFour', { path: '*:' });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToSecret(context) {\n    if (authorized()) {\n      this.transitionTo('secret', context);\n    } else {\n      this.transitionTo('fourOhFour');\n    }\n  }\n}
\n
\n
\n \n

Transition to a nested route

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('articles', { path: '/articles' }, function() {\n    this.route('new');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToNewArticle() {\n    this.transitionTo('articles.new');\n  }\n}
\n
\n
\n \n

Multiple Models Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n\n  this.route('breakfast', { path: ':breakfastId' }, function() {\n    this.route('cereal', { path: ':cerealId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToChocolateCereal() {\n    let cereal = { cerealId: 'ChocolateYumminess' };\n    let breakfast = { breakfastId: 'CerealAndMilk' };\n\n    this.transitionTo('breakfast.cereal', breakfast, cereal);\n  }\n}
\n
\n
\n \n

Nested Route with Query String Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('fruits', function() {\n    this.route('apples');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToApples() {\n    this.transitionTo('fruits.apples', { queryParams: { color: 'red' } });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL.", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1067, + "description": "

Perform a synchronous transition into another route without attempting\nto resolve promises, update the URL, or abort any currently active\nasynchronous transitions (i.e. regular transitions caused by\ntransitionTo or URL changes).

\n

This method is handy for performing intermediate transitions on the\nway to a final destination route, and is called internally by the\ndefault implementations of the error and loading handlers.

\n", + "itemtype": "method", + "name": "intermediateTransitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) to be used while transitioning\nto the route.", + "type": "...Object" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1089, + "description": "

Refresh the model on this route and any child routes, firing the\nbeforeModel, model, and afterModel hooks in a similar fashion\nto how routes are entered when transitioning in from other route.\nThe current route params (e.g. article_id) will be passed in\nto the respective model hooks, and if a different model is returned,\nsetupController and associated route hooks will re-fire as well.

\n

An example usage of this method is re-querying the server for the\nlatest information using the same parameters as when the route\nwas first entered.

\n

Note that this will cause model hooks to fire even on routes\nthat were provided a model object when the route was initially\nentered.

\n", + "itemtype": "method", + "name": "refresh", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1115, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionTo in all other respects. See\n'transitionTo' for additional information regarding multiple models.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/secret.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class SecretRoute Route {\n  afterModel() {\n    if (!authorized()){\n      this.replaceWith('index');\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1163, + "description": "

This hook is the entry point for router.js

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1238, + "description": "

This hook is the first of the route entry validation hooks\ncalled when an attempt is made to transition into a route\nor one of its children. It is called before model and\nafterModel, and is appropriate for cases when:

\n
    \n
  1. A decision can be made to redirect elsewhere without\nneeding to resolve the model first.
  2. \n
  3. Any async operations need to occur first before the\nmodel is attempted to be resolved.
  4. \n
\n

This hook is provided the current transition attempt\nas a parameter, which can be used to .abort() the transition,\nsave it for a later .retry(), or retrieve values set\non it from a previous hook. You can also just call\nthis.transitionTo to another route to implicitly\nabort the transition.

\n

You can return a promise from this hook to pause the\ntransition until the promise resolves (or rejects). This could\nbe useful, for instance, for retrieving async code from\nthe server that is required to enter a route.

\n", + "itemtype": "method", + "name": "beforeModel", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1273, + "description": "

This hook is called after this route's model has resolved.\nIt follows identical async/promise semantics to beforeModel\nbut is provided the route's resolved model in addition to\nthe transition, and is therefore suited to performing\nlogic that can only take place after the model has already\nresolved.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n  afterModel(posts, transition) {\n    if (posts.get('length') === 1) {\n      this.transitionTo('post.show', posts.get('firstObject'));\n    }\n  }\n}
\n
\n
\n \n

Refer to documentation for beforeModel for a description\nof transition-pausing semantics when a promise is returned\nfrom this hook.

\n", + "itemtype": "method", + "name": "afterModel", + "params": [ + { + "name": "resolvedModel", + "description": "the value returned from `model`,\n or its resolved value if it was a promise", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1311, + "description": "

A hook you can implement to optionally redirect to another route.

\n

Calling this.transitionTo from inside of the redirect hook will\nabort the current transition (into the route that has implemented redirect).

\n

redirect and afterModel behave very similarly and are\ncalled almost at the same time, but they have an important\ndistinction when calling this.transitionTo to a child route\nof the current route. From afterModel, this new transition\ninvalidates the current transition, causing beforeModel,\nmodel, and afterModel hooks to be called again. But the\nsame transition started from redirect does not invalidate\nthe current transition. In other words, by the time the redirect\nhook has been called, both the resolved model and the attempted\nentry into this route are considered fully validated.

\n", + "itemtype": "method", + "name": "redirect", + "params": [ + { + "name": "model", + "description": "the model for this route", + "type": "Object" + }, + { + "name": "transition", + "description": "the transition object associated with the current transition", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1336, + "description": "

Called when the context is changed by router.js.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "contextDidChange", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1346, + "description": "

A hook you can implement to convert the URL into the model for\nthis route.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

The model for the post route is store.findRecord('post', params.post_id).

\n

By default, if your route has a dynamic segment ending in _id:

\n
    \n
  • The model class is determined from the segment (post_id's\nclass is App.Post)
  • \n
  • The find method is called on the model class with the value of\nthe dynamic segment.
  • \n
\n

Note that for routes with dynamic segments, this hook is not always\nexecuted. If the route is entered through a transition (e.g. when\nusing the link-to Handlebars helper or the transitionTo method\nof routes), and a model context is already provided this hook\nis not called.

\n

A model context does not include a primitive string or number,\nwhich does cause the model hook to be called.

\n

Routes without dynamic segments will always execute the model hook.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
// no dynamic segment, model hook always called\nthis.transitionTo('posts');\n\n// model passed in, so model hook not called\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost);\n\n// integer passed in, model hook is called\nthis.transitionTo('post', 1);\n\n// model id passed in, model hook is called\n// useful for forcing the hook to execute\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost.id);
\n
\n
\n \n

This hook follows the asynchronous/promise semantics\ndescribed in the documentation for beforeModel. In particular,\nif a promise returned from model fails, the error will be\nhandled by the error hook on Route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model(params) {\n    return this.store.findRecord('post', params.post_id);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "model", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route. If\n a promise is returned, the transition will pause until\n the promise resolves, and the resolved value of the promise\n will be used as the model for this route.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1462, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "deserialize", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route.\n\nRouter.js hook.", + "type": "Any | Promise" + }, + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1475, + "itemtype": "method", + "name": "findModel", + "params": [ + { + "name": "type", + "description": "the model type", + "type": "String" + }, + { + "name": "value", + "description": "the value passed to find", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1486, + "description": "

A hook you can use to setup the controller for the current route.

\n

This method is called with the controller for the current route and the\nmodel supplied by the model hook.

\n

By default, the setupController hook sets the model property of\nthe controller to the specified model when it is not undefined.

\n

If you implement the setupController hook in your Route, it will\nprevent this default behavior. If you want to preserve that behavior\nwhen implementing your setupController function, make sure to call\nsuper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/photos.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PhotosRoute extends Route {\n  model() {\n    return this.store.findAll('photo');\n  }\n\n  setupController(controller, model) {\n    super.setupController(controller, model);\n\n    this.controllerFor('application').set('showingPhotos', true);\n  }\n}
\n
\n
\n \n

The provided controller will be one resolved based on the name\nof this route.

\n

If no explicit controller is defined, Ember will automatically create one.

\n

As an example, consider the router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

If you have defined a file for the post controller,\nthe framework will use it.\nIf it is not defined, a basic Controller instance would be used.

\n", + "example": [ + " Behavior of a basic Controller\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, model) {\n controller.set('model', model);\n }\n});\n```" + ], + "itemtype": "method", + "name": "setupController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "model", + "description": "", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition", + "optional": true + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1562, + "description": "

Returns the controller of the current route, or a parent (or any ancestor)\nroute in a route hierarchy.

\n

The controller instance must already have been created, either through entering the\nassociated route or using generateController.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.controllerFor('posts').set('currentPost', post);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "controllerFor", + "params": [ + { + "name": "name", + "description": "the name of the route or controller", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Controller | undefined" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1611, + "description": "

Generates a controller for a route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class Post extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.generateController('posts');\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "generateController", + "params": [ + { + "name": "name", + "description": "the name of the controller", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1639, + "description": "

Returns the resolved model of a parent (or any ancestor) route\nin a route hierarchy. During a transition, all routes\nmust resolve a model object, and if a route\nneeds access to a parent route's model in order to\nresolve a model (or just reuse the model from a parent),\nit can call this.modelFor(theNameOfParentRoute) to\nretrieve it. If the ancestor route's model was a promise,\nits resolved result is returned.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' }, function() {\n    this.route('comments');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post/comments.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostCommentsRoute extends Route {\n  model() {\n    let post = this.modelFor('post');\n\n    return post.comments;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "modelFor", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "the model object", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1711, + "description": "

this[RENDER] is used to render a template into a region of another template\n(indicated by an {{outlet}}).

\n", + "itemtype": "method", + "name": "this[RENDER]", + "params": [ + { + "name": "name", + "description": "the name of the template to render", + "type": "String" + }, + { + "name": "options", + "description": "the options", + "type": "Object", + "optional": true, + "props": [ + { + "name": "into", + "description": "the template to render into,\n referenced by name. Defaults to the parent template", + "type": "String", + "optional": true + }, + { + "name": "outlet", + "description": "the outlet inside `options.into` to render into.\n Defaults to 'main'", + "type": "String", + "optional": true + }, + { + "name": "controller", + "description": "the controller to use for this template,\n referenced by name or as a controller instance. Defaults to the Route's paired controller", + "type": "String|Object", + "optional": true + }, + { + "name": "model", + "description": "the model object to set on `options.controller`.\n Defaults to the return value of the Route's model hook", + "type": "Object", + "optional": true + } + ] + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1738, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "teardownViews", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1751, + "description": "

Allows you to produce custom metadata for the route.\nThe return value of this method will be attached to\nits corresponding RouteInfoWithAttributes object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostsIndexRoute extends Route {\n  buildRouteInfoMetadata() {\n    return { title: 'Posts Page' }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service router\n\n  constructor() {\n    super(...arguments);\n\n    this.router.on('routeDidChange', transition => {\n      document.title = transition.to.metadata.title;\n      // would update document's title to "Posts Page"\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "buildRouteInfoMetadata", + "return": { + "description": "any" + }, + "since": "3.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2003, + "description": "

Sends an action to the router, which will delegate it to the currently\nactive route hierarchy per the bubbling rules explained under actions.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  track(arg) {\n    console.log(arg, 'was clicked');\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  trackIfDebug(arg) {\n    if (debug) {\n      this.send('track', arg);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "name", + "description": "the name of the action to trigger", + "type": "String" + }, + { + "name": "args", + "description": "", + "type": "...*" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2411, + "description": "

This action is called when one or more query params have changed. Bubbles.

\n", + "itemtype": "method", + "name": "queryParamsDidChange", + "params": [ + { + "name": "changed", + "description": "Keys are names of query params that have changed.", + "type": "Object" + }, + { + "name": "totalPresent", + "description": "Keys are names of query params that are currently set.", + "type": "Object" + }, + { + "name": "removed", + "description": "Keys are names of query params that have been removed.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 54, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 80, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 101, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 124, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.js", + "line": 139, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 91, + "description": "

The willTransition action 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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ContactFormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData')) {\n      this.controller.displayNavigationConfirm();\n      transition.abort();\n    }\n  }\n}
\n
\n
\n \n

You can also redirect elsewhere by calling\nthis.transitionTo('elsewhere') from within willTransition.\nNote that willTransition will not be fired for the\nredirecting transitionTo, since willTransition doesn't\nfire when there is already a transition underway. If you want\nsubsequent willTransition actions to fire for the redirecting\ntransition, you must first explicitly call\ntransition.abort().

\n

To allow the willTransition event to continue bubbling to the parent\nroute, use return true;. When the willTransition method has a\nreturn value of true then the parent route's willTransition method\nwill be fired, enabling "bubbling" behavior for the event.

\n", + "itemtype": "event", + "name": "willTransition", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 136, + "description": "

The didTransition action is fired after a transition has\nsuccessfully been completed. This occurs after the normal model\nhooks (beforeModel, model, afterModel, setupController)\nhave resolved. The didTransition action has no arguments,\nhowever, it can be useful for tracking page views or resetting\nstate on the controller.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/login.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class LoginRoute extends Route {\n  @action\n  didTransition() {\n    this.controller.get('errors.base').clear();\n    return true; // Bubble the didTransition event\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "didTransition", + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 163, + "description": "

The loading action is fired on the route when a route's model\nhook returns a promise that is not already resolved. The current\nTransition object is the first parameter and the route that\ntriggered the loading event is the second parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  loading(transition, route) {\n    let controller = this.controllerFor('foo');\n\n    // The controller may not be instantiated when initially loading\n    if (controller) {\n      controller.currentlyLoading = true;\n\n      transition.finally(function() {\n        controller.currentlyLoading = false;\n      });\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "loading", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + }, + { + "name": "route", + "description": "The route that triggered the loading event", + "type": "Route" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 198, + "description": "

When attempting to transition into a route, any of the hooks\nmay return a promise that rejects, at which point an error\naction will be fired on the partially-entered routes, allowing\nfor per-route error handling logic, or shared error handling\nlogic defined on a parent route.

\n

Here is an example of an error handler that will be invoked\nfor rejected promises from the various hooks on the route,\nas well as any unhandled errors from child routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/admin.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { reject } from 'rsvp';\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class AdminRoute extends Route {\n  beforeModel() {\n    return reject('bad things!');\n  }\n\n  @action\n  error(error, transition) {\n    // Assuming we got here due to the error in `beforeModel`,\n    // we can expect that error === "bad things!",\n    // but a promise model rejecting would also\n    // call this hook, as would any errors encountered\n    // in `afterModel`.\n\n    // The `error` hook is also provided the failed\n    // `transition`, which can be stored and later\n    // `.retry()`d if desired.\n\n    this.transitionTo('login');\n  }\n}
\n
\n
\n \n

error actions that bubble up all the way to ApplicationRoute\nwill fire a default error handler that logs the error. You can\nspecify your own global default error handler by overriding the\nerror handler on ApplicationRoute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  error(error, transition) {\n    this.controllerFor('banner').displayError(error.message);\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "error", + "params": [ + { + "name": "error", + "description": "", + "type": "Error" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 807, + "description": "

This event is triggered when the router enters the route. It is\nnot executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  collectAnalytics: on('activate', function(){\n    collectAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "activate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 827, + "description": "

This event is triggered when the router completely exits this\nroute. It is not executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  trackPageLeaveAnalytics: on('deactivate', function(){\n    trackPageLeaveAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "deactivate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 372, + "description": "

Configuration hash for this route's queryParams. The possible\nconfiguration options and their defaults are as follows\n(assuming a query param whose controller property is page):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
queryParams = {\n  page: {\n    // By default, controller query param properties don't\n    // cause a full transition when they are changed, but\n    // rather only cause the URL to update. Setting\n    // `refreshModel` to true will cause an "in-place"\n    // transition to occur, whereby the model hooks for\n    // this route (and any child routes) will re-fire, allowing\n    // you to reload models (e.g., from the server) using the\n    // updated query param values.\n    refreshModel: false,\n\n    // By default, changes to controller query param properties\n    // cause the URL to update via `pushState`, which means an\n    // item will be added to the browser's history, allowing\n    // you to use the back button to restore the app to the\n    // previous state before the query param property was changed.\n    // Setting `replace` to true will use `replaceState` (or its\n    // hash location equivalent), which causes no browser history\n    // item to be added. This options name and default value are\n    // the same as the `link-to` helper's `replace` option.\n    replace: false,\n\n    // By default, the query param URL key is the same name as\n    // the controller property name. Use `as` to specify a\n    // different URL key.\n    as: 'page'\n  }\n};
\n
\n
\n \n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 425, + "description": "

The name of the template to use by default when rendering this routes\ntemplate.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/list.js
1\n2\n3\n4\n5\n
import Route from '@ember/routing/route';\n\nexport default class extends Route {\n  templateName = 'posts/list'\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n
import PostsList from '../posts/list';\n\nexport default class extends PostsList {};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/archived.js
1\n2\n3\n
import PostsList from '../posts/list';\n\nexport default class extends PostsList {};
\n
\n
\n \n", + "itemtype": "property", + "name": "templateName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 458, + "description": "

The name of the controller to associate with this route.

\n

By default, Ember will lookup a route's controller that matches the name\nof the route (i.e. posts.new). However,\nif you would like to define a specific controller to use, you can do so\nusing this property.

\n

This is useful in many ways, as the controller specified will be:

\n
    \n
  • passed to the setupController method.
  • \n
  • used as the controller for the template being rendered by the route.
  • \n
  • returned from a call to controllerFor for the route.
  • \n
\n", + "itemtype": "property", + "name": "controllerName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 481, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 512, + "description": "

The name of the route, dot-delimited.

\n

For example, a route found at app/routes/posts/post.js will have\na routeName of posts.post.

\n", + "itemtype": "property", + "name": "routeName", + "type": "String", + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 526, + "description": "

The name of the route, dot-delimited, including the engine prefix\nif applicable.

\n

For example, a route found at addon/routes/posts/post.js within an\nengine named admin will have a fullRouteName of admin.posts.post.

\n", + "itemtype": "property", + "name": "fullRouteName", + "type": "String", + "since": "2.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 587, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_activeQPChanged", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 728, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_optionsForQueryParam", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1802, + "description": "

Store property provides a hook for data persistence libraries to inject themselves.

\n

By default, this store property provides the exact same functionality previously\nin the model hook.

\n

Currently, the required interface is:

\n

store.find(modelName, findArguments)

\n", + "itemtype": "property", + "name": "store", + "type": "{Object}", + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1868, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_qp", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2380, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-RouteInfo-018c924133.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-RouteInfo-018c924133.json new file mode 100644 index 000000000..963f1f121 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-RouteInfo-018c924133.json @@ -0,0 +1,171 @@ +{ + "data": { + "id": "ember-4.3.0-RouteInfo", + "type": "class", + "attributes": { + "name": "RouteInfo", + "shortname": "RouteInfo", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 120, + "description": "

A RouteInfo is an object that contains metadata\nabout a specific route within a Transition. It is\nread-only and internally immutable. It is also not\nobservable, because a Transition instance is never\nchanged after creation.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 194, + "description": "

Allows you to traverse through the linked list\nof RouteInfos from the topmost to leafmost.\nReturns the first RouteInfo in the linked list\nfor which the callback returns true.

\n

This method is similar to the find() method\n defined in ECMAScript 2015.

\n

The callback method you provide should have the\n following signature (all parameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in\n the results, false otherwise.

\n

Note that in addition to a callback, you can also\n pass an optional target object that will be set as\n this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 131, + "description": "

The dot-separated, fully-qualified name of the\nroute, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 138, + "description": "

The final segment of the fully-qualified name of\nthe route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 145, + "description": "

The values of the route's parameters. These are the\nsame params that are received as arguments to the\nroute's model hook. Contains only the parameters\nvalid for this route, if any (params for parent or\nchild routes are not merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 155, + "description": "

The ordered list of the names of the params\nrequired for this route. It will contain the same\nstrings as Object.keys(params), but here the order\nis significant. This allows users to correctly pass\nparams into routes programmatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 165, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 171, + "description": "

Will contain the result Route#buildRouteInfoMetadata\nfor the corresponding Route.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 178, + "description": "

A reference to the parent route's RouteInfo.\nThis can be used to traverse upward to the topmost\nRouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 186, + "description": "

A reference to the child route's RouteInfo.\nThis can be used to traverse downward to the\nleafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-RouteInfoWithAttributes-c52bfe1524.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-RouteInfoWithAttributes-c52bfe1524.json new file mode 100644 index 000000000..cbf011cd6 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-RouteInfoWithAttributes-c52bfe1524.json @@ -0,0 +1,183 @@ +{ + "data": { + "id": "ember-4.3.0-RouteInfoWithAttributes", + "type": "class", + "attributes": { + "name": "RouteInfoWithAttributes", + "shortname": "RouteInfoWithAttributes", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 3, + "description": "

A RouteInfoWithAttributes is an object that contains\nmetadata, including the resolved value from the routes\nmodel hook. Like RouteInfo, a RouteInfoWithAttributes\nrepresents a specific route within a Transition.\nIt is read-only and internally immutable. It is also not\nobservable, because a Transition instance is never\nchanged after creation.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 86, + "description": "

Allows you to traverse through the linked list\nof RouteInfos from the topmost to leafmost.\nReturns the first RouteInfo in the linked list\nfor which the callback returns true.

\n

This method is similar to the find() method\n defined in ECMAScript 2015.

\n

The callback method you provide should have the\n following signature (all parameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in\n the results, false otherwise.

\n

Note that in addition to a callback, you can also\n pass an optional target object that will be set as\n this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 16, + "description": "

The dot-separated, fully-qualified name of the\nroute, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 23, + "description": "

The final segment of the fully-qualified name of\nthe route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 30, + "description": "

The values of the route's parameters. These are the\nsame params that are received as arguments to the\nroute's model hook. Contains only the parameters\nvalid for this route, if any (params for parent or\nchild routes are not merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 40, + "description": "

The ordered list of the names of the params\nrequired for this route. It will contain the same\nstrings as Object.keys(params), but here the order\nis significant. This allows users to correctly pass\nparams into routes programmatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 50, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 56, + "description": "

This is the resolved return value from the\nroute's model hook.

\n", + "itemtype": "property", + "name": "attributes", + "type": "Object|Array|String|undefined", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 63, + "description": "

Will contain the result Route#buildRouteInfoMetadata\nfor the corresponding Route.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 70, + "description": "

A reference to the parent route's RouteInfo.\nThis can be used to traverse upward to the topmost\nRouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 78, + "description": "

A reference to the child route's RouteInfo.\nThis can be used to traverse downward to the\nleafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-RouterService-9383729787.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-RouterService-9383729787.json new file mode 100644 index 000000000..e65025c2b --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-RouterService-9383729787.json @@ -0,0 +1,839 @@ +{ + "data": { + "id": "ember-4.3.0-RouterService", + "type": "class", + "attributes": { + "name": "RouterService", + "shortname": "RouterService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 25, + "description": "

The Router service is the public API that provides access to the router.

\n

The immediate benefit of the Router service is that you can inject it into components,\ngiving them a friendly way to initiate transitions and ask questions about the current\nglobal router state.

\n

In this example, the Router service is injected into a component to initiate a transition\nto a dedicated route:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class ExampleComponent extends Component {\n  @service router;\n\n  @action\n  next() {\n    this.router.transitionTo('other.route');\n  }\n}
\n
\n
\n \n

Like any service, it can also be injected into helpers, routes, etc.

\n", + "access": "public", + "tagname": "", + "extends": "Service", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 77, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n

Calling transitionTo from the Router service will cause default query parameter values to be included in the URL.\nThis behavior is different from calling transitionTo on a route or transitionToRoute on a controller.\nSee the Router Service RFC for more info.

\n

In the following example we use the Router service to navigate to a route with a\nspecific model from a Component in the first action, and in the second we trigger\na query-params only transition.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n  @service router;\n\n  @action\n  goToComments(post) {\n    this.router.transitionTo('comments', post);\n  }\n\n  @action\n  fetchMoreComments(latestComment) {\n    this.router.transitionTo({\n      queryParams: { commentsAfter: latestComment }\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 136, + "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

Calling 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 for more info.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class extends Route {\n  beforeModel() {\n    if (!authorized()){\n      this.replaceWith('unauthorized');\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL of the desired destination", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route i.e. an object of params to pass to the destination route", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 175, + "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

In this example, the URL for the author.books route for a given author\nis copied to the clipboard.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

Just like with transitionTo and replaceWith, urlFor can also handle\nquery parameters.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "urlFor", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) for the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the string representing the generated URL", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 248, + "description": "

Returns true if routeName/models/queryParams is the active route, where models and queryParams are optional.\nSee model and\nqueryParams for more information about these arguments.

\n

In the following example, isActive will return true if the current route is /posts.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

Where 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.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used when determining the active route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "true if the provided routeName/models/queryParams are active", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 352, + "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

See RouteInfo for more info.

\n

In the following example recognize is used to verify if a path belongs to our\napplication before transitioning to it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "recognize", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo | null" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 393, + "description": "

Takes a string URL and returns a promise that resolves to a\nRouteInfoWithAttributes 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.

\n", + "itemtype": "method", + "name": "recognizeAndLoad", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 494, + "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.

\n", + "itemtype": "method", + "name": "refresh", + "params": [ + { + "name": "routeName", + "description": "the route to refresh (along with all child routes)", + "type": "String", + "optional": true + } + ], + "return": { + "description": "Transition" + }, + "category": [ + "EMBER_ROUTING_ROUTER_SERVICE_REFRESH" + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 415, + "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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Route from '@ember/routing';\nimport { service } from '@ember/service';\n\nexport default class extends Route {\n  @service router;\n\n  constructor() {\n    super(...arguments);\n\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
\n \n

The 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.

\n", + "itemtype": "event", + "name": "routeWillChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 451, + "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

A good example is sending some analytics when the route has transitioned:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Route from '@ember/routing';\nimport { service } from '@ember/service';\n\nexport default class extends Route {\n  @service router;\n\n  constructor() {\n    super(...arguments);\n\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 \n

routeDidChange will be called after any Route's\ndidTransition\naction has been fired.\nThe updates of properties\ncurrentURL,\ncurrentRouteName\nand\ncurrentRoute\nare completed at the time routeDidChange is called.

\n", + "itemtype": "event", + "name": "routeDidChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 531, + "description": "

Name of the current route.

\n

This property represents the logical name of the route,\n which is comma separated.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentRouteName", + "type": "{String | null}", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 561, + "description": "

Current URL for the application.

\n

This property represents the URL path for this route.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentURL", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 590, + "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

See Location for more information.

\n

To 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\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
\n \n

The following location types are available by default:\nauto, hash, history, none.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 630, + "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

If you change the rootURL in your environment configuration\nlike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\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
\n \n

This property will return /my-root.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 660, + "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

See RouteInfo for more info.

\n

This 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

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/header.js
1\n2\n3\n4\n5\n6\n7\n8\n9\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
\n
\n \n", + "itemtype": "property", + "name": "currentRoute", + "type": "RouteInfo", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-Service", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-Service-ec6bd2c77d.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-Service-ec6bd2c77d.json new file mode 100644 index 000000000..65162655c --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-Service-ec6bd2c77d.json @@ -0,0 +1,541 @@ +{ + "data": { + "id": "ember-4.3.0-Service", + "type": "class", + "attributes": { + "name": "Service", + "shortname": "Service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "file": "packages/@ember/service/index.ts", + "line": 90, + "extends": "EmberObject", + "since": "1.10.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 275, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 494, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 521, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 529, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 92, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 162, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 210, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 228, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 248, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 267, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 285, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 373, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 391, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 406, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 428, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 450, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.js", + "line": 467, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 309, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 383, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 458, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.js", + "line": 476, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.3.0-RouterService" + } + ] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-String-5dc1d50338.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-String-5dc1d50338.json new file mode 100644 index 000000000..48177cc09 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-String-5dc1d50338.json @@ -0,0 +1,200 @@ +{ + "data": { + "id": "ember-4.3.0-String", + "type": "class", + "attributes": { + "name": "String", + "shortname": "String", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/string", + "namespace": "", + "file": "packages/@ember/string/index.ts", + "line": 74, + "description": "

Defines string helper methods including string formatting and localization.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/string/index.ts", + "line": 81, + "description": "

Splits a string into separate units separated by spaces, eliminating any\nempty strings in the process.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { w } from '@ember/string';\n\nw("alpha beta gamma").forEach(function(key) {\n  console.log(key);\n});\n\n// > alpha\n// > beta\n// > gamma
\n
\n
\n \n", + "itemtype": "method", + "name": "w", + "params": [ + { + "name": "str", + "description": "The string to split", + "type": "String" + } + ], + "return": { + "description": "array containing the split strings", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 106, + "description": "

Converts a camelized string into all lower case separated by underscores.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { decamelize } from '@ember/string';\n\ndecamelize('innerHTML');          // 'inner_html'\ndecamelize('action_name');        // 'action_name'\ndecamelize('css-class-name');     // 'css-class-name'\ndecamelize('my favorite items');  // 'my favorite items'
\n
\n
\n \n", + "itemtype": "method", + "name": "decamelize", + "params": [ + { + "name": "str", + "description": "The string to decamelize.", + "type": "String" + } + ], + "return": { + "description": "the decamelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 127, + "description": "

Replaces underscores, spaces, or camelCase with dashes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { dasherize } from '@ember/string';\n\ndasherize('innerHTML');                // 'inner-html'\ndasherize('action_name');              // 'action-name'\ndasherize('css-class-name');           // 'css-class-name'\ndasherize('my favorite items');        // 'my-favorite-items'\ndasherize('privateDocs/ownerInvoice';  // 'private-docs/owner-invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "dasherize", + "params": [ + { + "name": "str", + "description": "The string to dasherize.", + "type": "String" + } + ], + "return": { + "description": "the dasherized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 149, + "description": "

Returns the lowerCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { camelize } from '@ember/string';\n\ncamelize('innerHTML');                   // 'innerHTML'\ncamelize('action_name');                 // 'actionName'\ncamelize('css-class-name');              // 'cssClassName'\ncamelize('my favorite items');           // 'myFavoriteItems'\ncamelize('My Favorite Items');           // 'myFavoriteItems'\ncamelize('private-docs/owner-invoice');  // 'privateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "camelize", + "params": [ + { + "name": "str", + "description": "The string to camelize.", + "type": "String" + } + ], + "return": { + "description": "the camelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 172, + "description": "

Returns the UpperCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { classify } from '@ember/string';\n\nclassify('innerHTML');                   // 'InnerHTML'\nclassify('action_name');                 // 'ActionName'\nclassify('css-class-name');              // 'CssClassName'\nclassify('my favorite items');           // 'MyFavoriteItems'\nclassify('private-docs/owner-invoice');  // 'PrivateDocs/OwnerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "classify", + "params": [ + { + "name": "str", + "description": "the string to classify", + "type": "String" + } + ], + "return": { + "description": "the classified string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 194, + "description": "

More general than decamelize. Returns the lower_case_and_underscored\nform of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { underscore } from '@ember/string';\n\nunderscore('innerHTML');                 // 'inner_html'\nunderscore('action_name');               // 'action_name'\nunderscore('css-class-name');            // 'css_class_name'\nunderscore('my favorite items');         // 'my_favorite_items'\nunderscore('privateDocs/ownerInvoice');  // 'private_docs/owner_invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "underscore", + "params": [ + { + "name": "str", + "description": "The string to underscore.", + "type": "String" + } + ], + "return": { + "description": "the underscored string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 217, + "description": "

Returns the Capitalized form of a string

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capitalize } from '@ember/string';\n\ncapitalize('innerHTML')                 // 'InnerHTML'\ncapitalize('action_name')               // 'Action_name'\ncapitalize('css-class-name')            // 'Css-class-name'\ncapitalize('my favorite items')         // 'My favorite items'\ncapitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "capitalize", + "params": [ + { + "name": "str", + "description": "The string to capitalize.", + "type": "String" + } + ], + "return": { + "description": "The capitalized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/string", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/classes/ember-4.3.0-rsvp-9660918fcf.json b/json-docs/ember/4.3.0/classes/ember-4.3.0-rsvp-9660918fcf.json new file mode 100644 index 000000000..5f222f887 --- /dev/null +++ b/json-docs/ember/4.3.0/classes/ember-4.3.0-rsvp-9660918fcf.json @@ -0,0 +1,445 @@ +{ + "data": { + "id": "ember-4.3.0-rsvp", + "type": "class", + "attributes": { + "name": "rsvp", + "shortname": "rsvp", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/all-settled.js", + "line": 20, + "description": "

RSVP.allSettled is similar to RSVP.all, but instead of implementing\na fail-fast method, it waits until all the promises have returned and\nshows you all the results. This is useful if you want to handle multiple\npromises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled. The return promise is fulfilled with an array of the states of\nthe promises passed into the promises array argument.

\n

Each state object will either indicate fulfillment or rejection, and\nprovide the corresponding value or reason. The states will take one of\nthe following formats:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{ state: 'fulfilled', value: value }\n  or\n{ state: 'rejected', reason: reason }
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
let promise1 = RSVP.Promise.resolve(1);\nlet promise2 = RSVP.Promise.reject(new Error('2'));\nlet promise3 = RSVP.Promise.reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nRSVP.allSettled(promises).then(function(array){\n  // array == [\n  //   { state: 'fulfilled', value: 1 },\n  //   { state: 'rejected', reason: Error },\n  //   { state: 'rejected', reason: Error }\n  // ]\n  // Note that for the second item, reason.message will be '2', and for the\n  // third item, reason.message will be '3'.\n}, function(error) {\n  // Not run. (This block would only be called if allSettled had failed,\n  // for instance if passed an incorrect argument type.)\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "allSettled", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "entries", + "description": "", + "type": "Array" + }, + { + "name": "label", + "description": "- optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with an array of the settled\nstates of the constituent promises.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/all.js", + "line": 3, + "description": "

This is a convenient alias for Promise.all.

\n", + "itemtype": "method", + "name": "all", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/defer.js", + "line": 3, + "description": "

defer returns an object similar to jQuery's $.Deferred.\ndefer should be used when porting over code reliant on $.Deferred's\ninterface. New code should use the Promise constructor instead.

\n

The object returned from defer is a plain object with three properties:

\n
    \n
  • promise - an Promise.
  • \n
  • reject - a function that causes the promise property on this object to\nbecome rejected
  • \n
  • resolve - a function that causes the promise property on this object to\nbecome fulfilled.
  • \n
\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let deferred = defer();\n\ndeferred.resolve("Success!");\n\ndeferred.promise.then(function(value){\n  // value here is "Success!"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "defer", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 19, + "description": "

EventTarget.mixin extends an object with EventTarget methods. For\nExample:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import EventTarget from 'rsvp';\n\nlet object = {};\n\nEventTarget.mixin(object);\n\nobject.on('finished', function(event) {\n  // handle event\n});\n\nobject.trigger('finished', { detail: value });
\n
\n
\n \n

EventTarget.mixin also works with prototypes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EventTarget from 'rsvp';\n\nlet Person = function() {};\nEventTarget.mixin(Person.prototype);\n\nlet yehuda = new Person();\nlet tom = new Person();\n\nyehuda.on('poke', function(event) {\n  console.log('Yehuda says OW');\n});\n\ntom.on('poke', function(event) {\n  console.log('Tom says OW');\n});\n\nyehuda.trigger('poke');\ntom.trigger('poke');
\n
\n
\n \n", + "itemtype": "method", + "name": "mixin", + "access": "private", + "tagname": "", + "params": [ + { + "name": "object", + "description": "object to extend with EventTarget methods", + "type": "Object" + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 107, + "description": "

You can use off to stop firing a particular callback for an event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function doStuff() { // do stuff! }\nobject.on('stuff', doStuff);\n\nobject.trigger('stuff'); // doStuff will be called\n\n// Unregister ONLY the doStuff callback\nobject.off('stuff', doStuff);\nobject.trigger('stuff'); // doStuff will NOT be called
\n
\n
\n \n

If you don't pass a callback argument to off, ALL callbacks for the\nevent will not be executed when the event fires. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let callback1 = function(){};\nlet callback2 = function(){};\n\nobject.on('stuff', callback1);\nobject.on('stuff', callback2);\n\nobject.trigger('stuff'); // callback1 and callback2 will be executed.\n\nobject.off('stuff');\nobject.trigger('stuff'); // callback1 and callback2 will not be executed!
\n
\n
\n \n", + "itemtype": "method", + "name": "off", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "event to stop listening to", + "type": "String" + }, + { + "name": "callback", + "description": "optional argument. If given, only the function\ngiven will be removed from the event's callback queue. If no `callback`\nargument is given, all callbacks will be removed from the event's callback\nqueue.", + "type": "Function", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 162, + "description": "

Use trigger to fire custom events. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
object.on('foo', function(){\n  console.log('foo event happened!');\n});\nobject.trigger('foo');\n// 'foo event happened!' logged to the console
\n
\n
\n \n

You can also pass a value as a second argument to trigger that will be\npassed as an argument to all event listeners for the event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
object.on('foo', function(value){\n  console.log(value.name);\n});\n\nobject.trigger('foo', { name: 'bar' });\n// 'bar' logged to the console
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "name of the event to be triggered", + "type": "String" + }, + { + "name": "options", + "description": "optional value to be passed to any event handlers for\nthe given `eventName`", + "type": "*", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/filter.js", + "line": 42, + "description": "

filter is similar to JavaScript's native filter method.\nfilterFn is eagerly called meaning that as soon as any promise\n resolves its value will be passed to filterFn. filter returns\n a promise that will become fulfilled with the result of running\n filterFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { filter, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\n\nlet promises = [promise1, promise2, promise3];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(result){\n  // result is [ 2, 3 ]\n});
\n
\n
\n \n

If any of the promises given to filter are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { filter, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

filter will also wait for any promises returned from filterFn.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter, resolve } from 'rsvp';\n\nlet alice = { name: 'alice' };\nlet bob   = { name: 'bob' };\nlet users = [ alice, bob ];\n\nlet promises = users.map(function(user){\n  return resolve(user);\n});\n\nlet filterFn = function(user){\n  // Here, Alice has permissions to create a blog post, but Bob does not.\n  return getPrivilegesForUser(user).then(function(privs){\n    return privs.can_create_blog_post === true;\n  });\n};\nfilter(promises, filterFn).then(function(users){\n  // true, because the server told us only Alice can create a blog post.\n  users.length === 1;\n  // false, because Alice is the only user present in `users`\n  users[0] === bob;\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "filterFn", + "description": "- function to be called on each resolved value to\n filter the final results.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string describing the promise. Useful for\n tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash-settled.js", + "line": 16, + "description": "

hashSettled is similar to allSettled, but takes an object\ninstead of an array for its promises argument.

\n

Unlike all or hash, which implement a fail-fast method,\nbut like allSettled, hashSettled waits until all the\nconstituent promises have returned and then shows you all the results\nwith their states and values/reasons. This is useful if you want to\nhandle multiple promises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled, or rejected if the passed parameters are invalid.

\n

The returned promise is fulfilled with a hash that has the same key names as\nthe promises object argument. If any of the values in the object are not\npromises, they will be copied over to the fulfilled object and marked with state\n'fulfilled'.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: { state: 'fulfilled', value: 1 },\n  //   yourPromise: { state: 'fulfilled', value: 2 },\n  //   theirPromise: { state: 'fulfilled', value: 3 },\n  //   notAPromise: { state: 'fulfilled', value: 4 }\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the state will\nbe set to 'rejected' and the reason for rejection provided.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, reject, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejection')),\n  anotherRejectedPromise: reject(new Error('more rejection')),\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise:              { state: 'fulfilled', value: 1 },\n  //   rejectedPromise:        { state: 'rejected', reason: Error },\n  //   anotherRejectedPromise: { state: 'rejected', reason: Error },\n  // }\n  // Note that for rejectedPromise, reason.message == 'rejection',\n  // and for anotherRejectedPromise, reason.message == 'more rejection'.\n});
\n
\n
\n \n

An important note: hashSettled is intended for plain JavaScript objects that\nare just a set of keys and values. hashSettled will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import Promise, { hashSettled, resolve } from 'rsvp';\n\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: Promise.resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhashSettled(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: { state: 'fulfilled', value: 'Example' }\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hashSettled", + "access": "public", + "tagname": "", + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when when all properties of `promises`\nhave been settled.", + "type": "Promise" + }, + "static": 1, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash.js", + "line": 4, + "description": "

hash is similar to all, but takes an object instead of an array\nfor its promises argument.

\n

Returns a promise that is fulfilled when all the given promises have been\nfulfilled, or rejected if any of them become rejected. The returned promise\nis fulfilled with a hash that has the same key names as the promises object\nargument. If any of the values in the object are not promises, they will\nsimply be copied over to the fulfilled object.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhash(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: 1,\n  //   yourPromise: 2,\n  //   theirPromise: 3,\n  //   notAPromise: 4\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the first promise\nthat is rejected will be given as the reason to the rejection handler.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejectedPromise')),\n  anotherRejectedPromise: reject(new Error('anotherRejectedPromise')),\n};\n\nhash(promises).then(function(hash){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === 'rejectedPromise'\n});
\n
\n
\n \n

An important note: hash is intended for plain JavaScript objects that\nare just a set of keys and values. hash will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { hash, resolve } from 'rsvp';\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhash(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: 'Example'\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all properties of `promises`\nhave been fulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/map.js", + "line": 39, + "description": "

map is similar to JavaScript's native map method. mapFn is eagerly called\n meaning that as soon as any promise resolves its value will be passed to mapFn.\n map returns a promise that will become fulfilled with the result of running\n mapFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(result){\n  // result is [ 2, 3, 4 ]\n});
\n
\n
\n \n

If any of the promises given to map are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { map, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

map will also wait if a promise is returned from mapFn. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first because they contain a url to those comments.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map } from 'rsvp';\n\nlet mapFn = function(blogPost){\n  // getComments does some ajax and returns an Promise that is fulfilled\n  // with some comments data\n  return getComments(blogPost.comments_url);\n};\n\n// getBlogPosts does some ajax and returns an Promise that is fulfilled\n// with some blog post data\nmap(getBlogPosts(), mapFn).then(function(comments){\n  // comments is the result of asking the server for the comments\n  // of all blog posts returned from getBlogPosts()\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "mapFn", + "description": "function to be called on each fulfilled promise.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\n Useful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/node.js", + "line": 44, + "description": "

denodeify takes a 'node-style' function and returns a function that\nwill return an Promise. You can use denodeify in Node.js or the\nbrowser when you'd prefer to use promises over using callbacks. For example,\ndenodeify transforms the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) return handleError(err);\n  handleData(data);\n});
\n
\n
\n \n

into:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\n\nreadFile('myfile.txt').then(handleData, handleError);
\n
\n
\n \n

If the node function has multiple success parameters, then denodeify\njust returns the first one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let request = denodeify(require('request'));\n\nrequest('http://example.com').then(function(res) {\n  // ...\n});
\n
\n
\n \n

However, if you need all success parameters, setting denodeify's\nsecond parameter to true causes it to return all success parameters\nas an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), true);\n\nrequest('http://example.com').then(function(result) {\n  // result[0] -> res\n  // result[1] -> body\n});
\n
\n
\n \n

Or if you pass it an array with names it returns the parameters as a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), ['res', 'body']);\n\nrequest('http://example.com').then(function(result) {\n  // result.res\n  // result.body\n});
\n
\n
\n \n

Sometimes you need to retain the this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let app = require('express')();\nlet render = denodeify(app.render.bind(app));
\n
\n
\n \n

The denodified function inherits from the original function. It works in all\nenvironments, except IE 10 and below. Consequently all properties of the original\nfunction are available to you. However, any properties you change on the\ndenodeified function won't be changed on the original function. Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request')),\n    cookieJar = request.jar(); // <- Inheritance is used here\n\nrequest('http://example.com', {jar: cookieJar}).then(function(res) {\n  // cookieJar.cookies holds now the cookies returned by example.com\n});
\n
\n
\n \n

Using denodeify makes it easier to compose asynchronous operations instead\nof using callbacks. For example, instead of:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) { ... } // Handle error\n  fs.writeFile('myfile2.txt', data, function(err){\n    if (err) { ... } // Handle error\n    console.log('done')\n  });\n});
\n
\n
\n \n

you can chain the operations together using then from the returned promise:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\nlet writeFile = denodeify(fs.writeFile);\n\nreadFile('myfile.txt').then(function(data){\n  return writeFile('myfile2.txt', data);\n}).then(function(){\n  console.log('done')\n}).catch(function(error){\n  // Handle error\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "denodeify", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "nodeFunc", + "description": "a 'node-style' function that takes a callback as\nits last argument. The callback expects an error to be passed as its first\nargument (if an error occurred, otherwise null), and the value from the\noperation as its second argument ('function(err, value){ }').", + "type": "Function" + }, + { + "name": "options", + "description": "An optional paramter that if set\nto `true` causes the promise to fulfill with the callback's success arguments\nas an array. This is useful if the node function has multiple success\nparamters. If you set this paramter to an array with names, the promise will\nfulfill with a hash with these names as keys and the success parameters as\nvalues.", + "type": "Boolean|Array", + "optional": true + } + ], + "return": { + "description": "a function that wraps `nodeFunc` to return a `Promise`", + "type": "Function" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/race.js", + "line": 3, + "description": "

This is a convenient alias for Promise.race.

\n", + "itemtype": "method", + "name": "race", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/reject.js", + "line": 3, + "description": "

This is a convenient alias for Promise.reject.

\n", + "itemtype": "method", + "name": "reject", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/resolve.js", + "line": 3, + "description": "

This is a convenient alias for Promise.resolve.

\n", + "itemtype": "method", + "name": "resolve", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "value", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/rethrow.js", + "line": 1, + "description": "

rethrow will rethrow an error on the next turn of the JavaScript event\nloop in order to aid debugging.

\n

Promises A+ specifies that any exceptions that occur with a promise must be\ncaught by the promises implementation and bubbled to the last handler. For\nthis reason, it is recommended that you always specify a second rejection\nhandler function to then. However, rethrow will throw the exception\noutside of the promise, so it bubbles up to your console if in the browser,\nor domain/cause uncaught exception in Node. rethrow will also throw the\nerror again so the error can be handled by the promise per the spec.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { rethrow } from 'rsvp';\n\nfunction throws(){\n  throw new Error('Whoops!');\n}\n\nlet promise = new Promise(function(resolve, reject){\n  throws();\n});\n\npromise.catch(rethrow).then(function(){\n  // Code here doesn't run because the promise became rejected due to an\n  // error!\n}, function (err){\n  // handle the error here\n});
\n
\n
\n \n

The 'Whoops' error will be thrown on the next turn of the event loop\nand you can watch for it in your console. You can also handle it using a\nrejection handler given to .then or .catch on the returned promise.

\n", + "itemtype": "method", + "name": "rethrow", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "reason the promise became rejected.", + "type": "Error" + } + ], + "throws": { + "description": "Error" + }, + "class": "rsvp", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/modules/ember-4.3.0-@ember/component-7fc588818a.json b/json-docs/ember/4.3.0/modules/ember-4.3.0-@ember/component-7fc588818a.json new file mode 100644 index 000000000..bcca181e9 --- /dev/null +++ b/json-docs/ember/4.3.0/modules/ember-4.3.0-@ember/component-7fc588818a.json @@ -0,0 +1,89 @@ +{ + "data": { + "id": "ember-4.3.0-@ember/component", + "type": "module", + "attributes": { + "name": "@ember/component", + "submodules": {}, + "elements": {}, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/component": 1, + "Ember.Templates.components": 1, + "@ember/component/helper": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 37, + "description": "

Glimmer is a templating engine used by Ember.js that is compatible with a subset of the Handlebars syntax.

\n

Showing a property

\n

Templates manage the flow of an application's UI, and display state (through\nthe DOM) to a user. For example, given a component with the property "name",\nthat component's template can use the name in several ways:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  name: 'Jill'\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
{{this.name}}\n<div>{{this.name}}</div>\n<span data-name={{this.name}}></span>
\n
\n
\n \n

Any time the "name" property on the component changes, the DOM will be\nupdated.

\n

Properties can be chained as well:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{@aUserModel.name}}\n<div>{{@listOfUsers.firstObject.name}}</div>
\n
\n
\n \n

Using Ember helpers

\n

When content is passed in mustaches {{}}, Ember will first try to find a helper\nor component with that name. For example, the if helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
{{if this.name "I have a name" "I have no name"}}\n<span data-has-name={{if this.name true}}></span>
\n
\n
\n \n

The returned value is placed where the {{}} is called. The above style is\ncalled "inline". A second style of helper usage is called "block". For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#if this.name}}\n  I have a name\n{{else}}\n  I have no name\n{{/if}}
\n
\n
\n \n

The block form of helpers allows you to control how the UI is created based\non the values of properties.\nA third form of helper is called "nested". For example here the concat\nhelper will add " Doe" to a displayed name if the person has no last name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<span data-name={{concat this.firstName (\n  if this.lastName (concat " " this.lastName) "Doe"\n)}}></span>
\n
\n
\n \n

Ember's built-in helpers are described under the Ember.Templates.helpers\nnamespace. Documentation on creating custom helpers can be found under\nhelper (or\nunder Helper if a helper requires access to\ndependency injection).

\n

Invoking a Component

\n

Ember components represent state to the UI of an application. Further\nreading on components can be found under Component.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "Component", + "Helper" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 239, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "allstaticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 239, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "version": "4.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/modules/ember-4.3.0-@glimmer/component-e7492d180f.json b/json-docs/ember/4.3.0/modules/ember-4.3.0-@glimmer/component-e7492d180f.json new file mode 100644 index 000000000..fb2264096 --- /dev/null +++ b/json-docs/ember/4.3.0/modules/ember-4.3.0-@glimmer/component-e7492d180f.json @@ -0,0 +1,36 @@ +{ + "data": { + "id": "ember-4.3.0-@glimmer/component", + "type": "module", + "attributes": { + "name": "@glimmer/component", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts", + "line": 1, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault component's for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Template-only and Glimmer components. If you\nare looking for the API documentation for Classic components, it is\navailable here. The source code for\nGlimmer components can be found in @glimmer/component.

\n

Defining a Template-only Component

\n

The simplest way to create a component is to create a template file in\napp/templates/components. For example, if you name a template\napp/templates/components/person-profile.hbs:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
<h1>{{@person.name}}</h1>\n<img src={{@person.avatar}}>\n<p class='signature'>{{@person.signature}}</p>
\n
\n
\n \n

You will be able to use <PersonProfile /> to invoke this component elsewhere\nin your application:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<PersonProfile @person={{this.currentUser}} />
\n
\n
\n \n

Note that component names are capitalized here in order to distinguish them\nfrom regular HTML elements, but they are dasherized in the file system.

\n

While the angle bracket invocation form is generally preferred, it is also\npossible to invoke the same component with the {{person-profile}} syntax:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person-profile person=this.currentUser}}
\n
\n
\n \n

Note that with this syntax, you use dashes in the component name and\narguments are passed without the @ sign.

\n

In both cases, Ember will render the content of the component template we\ncreated above. The end result will be something like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\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 \n

File System Nesting

\n

Components can be nested inside sub-folders for logical groupping. For\nexample, if we placed our template in\napp/templates/components/person/short-profile.hbs, we can invoke it as\n<Person::ShortProfile />:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Person::ShortProfile @person={{this.currentUser}} />
\n
\n
\n \n

Or equivalently, {{person/short-profile}}:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person/short-profile person=this.currentUser}}
\n
\n
\n \n

Using Blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield}}
\n
\n
\n \n

We could then invoke it like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}}>\n  <p>Admin mode</p>\n</PersonProfile>
\n
\n
\n \n

or with curly syntax like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-profile person=this.currentUser}}\n  <p>Admin mode</p>\n{{/person-profile}}
\n
\n
\n \n

And 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

Blocks are executed in their original context, meaning they have access to the\nscope and any in-scope variables where they were defined.

\n

Passing parameters to blocks

\n

You can also pass positional parameters to {{yield}}, which are then made\navailable in the block:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

We can then use this value in the block like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}} as |signature|>\n  {{signature}}\n</PersonProfile>
\n
\n
\n \n

Passing multiple blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield to="title"}}</h1>\n{{yield}}
\n
\n
\n \n

This component could then be invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title>{{this.currentUser.name}}</:title>\n  <:default>{{this.currentUser.signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

When 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

Passing parameters to named blocks

\n

You can also pass parameters to named blocks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield @person.name to="title"}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

These parameters can then be used like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title as |name|>{{name}}</:title>\n  <:default as |signature|>{{signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

Checking to see if a block exists

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\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
\n \n

With this template, we can then optionally pass in one block, both blocks, or\nnone at all:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\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 \n

Checking to see if a block has parameters

\n

We can also check if a block receives parameters using the (has-block-params)\nkeyword, and conditionally yield different values if so.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
{{#if (has-block-params)}}\n  {{yield @person.signature}}\n{{else}}\n  {{yield}}\n{{/if}}
\n
\n
\n \n

Customizing Components With JavaScript

\n

To 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\nPersonProfile component which we defined above, we would create\napp/comopnents/person-profile.js and export our class as the default, like\nso:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n \n

You 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\ndisplayName property of our PersonProfile component instance in the\ntemplate like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

constructor

\n

params: owner object and args object

\n

Constructs 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import 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
\n \n

Service injections and arguments are available in the constructor.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import 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 \n

willDestroy

\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import 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 \n

args

\n

The args property of Glimmer components is an object that contains the\narguments that are passed to the component. For instance, the\nfollowing component usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @fadeIn={{true}} />
\n
\n
\n \n

Would result in the following args object to be passed to the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ fadeIn: true }
\n
\n
\n \n

args can be accessed at any point in the component lifecycle, including\nconstructor and willDestroy. They are also automatically marked as tracked\nproperties, and they can be depended on as computed property dependencies:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import 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 \n

isDestroying

\n

A boolean flag to tell if the component is in the process of destroying. This is set to\ntrue before willDestroy is called.

\n

isDestroyed

\n

A boolean to tell if the component has been fully destroyed. This is set to true\nafter willDestroy is called.

\n", + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "4.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/namespaces/ember-4.3.0-AutoLocation-488f98ff7a.json b/json-docs/ember/4.3.0/namespaces/ember-4.3.0-AutoLocation-488f98ff7a.json new file mode 100644 index 000000000..4105433cc --- /dev/null +++ b/json-docs/ember/4.3.0/namespaces/ember-4.3.0-AutoLocation-488f98ff7a.json @@ -0,0 +1,129 @@ +{ + "data": { + "id": "ember-4.3.0-AutoLocation", + "type": "namespace", + "attributes": { + "name": "AutoLocation", + "shortname": "AutoLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 21, + "description": "

AutoLocation will select the best location option based off browser\nsupport with the priority order: history, hash, none.

\n

Clean pushState paths accessed by hashchange-only browsers will be redirected\nto the hash-equivalent and vice versa so future transitions are consistent.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n

Browsers that support the history API will use HistoryLocation, those that\ndo not, but still support the hashchange event will use HashLocation, and\nin the rare case neither is supported will use NoneLocation.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'auto'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new for modern browsers that\nsupport the history api or /#/posts/new for older ones, like Internet\nExplorer 9 and below.

\n

When a user visits a link to your application, they will be automatically\nupgraded or downgraded to the appropriate Location class, with the URL\ntransformed accordingly, if needed.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n", + "static": 1, + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 346, + "access": "private", + "tagname": "Returns the current path as it should appear for HashLocation supported\nbrowsers. This may very well differ from the real current path.", + "itemtype": "method", + "name": "_getHashPath", + "class": "AutoLocation", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 79, + "access": "private", + "tagname": "Will be pre-pended to path upon state change.", + "since": "1.5.1", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 91, + "access": "private", + "tagname": "The browser's `location` object. This is typically equivalent to\n`window.location`, but may be overridden for testing.", + "itemtype": "property", + "name": "location", + "default": "environment.location", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 103, + "access": "private", + "tagname": "The browser's `history` object. This is typically equivalent to\n`window.history`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "history", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 116, + "access": "private", + "tagname": "The user agent's global variable. In browsers, this will be `window`.", + "since": "1.11", + "itemtype": "property", + "name": "global", + "default": "window", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 128, + "access": "private", + "tagname": "The browser's `userAgent`. This is typically equivalent to\n`navigator.userAgent`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "userAgent", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 141, + "access": "private", + "tagname": "This property is used by the router to know whether to cancel the routing\nsetup process, which is needed while we redirect the browser.", + "since": "1.5.1", + "itemtype": "property", + "name": "cancelRouterSetup", + "default": "false", + "class": "AutoLocation", + "module": "@ember/routing" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.3.0/namespaces/ember-4.3.0-Instrumentation-e6976f2ae0.json b/json-docs/ember/4.3.0/namespaces/ember-4.3.0-Instrumentation-e6976f2ae0.json new file mode 100644 index 000000000..e8638ef32 --- /dev/null +++ b/json-docs/ember/4.3.0/namespaces/ember-4.3.0-Instrumentation-e6976f2ae0.json @@ -0,0 +1,46 @@ +{ + "data": { + "id": "ember-4.3.0-Instrumentation", + "type": "namespace", + "attributes": { + "name": "Instrumentation", + "shortname": "Instrumentation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/instrumentation", + "namespace": "", + "file": "packages/@ember/instrumentation/index.ts", + "line": 40, + "description": "

The purpose of the Ember Instrumentation module is\nto provide efficient, general-purpose instrumentation\nfor Ember.

\n

Subscribe to a listener by using subscribe:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { subscribe } from '@ember/instrumentation';\n\nsubscribe("render", {\n  before(name, timestamp, payload) {\n\n  },\n\n  after(name, timestamp, payload) {\n\n  }\n});
\n
\n
\n \n

If you return a value from the before callback, that same\nvalue will be passed as a fourth parameter to the after\ncallback.

\n

Instrument a block of code by using instrument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { instrument } from '@ember/instrumentation';\n\ninstrument("render.handlebars", payload, function() {\n  // rendering logic\n}, binding);
\n
\n
\n \n

Event names passed to instrument are namespaced\nby periods, from more general to more specific. Subscribers\ncan listen for events by whatever level of granularity they\nare interested in.

\n

In the above example, the event is render.handlebars,\nand the subscriber listened for all events beginning with\nrender. It would receive callbacks for events named\nrender, render.handlebars, render.container, or\neven render.handlebars.layout.

\n", + "static": 1, + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.3.0-@ember/instrumentation", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/application-09c346a385.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/application-09c346a385.json new file mode 100644 index 000000000..5c60d18c4 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/application-09c346a385.json @@ -0,0 +1,138 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/application", + "type": "class", + "attributes": { + "name": "@ember/application", + "shortname": "@ember/application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 31, + "description": "

Framework objects in an Ember application (components, services, routes, etc.)\nare created via a factory and dependency injection system. Each of these\nobjects is the responsibility of an "owner", which handled its\ninstantiation and manages its lifetime.

\n

getOwner fetches the owner object responsible for an instance. This can\nbe used to lookup or resolve other class instances, or register new factories\ninto the owner.

\n

For example, this component dynamically looks up a service based on the\naudioType passed as an argument:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
audio.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getOwner } from '@ember/application';\n\n// Usage:\n//\n//   <PlayAudio @audioType={{@model.audioType}} @audioFile={{@model.file}}/>\n//\nexport default class extends Component {\n  get audioService() {\n    let owner = getOwner(this);\n    return owner.lookup(`service:${this.args.audioType}`);\n  }\n\n  @action\n  onPlay() {\n    let player = this.audioService;\n    player.play(this.args.audioFile);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "getOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object with an owner.", + "type": "Object" + } + ], + "return": { + "description": "An owner object.", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 79, + "description": "

setOwner forces a new owner on a given object instance. This is primarily\nuseful in some testing cases.

\n", + "itemtype": "method", + "name": "setOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object instance.", + "type": "Object" + }, + { + "name": "object", + "description": "The new owner object of the object instance.", + "type": "Object" + } + ], + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 14, + "description": "

Detects when a specific package of Ember (e.g. 'Application')\nhas fully loaded and is available for extension.

\n

The provided callback will be called with the name passed\nresolved from a string into the object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { onLoad } from '@ember/application';\n\nonLoad('Ember.Application' function(hbars) {\n  hbars.registerHelper(...);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "onLoad", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "callback", + "description": "callback to be called", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 47, + "description": "

Called when an Ember.js package (e.g Application) has finished\nloading. Triggers any callbacks registered for this event.

\n", + "itemtype": "method", + "name": "runLoadHooks", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "object", + "description": "object to pass to callbacks", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/component/helper-dc8f61395c.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/component/helper-dc8f61395c.json new file mode 100644 index 000000000..265deba56 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/component/helper-dc8f61395c.json @@ -0,0 +1,61 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/component/helper", + "type": "class", + "attributes": { + "name": "@ember/component/helper", + "shortname": "@ember/component/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 267, + "description": "

In many cases it is not necessary to use the full Helper class.\nThe helper method create pure-function helpers without instances.\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n
import { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n  return `${currency}${cents * 0.01}`;\n});
\n
\n
\n \n", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/controller-86218e6955.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/controller-86218e6955.json new file mode 100644 index 000000000..853eef886 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/controller-86218e6955.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/controller", + "type": "class", + "attributes": { + "name": "@ember/controller", + "shortname": "@ember/controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 20, + "description": "

Creates a property that lazily looks up another controller in the container.\nCan only be used when defining another controller.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default class PostController extends Controller {\n  @controller posts;\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default Controller.extend({\n  posts: controller()\n});
\n
\n
\n \n

This example will create a posts property on the post controller that\nlooks up the posts controller in the container, making it easy to reference\nother controllers.

\n", + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the controller to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/controller", + "module": "@ember/controller" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/debug-f156c2e4e6.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/debug-f156c2e4e6.json new file mode 100644 index 000000000..8e2fb407e --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/debug-f156c2e4e6.json @@ -0,0 +1,310 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/debug", + "type": "class", + "attributes": { + "name": "@ember/debug", + "shortname": "@ember/debug", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 915, + "description": "

Allows checking if a given property on an object is a computed property. For the most part,\nthis doesn't matter (you would normally just access the property directly and use its value),\nbut for some tooling specific scenarios (e.g. the ember-inspector) it is important to\ndifferentiate if a property is a computed property or a "normal" property.

\n

This will work on either a class's prototype or an instance itself.

\n", + "static": 1, + "itemtype": "method", + "name": "isComputed", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/object" + }, + { + "file": "packages/@ember/debug/lib/capture-render-tree.ts", + "line": 9, + "description": "

Ember Inspector calls this function to capture the current render tree.

\n

In production mode, this requires turning on ENV._DEBUG_RENDER_TREE\nbefore loading Ember.

\n", + "access": "private", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "captureRenderTree", + "params": [ + { + "name": "app", + "description": "An `ApplicationInstance`.", + "type": "ApplicationInstance" + } + ], + "since": "3.14.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 36, + "description": "

Allows for runtime registration of handler functions that override the default deprecation behavior.\nDeprecations are invoked by calls to @ember/debug/deprecate.\nThe following example demonstrates its usage by registering a handler that throws an error if the\nmessage contains the word "should", otherwise defers to the default handler.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { registerDeprecationHandler } from '@ember/debug';\n\nregisterDeprecationHandler((message, options, next) => {\n  if (message.indexOf('should') !== -1) {\n    throw new Error(`Deprecation message with should: ${message}`);\n  } else {\n    // defer to whatever handler was registered before this one\n    next(message, options);\n  }\n});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the deprecation call.
  • \n
  • options - An object passed in with the deprecation call containing additional information including:
  • \n
      \n
    • id - An id of the deprecation in the form of package-name.specific-deprecation.
    • \n
    • until - The Ember version number the feature and deprecation will be removed in.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerDeprecationHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle deprecation calls.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 181, + "description": "

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only).

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n", + "itemtype": "method", + "name": "deprecate", + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "test", + "description": "A boolean. If falsy, the deprecation will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "", + "type": "Object", + "props": [ + { + "name": "id", + "description": "A unique id for this deprecation. The id can be\n used by Ember debugging tools to change the behavior (raise, log or silence)\n for that specific deprecation. The id should be namespaced by dots, e.g.\n \"view.helper.select\".", + "type": "String" + }, + { + "name": "until", + "description": "The version of Ember when this deprecation\n warning will be removed.", + "type": "String" + }, + { + "name": "for", + "description": "A namespace for the deprecation, usually the package name", + "type": "String" + }, + { + "name": "since", + "description": "Describes when the deprecation became available and enabled.", + "type": "Object" + }, + { + "name": "url", + "description": "An optional url to the transition guide on the\n emberjs.com website.", + "type": "String", + "optional": true + } + ] + } + ], + "static": 1, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 23, + "description": "

Allows for runtime registration of handler functions that override the default warning behavior.\nWarnings are invoked by calls made to @ember/debug/warn.\nThe following example demonstrates its usage by registering a handler that does nothing overriding Ember's\ndefault warning behavior.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { registerWarnHandler } from '@ember/debug';\n\n// next is not called, so no warnings get the default behavior\nregisterWarnHandler(() => {});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the warn call.
  • \n
  • options - An object passed in with the warn call containing additional information including:
  • \n
      \n
    • id - An id of the warning in the form of package-name.specific-warning.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWarnHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle warnings.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 70, + "description": "

Display a warning with the provided message.

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { warn } from '@ember/debug';\nimport tomsterCount from './tomster-counter'; // a module in my project\n\n// Log a warning if we have more than 3 tomsters\nwarn('Too many tomsters!', tomsterCount <= 3, {\n  id: 'ember-debug.too-many-tomsters'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "warn", + "static": 1, + "params": [ + { + "name": "message", + "description": "A warning to display.", + "type": "String" + }, + { + "name": "test", + "description": "An optional boolean. If falsy, the warning\n will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "An object that can be used to pass a unique\n `id` for this warning. The `id` can be used by Ember debugging tools\n to change the behavior (raise, log, or silence) for that specific warning.\n The `id` should be namespaced by dots, e.g. \"ember-debug.feature-flag-with-features-stripped\"", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 134, + "description": "

Verify that a certain expectation is met, or throw a exception otherwise.

\n

This is useful for communicating assumptions in the code to other human\nreaders as well as catching bugs that accidentally violates these\nexpectations.

\n

Assertions are removed from production builds, so they can be freely added\nfor documentation and debugging purposes without worries of incuring any\nperformance penalty. However, because of that, they should not be used for\nchecks that could reasonably fail during normal usage. Furthermore, care\nshould be taken to avoid accidentally relying on side-effects produced from\nevaluating the condition itself, since the code will not run in production.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assert } from '@ember/debug';\n\n// Test for truthiness\nassert('Must pass a string', typeof str === 'string');\n\n// Fail unconditionally\nassert('This code path should never be run');
\n
\n
\n \n", + "itemtype": "method", + "name": "assert", + "static": 1, + "params": [ + { + "name": "description", + "description": "Describes the expectation. This will become the\n text of the Error thrown if the assertion fails.", + "type": "String" + }, + { + "name": "condition", + "description": "Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.", + "type": "Any" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 174, + "description": "

Display a debug notice.

\n

Calls to this function are not invoked in production builds.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { debug } from '@ember/debug';\n\ndebug('I\\'m a debug notice!');
\n
\n
\n \n", + "itemtype": "method", + "name": "debug", + "static": 1, + "params": [ + { + "name": "message", + "description": "A debug message to display.", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 201, + "description": "

Display an info notice.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n", + "itemtype": "method", + "name": "info", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 220, + "description": "

Alias an old, deprecated method with its new counterpart.

\n

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only) when the assigned method is called.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { deprecateFunc } from '@ember/debug';\n\nEmber.oldMethod = deprecateFunc('Please use the new, updated method', options, Ember.newMethod);
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecateFunc", + "static": 1, + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "options", + "description": "The options object for `deprecate`.", + "type": "Object", + "optional": true + }, + { + "name": "func", + "description": "The new function called to replace its deprecated counterpart.", + "type": "Function" + } + ], + "return": { + "description": "A new function that wraps the original function with a deprecation warning", + "type": "Function" + }, + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 265, + "description": "

Run a function meant for debugging.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport { runInDebug } from '@ember/debug';\n\nrunInDebug(() => {\n  Component.reopen({\n    didInsertElement() {\n      console.log("I'm happy");\n    }\n  });\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "runInDebug", + "static": 1, + "params": [ + { + "name": "func", + "description": "The function to be executed.", + "type": "Function" + } + ], + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/destroyable-9cacec7d15.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/destroyable-9cacec7d15.json new file mode 100644 index 000000000..4dde7dce8 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/destroyable-9cacec7d15.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/destroyable", + "type": "class", + "attributes": { + "name": "@ember/destroyable", + "shortname": "@ember/destroyable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/destroyable", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/destroyable/index.ts", + "line": 31, + "description": "

This function is used to associate a destroyable object with a parent. When the parent\nis destroyed, all registered children will also be destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
class CustomSelect extends Component {\n  constructor(...args) {\n    super(...args);\n\n    // obj is now a child of the component. When the component is destroyed,\n    // obj will also be destroyed, and have all of its destructors triggered.\n    this.obj = associateDestroyableChild(this, {});\n  }\n}
\n
\n
\n \n

Returns the associated child for convenience.

\n", + "itemtype": "method", + "name": "associateDestroyableChild", + "params": [ + { + "name": "parent", + "description": "the destroyable to entangle the child destroyables lifetime with", + "type": "Object|Function" + }, + { + "name": "child", + "description": "the destroyable to be entangled with the parents lifetime", + "type": "Object|Function" + } + ], + "return": { + "description": "the child argument", + "type": "Object|Function" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 58, + "description": "

Receives a destroyable, and returns true if the destroyable has begun destroying. Otherwise returns\nfalse.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let obj = {};\nisDestroying(obj); // false\ndestroy(obj);\nisDestroying(obj); // true\n// ...sometime later, after scheduled destruction\nisDestroyed(obj); // true\nisDestroying(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroying", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 80, + "description": "

Receives a destroyable, and returns true if the destroyable has finished destroying. Otherwise\nreturns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let obj = {};\n\nisDestroyed(obj); // false\ndestroy(obj);\n\n// ...sometime later, after scheduled destruction\n\nisDestroyed(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroyed", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 103, + "description": "

Initiates the destruction of a destroyable object. It runs all associated destructors, and then\ndestroys all children recursively.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let obj = {};\n\nregisterDestructor(obj, () => console.log('destroyed!'));\n\ndestroy(obj); // this will schedule the destructor to be called\n\n// ...some time later, during scheduled destruction\n\n// destroyed!
\n
\n
\n \n

Destruction via destroy() follows these steps:

\n

1, Mark the destroyable such that isDestroying(destroyable) returns true\n2, Call destroy() on each of the destroyable's associated children\n3, Schedule calling the destroyable's destructors\n4, Schedule setting destroyable such that isDestroyed(destroyable) returns true

\n

This results in the entire tree of destroyables being first marked as destroying,\nthen having all of their destructors called, and finally all being marked as isDestroyed.\nThere won't be any in between states where some items are marked as isDestroying while\ndestroying, while others are not.

\n", + "itemtype": "method", + "name": "destroy", + "params": [ + { + "name": "destroyable", + "description": "the object to destroy", + "type": "Object|Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 138, + "description": "

This function asserts that all objects which have associated destructors or associated children\nhave been destroyed at the time it is called. It is meant to be a low level hook that testing\nframeworks can use to hook into and validate that all destroyables have in fact been destroyed.

\n

This function requires that enableDestroyableTracking was called previously, and is only\navailable in non-production builds.

\n", + "itemtype": "method", + "name": "assertDestroyablesDestroyed", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 152, + "description": "

This function instructs the destroyable system to keep track of all destroyables (their\nchildren, destructors, etc). This enables a future usage of assertDestroyablesDestroyed\nto be used to ensure that all destroyable tasks (registered destructors and associated children)\nhave completed when assertDestroyablesDestroyed is called.

\n", + "itemtype": "method", + "name": "enableDestroyableTracking", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 164, + "description": "

Receives a destroyable object and a destructor function, and associates the\nfunction with it. When the destroyable is destroyed with destroy, or when its\nparent is destroyed, the destructor function will be called.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, () => this.resize.unregister(this));\n  }\n}
\n
\n
\n \n

Multiple destructors can be associated with a given destroyable, and they can be\nassociated over time, allowing libraries to dynamically add destructors as needed.\nregisterDestructor also returns the associated destructor function, for convenience.

\n

The destructor function is passed a single argument, which is the destroyable itself.\nThis allows the function to be reused multiple times for many destroyables, rather\nthan creating a closure function per destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nfunction unregisterResize(instance) {\n  instance.resize.unregister(instance);\n}\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, unregisterResize);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "registerDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to register the destructor function with", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to run when the destroyable object is destroyed", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 229, + "description": "

Receives a destroyable and a destructor function, and de-associates the destructor\nfrom the destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor, unregisterDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service modals;\n\n  constructor(...args) {\n    super(...args);\n\n    this.modals.add(this);\n\n    this.modalDestructor = registerDestructor(this, () => this.modals.remove(this));\n  }\n\n  @action pinModal() {\n    unregisterDestructor(this, this.modalDestructor);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "unregisterDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to unregister the destructor function from", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to remove from the destroyable", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/destroyable", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/helper-424284e513.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/helper-424284e513.json new file mode 100644 index 000000000..10180341d --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/helper-424284e513.json @@ -0,0 +1,128 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/helper", + "type": "class", + "attributes": { + "name": "@ember/helper", + "shortname": "@ember/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/helper", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/helper/index.ts", + "line": 5, + "description": "

capabilities returns a capabilities configuration which can be used to modify\nthe behavior of the manager. Manager capabilities must be provided using the\ncapabilities function, as the underlying implementation can change over time.

\n

The first argument to capabilities is a version string, which is the version of\nEmber that the capabilities were defined in. Ember can add new versions at any\ntime, and these may have entirely different behaviors, but it will not remove\nold versions until the next major version.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
capabilities('3.23');
\n
\n
\n \n

The second argument is an object of capabilities and boolean values indicating\nwhether they are enabled or disabled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
capabilities('3.23', {\n  hasValue: true,\n  hasDestructor: true,\n});
\n
\n
\n \n

If no value is specified, then the default value will be used.

\n

3.23 capabilities

\n

hasDestroyable

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a destroyable to include in the destructor\nhierarchy. If enabled, the getDestroyable hook will be called, and its result\nwill be associated with the destroyable parent block.

\n

hasValue

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a value which can be used externally. The helper's\ngetValue hook will be run whenever the value of the helper is accessed if this\ncapability is enabled.

\n", + "itemtype": "method", + "name": "capabilities", + "static": 1, + "params": [ + { + "name": "managerApiVersion", + "description": "The version of capabilities that are being used", + "type": "String" + }, + { + "name": "options", + "description": "The capabilities values" + } + ], + "return": { + "description": "The capabilities object instance", + "type": "Capabilities" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 58, + "description": "

Sets the helper manager for an object or function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
setHelperManager((owner) => new ClassHelperManager(owner), Helper)
\n
\n
\n \n

When a value is used as a helper in a template, the helper manager is looked up\non the object by walking up its prototype chain and finding the first helper\nmanager. This manager then receives the value and can create and manage an\ninstance of a helper from it. This provides a layer of indirection that allows\nusers to design high-level helper APIs, without Ember needing to worry about the\ndetails. High-level APIs can be experimented with and iterated on while the\ncore of Ember helpers remains stable, and new APIs can be introduced gradually\nover time to existing code bases.

\n

setHelperManager receives two arguments:

\n
    \n
  1. A factory function, which receives the owner and returns an instance of a\n helper manager.
  2. \n
  3. A helper definition, which is the object or function to associate the factory function with.
  4. \n
\n

The first time the object is looked up, the factory function will be called to\ncreate the helper manager. It will be cached, and in subsequent lookups the\ncached helper manager will be used instead.

\n

Only one helper manager is guaranteed to exist per owner and per usage of\nsetHelperManager, so many helpers will end up using the same instance of the\nhelper manager. As such, you should only store state that is related to the\nmanager itself. If you want to store state specific to a particular helper\ndefinition, you should assign a unique helper manager to that helper. In\ngeneral, most managers should either be stateless, or only have the owner they\nwere created with as state.

\n

Helper managers must fulfill the following interface (This example uses\nTypeScript interfaces\nfor precision, you do not need to write helper managers using TypeScript):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
interface HelperManager<HelperStateBucket> {\n  capabilities: HelperCapabilities;\n\n  createHelper(definition: HelperDefinition, args: TemplateArgs): HelperStateBucket;\n\n  getValue?(bucket: HelperStateBucket): unknown;\n\n  runEffect?(bucket: HelperStateBucket): void;\n\n  getDestroyable?(bucket: HelperStateBucket): object;\n}
\n
\n
\n \n

The capabilities property must be provided using the capabilities() function\nimported from the same module as setHelperManager:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capabilities } from '@ember/helper';\n\nclass MyHelperManager {\n  capabilities = capabilities('3.21.0', { hasValue: true });\n\n  // ...snip...\n}
\n
\n
\n \n

Below is a description of each of the methods on the interface and their\nfunctions.

\n

createHelper

\n

createHelper is a required hook on the HelperManager interface. The hook is\npassed the definition of the helper that is currently being created, and is\nexpected to return a state bucket. This state bucket is what represents the\ncurrent state of the helper, and will be passed to the other lifecycle hooks at\nappropriate times. It is not necessarily related to the definition of the\nhelper itself - for instance, you could return an object containing an\ninstance of the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
class MyManager {\n  createHelper(Definition, args) {\n    return {\n      instance: new Definition(args);\n    };\n  }\n}
\n
\n
\n \n

This allows the manager to store metadata that it doesn't want to expose to the\nuser.

\n

This hook is not autotracked - changes to tracked values used within this hook\nwill not result in a call to any of the other lifecycle hooks. This is because\nit is unclear what should happen if it invalidates, and rather than make a\ndecision at this point, the initial API is aiming to allow as much expressivity\nas possible. This could change in the future with changes to capabilities and\ntheir behaviors.

\n

If users do want to autotrack some values used during construction, they can\neither create the instance of the helper in runEffect or getValue, or they\ncan use the cache API to autotrack the createHelper hook themselves. This\nprovides maximum flexibility and expressiveness to manager authors.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called as discovered during DOM construction
  • \n
  • called in definition order in the template
  • \n
\n

getValue

\n

getValue is an optional hook that should return the value of the helper. This\nis the value that is returned from the helper and passed into the template.

\n

This hook is called when the value is requested from the helper (e.g. when the\ntemplate is rendering and the helper value is needed). The hook is autotracked,\nand will rerun whenever any tracked values used inside of it are updated.\nOtherwise it does not rerun.

\n
\n

Note: This means that arguments which are not consumed within the hook will\nnot trigger updates.

\n
\n

This hook is only called for helpers with the hasValue capability enabled.\nThis hook has the following timing semantics:

\n

Always

\n
    \n
  • called the first time the helper value is requested
  • \n
  • called after autotracked state has changed
  • \n
\n

Never

\n
    \n
  • called if the hasValue capability is disabled
  • \n
\n

runEffect

\n

runEffect is an optional hook that should run the effect that the helper is\napplying, setting it up or updating it.

\n

This hook is scheduled to be called some time after render and prior to paint.\nThere is not a guaranteed, 1-to-1 relationship between a render pass and this\nhook firing. For instance, multiple render passes could occur, and the hook may\nonly trigger once. It may also never trigger if it was dirtied in one render\npass and then destroyed in the next.

\n

The hook is autotracked, and will rerun whenever any tracked values used inside\nof it are updated. Otherwise it does not rerun.

\n

The hook is also run during a time period where state mutations are disabled\nin Ember. Any tracked state mutation will throw an error during this time,\nincluding changes to tracked properties, changes made using Ember.set, updates\nto computed properties, etc. This is meant to prevent infinite rerenders and\nother antipatterns.

\n

This hook is only called for helpers with the hasScheduledEffect capability\nenabled. This hook is also not called in SSR currently, though this could be\nadded as a capability in the future. It has the following timing semantics:

\n

Always

\n
    \n
  • called after the helper was first created, if the helper has not been\ndestroyed since creation
  • \n
  • called after autotracked state has changed, if the helper has not been\ndestroyed during render
  • \n
\n

Never

\n
    \n
  • called if the hasScheduledEffect capability is disabled
  • \n
  • called in SSR
  • \n
\n

getDestroyable

\n

getDestroyable is an optional hook that users can use to register a\ndestroyable object for the helper. This destroyable will be registered to the\ncontaining block or template parent, and will be destroyed when it is destroyed.\nSee the Destroyables RFC\nfor more details.

\n

getDestroyable is only called if the hasDestroyable capability is enabled.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called immediately after the createHelper hook is called
  • \n
\n

Never

\n
    \n
  • called if the hasDestroyable capability is disabled
  • \n
\n", + "itemtype": "method", + "name": "setHelperManager", + "static": 1, + "params": [ + { + "name": "factory", + "description": "A factory function which receives an optional owner, and returns a helper manager", + "type": "Function" + }, + { + "name": "definition", + "description": "The definition to associate the manager factory with", + "type": "Object" + } + ], + "return": { + "description": "The definition passed into setHelperManager", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 251, + "description": "

The invokeHelper function can be used to create a helper instance in\nJavaScript.

\n

To access a helper's value you have to use getValue from\n@glimmer/tracking/primitives/cache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
// app/components/data-loader.js\nimport Component from '@glimmer/component';\nimport { getValue } from '@glimmer/tracking/primitives/cache';\nimport Helper from '@ember/component/helper';\nimport { invokeHelper } from '@ember/helper';\n\nclass PlusOne extends Helper {\n  compute([number]) {\n    return number + 1;\n  }\n}\n\nexport default class PlusOneComponent extends Component {\n  plusOne = invokeHelper(this, PlusOne, () => {\n    return {\n      positional: [this.args.number],\n    };\n  });\n\n  get value() {\n    return getValue(this.plusOne);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{this.value}}
\n
\n
\n \n

It receives three arguments:

\n
    \n
  • context: The parent context of the helper. When the parent is torn down and\nremoved, the helper will be as well.
  • \n
  • definition: The definition of the helper.
  • \n
  • computeArgs: An optional function that produces the arguments to the helper.\nThe function receives the parent context as an argument, and must return an\nobject with a positional property that is an array and/or a named\nproperty that is an object.
  • \n
\n

And it returns a Cache instance that contains the most recent value of the\nhelper. You can access the helper using getValue() like any other cache. The\ncache is also destroyable, and using the destroy() function on it will cause\nthe helper to be torn down.

\n

Note that using getValue() on helpers that have scheduled effects will not\ntrigger the effect early. Effects will continue to run at their scheduled time.

\n", + "itemtype": "method", + "name": "invokeHelper", + "static": 1, + "params": [ + { + "name": "context", + "description": "The parent context of the helper", + "type": "Object" + }, + { + "name": "definition", + "description": "The helper definition", + "type": "Object" + }, + { + "name": "computeArgs", + "description": "An optional function that produces args", + "type": "Function" + } + ], + "return": { + "description": "" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/helper", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/object-660a33255d.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/object-660a33255d.json new file mode 100644 index 000000000..27f75950b --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/object-660a33255d.json @@ -0,0 +1,521 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/object", + "type": "class", + "attributes": { + "name": "@ember/object", + "shortname": "@ember/object", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 727, + "description": "

This helper returns a new property descriptor that wraps the passed\ncomputed property function. You can use this helper to define properties with\nnative decorator syntax, mixins, or via defineProperty().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', function() {\n    return `${this.get('firstName')} ${this.get('lastName')}`;\n  })\n});\n\nlet client = Person.create();\n\nclient.get('fullName'); // 'Betty Jones'\n\nclient.set('lastName', 'Fuller');\nclient.get('fullName'); // 'Betty Fuller'
\n
\n
\n \n

You can also provide a setter, either directly on the class using native class\nsyntax, or by passing a hash with get and set functions.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(/\\s+/);\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n\n    return value;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', {\n    get(key) {\n      return `${this.get('firstName')} ${this.get('lastName')}`;\n    },\n    set(key, value) {\n      let [firstName, lastName] = value.split(/\\s+/);\n      this.setProperties({ firstName, lastName });\n      return value;\n    }\n  })\n});\n\nlet client = Person.create();\nclient.get('firstName'); // 'Betty'\n\nclient.set('fullName', 'Carroll Fuller');\nclient.get('firstName'); // 'Carroll'
\n
\n
\n \n

When passed as an argument, the set function should accept two parameters,\nkey and value. The value returned from set will be the new value of the\nproperty.

\n

Note: This is the preferred way to define computed properties when writing third-party\nlibraries that depend on or use Ember, since there is no guarantee that the user\nwill have prototype Extensions enabled.

\n", + "itemtype": "method", + "name": "computed", + "static": 1, + "params": [ + { + "name": "dependentKeys*", + "description": "Optional dependent keys that trigger this computed property.", + "type": "String", + "optional": true + }, + { + "name": "func", + "description": "The computed property function.", + "type": "Function" + } + ], + "return": { + "description": "property decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/get_properties.ts", + "line": 6, + "description": "

To get multiple properties at once, call getProperties\nwith an object followed by a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, 'firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, ['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + }, + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 773, + "description": "

Specify a method that observes property changes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nimport { observer } from '@ember/object';\n\nexport default EmberObject.extend({\n  valueObserver: observer('value', function() {\n    // Executes whenever the "value" property changes\n  })\n});
\n
\n
\n \n

Also available as Function.prototype.observes if prototype extensions are\nenabled.

\n", + "itemtype": "method", + "name": "observer", + "params": [ + { + "name": "propertyNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "func" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/properties.ts", + "line": 11, + "description": "

NOTE: This is a low-level method used by other parts of the API. You almost\nnever want to call this method directly. Instead you should use\nmixin() to define new properties.

\n

Defines a property on an object. This method works much like the ES5\nObject.defineProperty() method except that it can also accept computed\nproperties and other special descriptors.

\n

Normally this method takes only three parameters. However if you pass an\ninstance of Descriptor as the third param then you can pass an\noptional value as the fourth parameter. This is often more efficient than\ncreating new descriptor hashes for each property.

\n

Examples

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { defineProperty, computed } from '@ember/object';\n\n// ES5 compatible mode\ndefineProperty(contact, 'firstName', {\n  writable: true,\n  configurable: false,\n  enumerable: true,\n  value: 'Charles'\n});\n\n// define a simple property\ndefineProperty(contact, 'lastName', undefined, 'Jolley');\n\n// define a computed property\ndefineProperty(contact, 'fullName', computed('firstName', 'lastName', function() {\n  return this.firstName+' '+this.lastName;\n}));
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "defineProperty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "the object to define this property on. This may be a prototype.", + "type": "Object" + }, + { + "name": "keyName", + "description": "the name of the property", + "type": "String" + }, + { + "name": "desc", + "description": "an instance of `Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.", + "type": "Descriptor", + "optional": true + }, + { + "name": "data", + "description": "something other than a descriptor, that will\n become the explicit value of this property.", + "type": "*", + "optional": true + } + ], + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 31, + "description": "

This function is called just after an object property has changed.\nIt will notify any observers and clear caches among other things.

\n

Normally you will not need to call this method directly but if for some\nreason you can't directly watch a property you can invoke this method\nmanually.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "obj", + "description": "The object with the property that will change", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key (or path) that will change.", + "type": "String" + }, + { + "name": "_meta", + "description": "The objects meta.", + "type": "Meta", + "optional": true + }, + { + "name": "value", + "description": "The new value to set for the property", + "type": "Unknown", + "optional": true + } + ], + "return": { + "description": "", + "type": "Void" + }, + "since": "3.1.0", + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 82, + "itemtype": "method", + "name": "beginPropertyChanges", + "chainable": 1, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 92, + "itemtype": "method", + "name": "endPropertyChanges", + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 104, + "description": "

Make a series of property changes together in an\nexception-safe way.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
Ember.changeProperties(function() {\n  obj1.set('foo', mayBlowUpWhenSet);\n  obj2.set('bar', baz);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "changeProperties", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_get.ts", + "line": 50, + "description": "

Gets the value of a property on an object. If the property is computed,\nthe function will be invoked. If the property is not defined but the\nobject implements the unknownProperty method then that will be invoked.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { get } from '@ember/object';\nget(obj, "name");
\n
\n
\n \n

If you plan to run on IE8 and older browsers then you should use this\nmethod anytime you want to retrieve a property on an object that you don't\nknow for sure is private. (Properties beginning with an underscore '_'\nare considered private.)

\n

On all newer browsers, you only need to use this method to retrieve\nproperties if the property might not be defined on the object and you want\nto respect the unknownProperty handler. Otherwise you can ignore this\nmethod.

\n

Note that if the object itself is undefined, this method will throw\nan error.

\n", + "itemtype": "method", + "name": "get", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to retrieve from.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to retrieve", + "type": "String" + } + ], + "return": { + "description": "the property value or `null`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 18, + "description": "

Sets the value of a property on an object, respecting computed properties\nand notifying observers and other listeners of the change.\nIf the specified property is not defined on the object and the object\nimplements the setUnknownProperty method, then instead of setting the\nvalue of the property on the object, its setUnknownProperty handler\nwill be invoked with the two parameters keyName and value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { set } from '@ember/object';\nset(obj, "name", value);
\n
\n
\n \n", + "itemtype": "method", + "name": "set", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "return": { + "description": "the passed value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 124, + "description": "

Error-tolerant form of set. Will not blow up if any part of the\nchain is undefined, null, or destroyed.

\n

This is primarily used when syncing bindings, which may try to update after\nan object has been destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { trySet } from '@ember/object';\n\nlet obj = { name: "Zoey" };\ntrySet(obj, "contacts.twitter", "@emberjs");
\n
\n
\n \n", + "itemtype": "method", + "name": "trySet", + "static": 1, + "params": [ + { + "name": "root", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "path", + "description": "The property path to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/set_properties.ts", + "line": 6, + "description": "

Set a list of properties on an object. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nlet anObject = EmberObject.create();\n\nanObject.setProperties({\n  firstName: 'Stanley',\n  lastName: 'Stuart',\n  age: 21\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "properties", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "properties" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 619, + "description": "

Creates a new subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(thing);\n   }\n});
\n
\n
\n \n

This defines a new subclass of EmberObject: Person. It contains one method: say().

\n

You can also create a subclass from any existing class by calling its extend() method.\nFor example, you might want to create a subclass of Ember's built-in Component class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nconst PersonComponent = Component.extend({\n  tagName: 'li',\n  classNameBindings: ['isAdministrator']\n});
\n
\n
\n \n

When defining a subclass, you can override methods but still access the\nimplementation of your parent class by calling the special _super() method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    let name = this.get('name');\n    alert(`${name} says: ${thing}`);\n  }\n});\n\nconst Soldier = Person.extend({\n  say(thing) {\n    this._super(`${thing}, sir!`);\n  },\n  march(numberOfHours) {\n    alert(`${this.get('name')} marches for ${numberOfHours} hours.`);\n  }\n});\n\nlet yehuda = Soldier.create({\n  name: 'Yehuda Katz'\n});\n\nyehuda.say('Yes');  // alerts "Yehuda Katz says: Yes, sir!"
\n
\n
\n \n

The create() on line #17 creates an instance of the Soldier class.\nThe extend() on line #8 creates a subclass of Person. Any instance\nof the Person class will not have the march() method.

\n

You can also pass Mixin classes to add additional properties to the subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import EmberObject from '@ember/object';\nimport Mixin from '@ember/object/mixin';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(`${this.get('name')} says: ${thing}`);\n  }\n});\n\nconst SingingMixin = Mixin.create({\n  sing(thing) {\n    alert(`${this.get('name')} sings: la la la ${thing}`);\n  }\n});\n\nconst BroadwayStar = Person.extend(SingingMixin, {\n  dance() {\n    alert(`${this.get('name')} dances: tap tap tap tap `);\n  }\n});
\n
\n
\n \n

The BroadwayStar class contains three methods: say(), sing(), and dance().

\n", + "itemtype": "method", + "name": "extend", + "static": 1, + "params": [ + { + "name": "mixins", + "description": "One or more Mixin classes", + "type": "Mixin", + "optional": true, + "multiple": true + }, + { + "name": "arguments", + "description": "Object containing values to use within the new class", + "type": "Object", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 723, + "description": "

Creates an instance of a class. Accepts either no arguments, or an object\ncontaining values to initialize the newly instantiated object with.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  helloWorld() {\n    alert(`Hi, my name is ${this.get('name')}`);\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\n\ntom.helloWorld(); // alerts "Hi, my name is Tom Dale".
\n
\n
\n \n

create will call the init function if defined during\nAnyObject.extend

\n

If no arguments are passed to create, it will not set values to the new\ninstance during initialization:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let noName = Person.create();\nnoName.helloWorld(); // alerts undefined
\n
\n
\n \n

NOTE: For performance reasons, you cannot declare methods or computed\nproperties during create. You should instead declare methods and computed\nproperties when using extend.

\n", + "itemtype": "method", + "name": "create", + "static": 1, + "params": [ + { + "name": "arguments", + "description": "", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 788, + "description": "

Augments a constructor's prototype with additional\nproperties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\no = MyObject.create();\no.get('name'); // 'an object'\n\nMyObject.reopen({\n  say(msg) {\n    console.log(msg);\n  }\n});\n\no2 = MyObject.create();\no2.say('hello'); // logs "hello"\n\no.say('goodbye'); // logs "goodbye"
\n
\n
\n \n

To add functions and properties to the constructor itself,\nsee reopenClass

\n", + "itemtype": "method", + "name": "reopen", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 842, + "description": "

Augments a constructor's own properties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\nMyObject.reopenClass({\n  canBuild: false\n});\n\nMyObject.canBuild; // false\no = MyObject.create();
\n
\n
\n \n

In other words, this creates static properties and functions for the class.\nThese are only available on the class and not on any instance of that class.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  name: '',\n  sayHello() {\n    alert(`Hello. My name is ${this.get('name')}`);\n  }\n});\n\nPerson.reopenClass({\n  species: 'Homo sapiens',\n\n  createPerson(name) {\n    return Person.create({ name });\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\nlet yehuda = Person.createPerson('Yehuda Katz');\n\ntom.sayHello(); // "Hello. My name is Tom Dale"\nyehuda.sayHello(); // "Hello. My name is Yehuda Katz"\nalert(Person.species); // "Homo sapiens"
\n
\n
\n \n

Note that species and createPerson are not valid on the tom and yehuda\nvariables. They are only valid on Person.

\n

To add functions and properties to instances of\na constructor by extending the constructor's prototype\nsee reopen

\n", + "itemtype": "method", + "name": "reopenClass", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 925, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For\nexample, computed property functions may close over variables that are then\nno longer available for introspection.

\n

You can pass a hash of these values to a computed property like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { computed } from '@ember/object';\n\nperson: computed(function() {\n  let personId = this.get('personId');\n  return Person.create({ id: personId });\n}).meta({ type: Person })
\n
\n
\n \n

Once you've done this, you can retrieve the values saved to the computed\nproperty from your class like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyClass.metaForProperty('person');
\n
\n
\n \n

This will return the original hash that was passed to meta().

\n", + "static": 1, + "itemtype": "method", + "name": "metaForProperty", + "params": [ + { + "name": "key", + "description": "property name", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 968, + "description": "

Iterate over each computed property for the class, passing its name\nand any associated metadata (see metaForProperty) to the callback.

\n", + "static": 1, + "itemtype": "method", + "name": "eachComputedProperty", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "binding", + "description": "", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 1060, + "description": "

Provides lookup-time type validation for injected properties.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_onLookup", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 1081, + "description": "

Returns a hash of property names and container names that injected\nproperties will lookup on the container lazily.

\n", + "itemtype": "method", + "name": "_lazyInjections", + "return": { + "description": "Hash of all lazy injected property keys to container names", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/index.js", + "line": 18, + "description": "

Decorator that turns the target function into an Action which can be accessed\ndirectly by reference.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action this.toggleShowing}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

Decorated actions also interop with the string style template actions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action "toggleShowing"}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

It also binds the function directly to the instance, so it can be used in any\ncontext and will correctly refer to the class it came from:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert this.toggleShowing}}\n  {{on "click" this.toggleShowing}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

This can also be used in JavaScript code directly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  constructor() {\n    super(...arguments);\n\n    // this.toggleShowing is still bound correctly when added to\n    // the event listener\n    document.addEventListener('click', this.toggleShowing);\n  }\n\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n

This is considered best practice, since it means that methods will be bound\ncorrectly no matter where they are used. By contrast, the {{action}} helper\nand modifier can also be used to bind context, but it will be required for\nevery usage of the method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert (action this.toggleShowing)}}\n  {{on "click" (action this.toggleShowing)}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

They also do not have equivalents in JavaScript directly, so they cannot be\nused for other situations where binding would be useful.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "action", + "static": 1, + "params": [ + { + "name": "callback", + "description": "The function to turn into an action,\n when used in classic classes", + "type": "Function|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/object/compat-194b097dac.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/object/compat-194b097dac.json new file mode 100644 index 000000000..a7ce208c1 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/object/compat-194b097dac.json @@ -0,0 +1,64 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/object/compat", + "type": "class", + "attributes": { + "name": "@ember/object/compat", + "shortname": "@ember/object/compat", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/object/compat.ts", + "line": 40, + "description": "

@dependentKeyCompat is decorator that can be used on native getters that\nuse tracked properties. It exposes the getter to Ember's classic computed\nproperty and observer systems, so they can watch it for changes. It can be\nused in both native and classic classes.

\n

Native Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { computed, set } from '@ember/object';\n\nclass Person {\n  @tracked firstName;\n  @tracked lastName;\n\n  @dependentKeyCompat\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nclass Profile {\n  constructor(person) {\n    set(this, 'person', person);\n  }\n\n  @computed('person.fullName')\n  get helloMessage() {\n    return `Hello, ${this.person.fullName}!`;\n  }\n}
\n
\n
\n \n

Classic Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport EmberObject, { computed, observer, set } from '@ember/object';\n\nconst Person = EmberObject.extend({\n  firstName: tracked(),\n  lastName: tracked(),\n\n  fullName: dependentKeyCompat(function() {\n    return `${this.firstName} ${this.lastName}`;\n  }),\n});\n\nconst Profile = EmberObject.extend({\n  person: null,\n\n  helloMessage: computed('person.fullName', function() {\n    return `Hello, ${this.person.fullName}!`;\n  }),\n\n  onNameUpdated: observer('person.fullName', function() {\n    console.log('person name updated!');\n  }),\n});
\n
\n
\n \n

dependentKeyCompat() can receive a getter function or an object containing\nget/set methods when used in classic classes, like computed properties.

\n

In general, only properties which you expect to be watched by older,\nuntracked clases should be marked as dependency compatible. The decorator is\nmeant as an interop layer for parts of Ember's older classic APIs, and should\nnot be applied to every possible getter/setter in classes. The number of\ndependency compatible getters should be minimized wherever possible. New\napplication code should not need to use @dependentKeyCompat, since it is\nonly for interoperation with older code.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "dependentKeyCompat", + "static": 1, + "params": [ + { + "name": "desc", + "description": "A property descriptor containing\n the getter and setter (when used in\n classic classes)", + "type": "PropertyDescriptor|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object/compat", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/object/computed-18b4d64401.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/object/computed-18b4d64401.json new file mode 100644 index 000000000..d214c71c0 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/object/computed-18b4d64401.json @@ -0,0 +1,903 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/object/computed", + "type": "class", + "attributes": { + "name": "@ember/object/computed", + "shortname": "@ember/object/computed", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/expand_properties.ts", + "line": 9, + "description": "

Expands pattern, invoking callback for each expansion.

\n

The only pattern supported is brace-expansion, anything else will be passed\nonce to callback directly.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { expandProperties } from '@ember/object/computed';\n\nfunction echo(arg){ console.log(arg); }\n\nexpandProperties('foo.bar', echo);              //=> 'foo.bar'\nexpandProperties('{foo,bar}', echo);            //=> 'foo', 'bar'\nexpandProperties('foo.{bar,baz}', echo);        //=> 'foo.bar', 'foo.baz'\nexpandProperties('{foo,bar}.baz', echo);        //=> 'foo.baz', 'bar.baz'\nexpandProperties('foo.{bar,baz}.[]', echo)      //=> 'foo.bar.[]', 'foo.baz.[]'\nexpandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs'\nexpandProperties('{foo}.bar.{baz}')             //=> 'foo.bar.baz'
\n
\n
\n \n", + "itemtype": "method", + "name": "expandProperties", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "pattern", + "description": "The property pattern to expand.", + "type": "String" + }, + { + "name": "callback", + "description": "The callback to invoke. It is invoked once per\nexpansion, and is passed the expansion.", + "type": "Function" + } + ], + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 63, + "description": "

A computed property macro that returns true if the value of the dependent\nproperty is null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { empty } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  @empty('todos') isDone;\n}\n\nlet todoList = new ToDoList(\n  ['Unit Test', 'Documentation', 'Release']\n);\n\ntodoList.isDone; // false\nset(todoList, 'todos', []);\ntodoList.isDone; // true
\n
\n
\n \n", + "since": "1.6.0", + "itemtype": "method", + "name": "empty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if the value\nof the dependent property is null, an empty string, empty array, or empty\nfunction and false if the underlying value is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 112, + "description": "

A computed property that returns true if the value of the dependent property\nis NOT null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { notEmpty } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(backpack) {\n    set(this, 'backpack', backpack);\n  }\n\n  @notEmpty('backpack') hasStuff\n}\n\nlet hamster = new Hamster(\n  ['Food', 'Sleeping Bag', 'Tent']\n);\n\nhamster.hasStuff; // true\nset(hamster, 'backpack', []);\nhamster.hasStuff; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "notEmpty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 158, + "description": "

A computed property that returns true if the value of the dependent property\nis null or undefined. This avoids errors from JSLint complaining about use of\n==, which can be technically confusing.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { none } from '@ember/object/computed';\n\nclass Hamster {\n  @none('food') isHungry;\n}\n\nlet hamster = new Hamster();\n\nhamster.isHungry; // true\n\nset(hamster, 'food', 'Banana');\nhamster.isHungry; // false\n\nset(hamster, 'food', null);\nhamster.isHungry; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "none", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is null or undefined.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 201, + "description": "

A computed property that returns the inverse boolean value of the original\nvalue for the dependent property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { not } from '@ember/object/computed';\n\nclass User {\n  loggedIn = false;\n\n  @not('loggedIn') isAnonymous;\n}\n\nlet user = new User();\n\nuser.isAnonymous; // true\nset(user, 'loggedIn', true);\nuser.isAnonymous; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "not", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns inverse of the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 243, + "description": "

A computed property that converts the provided dependent property into a\nboolean value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { bool } from '@ember/object/computed';\n\n\nclass Hamster {\n  @bool('numBananas') hasBananas\n}\n\nlet hamster = new Hamster();\n\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 0);\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 1);\nhamster.hasBananas; // true\n\nset(hamster, 'numBananas', null);\nhamster.hasBananas; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "bool", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which converts to boolean the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 291, + "description": "

A computed property which matches the original value for the dependent\nproperty against a given RegExp, returning true if the value matches the\nRegExp and false if it does not.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { match } from '@ember/object/computed';\n\nclass User {\n  @match('email', /^.+@.+\\..+$/) hasValidEmail;\n}\n\nlet user = new User();\n\nuser.hasValidEmail; // false\n\nset(user, 'email', '');\nuser.hasValidEmail; // false\n\nset(user, 'email', 'ember_hamster@example.com');\nuser.hasValidEmail; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "match", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "regexp", + "description": "", + "type": "RegExp" + } + ], + "return": { + "description": "computed property which match the original value\nfor property against a given RegExp", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 338, + "description": "

A computed property that returns true if the provided dependent property is\nequal to the given value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { equal } from '@ember/object/computed';\n\nclass Hamster {\n  @equal('percentCarrotsEaten', 100) satisfied;\n}\n\nlet hamster = new Hamster();\n\nhamster.satisfied; // false\n\nset(hamster, 'percentCarrotsEaten', 100);\nhamster.satisfied; // true\n\nset(hamster, 'percentCarrotsEaten', 50);\nhamster.satisfied; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "equal", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "String|Number|Object" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is equal to the given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 383, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gt } from '@ember/object/computed';\n\nclass Hamster {\n  @gt('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 11);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 428, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gte } from '@ember/object/computed';\n\nclass Hamster {\n  @gte('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 10);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater or equal then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 473, + "description": "

A computed property that returns true if the provided dependent property is\nless than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lt } from '@ember/object/computed';\n\nclass Hamster {\n  @lt('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 2);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 518, + "description": "

A computed property that returns true if the provided dependent property is\nless than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lte } from '@ember/object/computed';\n\nclass Hamster {\n  @lte('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 5);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less or equal than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 563, + "description": "

A computed property that performs a logical and on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first falsy value or last\ntruthy value just like JavaScript's && operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { and } from '@ember/object/computed';\n\nclass Hamster {\n  @and('hasTent', 'hasBackpack') readyForCamp;\n  @and('hasWalkingStick', 'hasBackpack') readyForHike;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForCamp; // false\n\nset(tomster, 'hasTent', true);\ntomster.readyForCamp; // false\n\nset(tomster, 'hasBackpack', true);\ntomster.readyForCamp; // true\n\nset(tomster, 'hasBackpack', 'Yes');\ntomster.readyForCamp; // 'Yes'\n\nset(tomster, 'hasWalkingStick', null);\ntomster.readyForHike; // null
\n
\n
\n \n", + "itemtype": "method", + "name": "and", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `and` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 609, + "description": "

A computed property which performs a logical or on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first truthy value or last\nfalsy value just like JavaScript's || operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { or } from '@ember/object/computed';\n\nclass Hamster {\n  @or('hasJacket', 'hasUmbrella') readyForRain;\n  @or('hasSunscreen', 'hasUmbrella') readyForBeach;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForRain; // undefined\n\nset(tomster, 'hasUmbrella', true);\ntomster.readyForRain; // true\n\nset(tomster, 'hasJacket', 'Yes');\ntomster.readyForRain; // 'Yes'\n\nset(tomster, 'hasSunscreen', 'Check');\ntomster.readyForBeach; // 'Check'
\n
\n
\n \n", + "itemtype": "method", + "name": "or", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `or` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 652, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { alias } from '@ember/object/computed';\n\nclass Person {\n  name = 'Alex Matchneer';\n\n  @alias('name') nomen;\n}\n\nlet alex = new Person();\n\nalex.nomen; // 'Alex Matchneer'\nalex.name;  // 'Alex Matchneer'\n\nset(alex, 'nomen', '@machty');\nalex.name;  // '@machty'
\n
\n
\n \n", + "itemtype": "method", + "name": "alias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates an alias to the\noriginal value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 687, + "description": "

Where the alias computed macro aliases get and set, and allows for\nbidirectional data flow, the oneWay computed macro only provides an aliased\nget. The set will not mutate the upstream property, rather causes the\ncurrent property to become the value set. This causes the downstream property\nto permanently diverge from the upstream property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { oneWay }from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @oneWay('firstName') nickName;\n}\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear');\nteddy.firstName; // 'Teddy'\nteddy.nickName; // 'TeddyBear'
\n
\n
\n \n", + "itemtype": "method", + "name": "oneWay", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 735, + "description": "

This is a more semantically meaningful alias of the oneWay computed macro,\nwhose name is somewhat ambiguous as to which direction the data flows.

\n", + "itemtype": "method", + "name": "reads", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\n property to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 748, + "description": "

Where oneWay computed macro provides oneWay bindings, the readOnly\ncomputed macro provides a readOnly one way binding. Very often when using\nthe oneWay macro one does not also want changes to propagate back up, as\nthey will replace the value.

\n

This prevents the reverse flow, and also throws an exception when it occurs.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { readOnly } from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @readOnly('firstName') nickName;\n});\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear'); // throws Exception\n// throw new EmberError('Cannot Set: nickName on: <User:ember27288>' );`\n\nteddy.firstName; // 'Teddy'
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.js", + "line": 799, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property, but also print a deprecation warning.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { set } from '@ember/object';\nimport { deprecatingAlias } from '@ember/object/computed';\n\nclass Hamster {\n  @deprecatingAlias('cavendishCount', {\n    id: 'hamster.deprecate-banana',\n    until: '3.0.0'\n  })\n  bananaCount;\n}\n\nlet hamster = new Hamster();\n\nset(hamster, 'bananaCount', 5); // Prints a deprecation warning.\nhamster.cavendishCount; // 5
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecatingAlias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "Options for `deprecate`.", + "type": "Object" + } + ], + "return": { + "description": "computed property which creates an alias with a\ndeprecation to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 56, + "description": "

A computed property that returns the sum of the values in the dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { sum } from '@ember/object/computed';\n\nclass Invoice {\n  lineItems = [1.00, 2.50, 9.99];\n\n  @sum('lineItems') total;\n}\n\nlet invoice = new Invoice();\n\ninvoice.total; // 13.49
\n
\n
\n \n", + "itemtype": "method", + "name": "sum", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the sum of all values in the\ndependentKey's array", + "type": "ComputedProperty" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 93, + "description": "

A computed property that calculates the maximum value in the dependent array.\nThis will return -Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, max } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @max('childAges') maxChildAge;\n}\n\nlet lordByron = new Person();\n\nlordByron.maxChildAge; // -Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.maxChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.maxChildAge; // 8
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe max of a list of Date objects will be the highest timestamp as a Number.\nThis behavior is consistent with Math.max.

\n", + "itemtype": "method", + "name": "max", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the largest value in the dependentKey's\narray", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 157, + "description": "

A computed property that calculates the minimum value in the dependent array.\nThis will return Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, min } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @min('childAges') minChildAge;\n}\n\nlet lordByron = Person.create({ children: [] });\n\nlordByron.minChildAge; // Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.minChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.minChildAge; // 5
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe min of a list of Date objects will be the lowest timestamp as a Number.\nThis behavior is consistent with Math.min.

\n", + "itemtype": "method", + "name": "min", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the smallest value in the dependentKey's array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 220, + "description": "

Returns an array mapped via the callback

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function mapCallback(item, index);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', function(chore, index) {\n    return `${chore.toUpperCase()}!`;\n  })\n  excitingChores;\n});\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n

You can optionally pass an array of additional dependent keys as the second\nparameter to the macro, if your map function relies on any external values:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  shouldUpperCase = false;\n\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', ['shouldUpperCase'], function(chore, index) {\n    if (this.shouldUpperCase) {\n      return `${chore.toUpperCase()}!`;\n    } else {\n      return `${chore}!`;\n    }\n  })\n  excitingChores;\n}\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['clean!', 'write more unit tests!']\n\nset(hamster, 'shouldUpperCase', true);\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional\ndependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "an array mapped via the callback", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 321, + "description": "

Returns an array mapped to the specified key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import { set } from '@ember/object';\nimport { mapBy } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n}\n\nlet lordByron = new Person();\n\nlordByron.childAges; // []\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.childAges; // [7]\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.childAges; // [7, 5, 8]
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "an array mapped to the specified key", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 388, + "description": "

Filters the array by the callback.

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
  • array is the dependant array itself.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function filterCallback(item, index, array);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = Hamster.create([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]
\n
\n
\n \n

You can also use @each.property in your dependent key, the callback will\nstill use the underlying array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores.@each.done', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n\nset(hamster.chores[2], 'done', true);\nhamster.remainingChores; // []
\n
\n
\n \n

Finally, you can optionally pass an array of additional dependent keys as the\nsecond parameter to the macro, if your filter function relies on any external\nvalues:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  doneKey = 'finished';\n\n  @filter('chores', ['doneKey'], function(chore, index, array) {\n    return !chore[this.doneKey];\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', finished: true },\n  { name: 'clean', finished: true },\n  { name: 'write more unit tests', finished: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', finished: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional dependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 519, + "description": "

Filters the array by the property and value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { filterBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filterBy('chores', 'done', false) remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{ name: 'write more unit tests', done: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "*" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 575, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniq } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniq('fruits') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  'banana',\n  'grape',\n  'kale',\n  'banana'\n]);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale']
\n
\n
\n \n", + "itemtype": "method", + "name": "uniq", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 641, + "description": "

A computed property which returns a new array with all the unique elements\nfrom an array, with uniqueness determined by specific key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniqBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniqBy('fruits', 'id') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  { id: 1, 'banana' },\n  { id: 2, 'grape' },\n  { id: 3, 'peach' },\n  { id: 1, 'banana' }\n]);\n\nhamster.uniqueFruits; // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 695, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { union } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits, vegetables) {\n    set(this, 'fruits', fruits);\n    set(this, 'vegetables', vegetables);\n  }\n\n  @union('fruits', 'vegetables') uniqueFruits;\n});\n\nlet hamster = new, Hamster(\n  [\n    'banana',\n    'grape',\n    'kale',\n    'banana',\n    'tomato'\n  ],\n  [\n    'tomato',\n    'carrot',\n    'lettuce'\n  ]\n);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale', 'tomato', 'carrot', 'lettuce']
\n
\n
\n \n", + "itemtype": "method", + "name": "union", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the unique elements\nfrom one or more dependent arrays.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 742, + "description": "

A computed property which returns a new array with all the elements\ntwo or more dependent arrays have in common.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { intersect } from '@ember/object/computed';\n\nclass FriendGroups {\n  constructor(adaFriends, charlesFriends) {\n    set(this, 'adaFriends', adaFriends);\n    set(this, 'charlesFriends', charlesFriends);\n  }\n\n  @intersect('adaFriends', 'charlesFriends') friendsInCommon;\n}\n\nlet groups = new FriendGroups(\n  ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n  ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock']\n);\n\ngroups.friendsInCommon; // ['William King', 'Mary Somerville']
\n
\n
\n \n", + "itemtype": "method", + "name": "intersect", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the duplicated\nelements from the dependent arrays", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 816, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array that are not in the second dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { setDiff } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(likes, fruits) {\n    set(this, 'likes', likes);\n    set(this, 'fruits', fruits);\n  }\n\n  @setDiff('likes', 'fruits') wants;\n}\n\nlet hamster = new Hamster(\n  [\n    'banana',\n    'grape',\n    'kale'\n  ],\n  [\n    'grape',\n    'kale',\n  ]\n);\n\nhamster.wants; // ['banana']
\n
\n
\n \n", + "itemtype": "method", + "name": "setDiff", + "static": 1, + "params": [ + { + "name": "setAProperty", + "description": "", + "type": "String" + }, + { + "name": "setBProperty", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the items from the\nfirst dependent array that are not in the second dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 886, + "description": "

A computed property that returns the array of values for the provided\ndependent properties.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { collect } from '@ember/object/computed';\n\nclass Hamster {\n  @collect('hat', 'shirt') clothes;\n}\n\nlet hamster = new Hamster();\n\nhamster.clothes; // [null, null]\n\nset(hamster, 'hat', 'Camp Hat');\nset(hamster, 'shirt', 'Camp Shirt');\nhamster.clothes; // ['Camp Hat', 'Camp Shirt']
\n
\n
\n \n", + "itemtype": "method", + "name": "collect", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which maps values of all passed\nin properties to an array.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.js", + "line": 937, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array sorted based on a property or sort function. The sort\nmacro can be used in two different ways:

\n
    \n
  1. By providing a sort callback function
  2. \n
  3. By providing an array of keys to sort the array
  4. \n
\n

In the first form, the callback method you provide should have the following\nsignature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function sortCallback(itemA, itemB);
\n
\n
\n \n
    \n
  • itemA the first item to compare.
  • \n
  • itemB the second item to compare.
  • \n
\n

This function should return negative number (e.g. -1) when itemA should\ncome before itemB. It should return positive number (e.g. 1) when itemA\nshould come after itemB. If the itemA and itemB are equal this function\nshould return 0.

\n

Therefore, if this function is comparing some numeric values, simple itemA - itemB or itemA.get( 'foo' ) - itemB.get( 'foo' ) can be used instead of\nseries of if.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', function(a, b){\n    if (a.priority > b.priority) {\n      return 1;\n    } else if (a.priority < b.priority) {\n      return -1;\n    }\n\n    return 0;\n  })\n  priorityTodos;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

You can also optionally pass an array of additional dependent keys as the\nsecond parameter, if your sort function is dependent on additional values that\ncould changes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n
import EmberObject, { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  sortKey = 'priority';\n\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', ['sortKey'], function(a, b){\n    if (a[this.sortKey] > b[this.sortKey]) {\n      return 1;\n    } else if (a[this.sortKey] < b[this.sortKey]) {\n      return -1;\n    }\n\n    return 0;\n  })\n  sortedTodos;\n});\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

In the second form, you should provide the key of the array of sort values as\nthe second parameter:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using standard ascending sort\n  todosSorting = ['name'];\n  @sort('todos', 'todosSorting') sortedTodos;\n\n  // using descending sort\n  todosSortingDesc = ['name:desc'];\n  @sort('todos', 'todosSortingDesc') sortedTodosDesc;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.sortedTodos; // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\ntodoList.sortedTodosDesc; // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n", + "itemtype": "method", + "name": "sort", + "static": 1, + "params": [ + { + "name": "itemsKey", + "description": "", + "type": "String" + }, + { + "name": "sortDefinitionOrDependentKeys", + "description": "The key of the sort definition (an array of sort properties),\nthe sort function, or an array of additional dependent keys", + "type": "String|Function|Array" + }, + { + "name": "sortDefinition", + "description": "the sort function (when used with additional dependent keys)", + "type": "Function?" + } + ], + "return": { + "description": "computes a new sorted array based on the sort\nproperty array or callback function", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/object/evented-1804716455.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/object/evented-1804716455.json new file mode 100644 index 000000000..2a1088d66 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/object/evented-1804716455.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/object/evented", + "type": "class", + "attributes": { + "name": "@ember/object/evented", + "shortname": "@ember/object/evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 179, + "description": "

Define a property as a function that should be executed when\na specified event or events are triggered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\nimport { on } from '@ember/object/evented';\nimport { sendEvent } from '@ember/object/events';\n\nlet Job = EmberObject.extend({\n  logCompleted: on('completed', function() {\n    console.log('Job completed!');\n  })\n});\n\nlet job = Job.create();\n\nsendEvent(job, 'completed'); // Logs 'Job completed!'
\n
\n
\n \n", + "itemtype": "method", + "name": "on", + "static": 1, + "params": [ + { + "name": "eventNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the listener function, passed as last argument to on(...)", + "type": "Function" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/polyfills-c54e016ffd.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/polyfills-c54e016ffd.json new file mode 100644 index 000000000..a9a17d97a --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/polyfills-c54e016ffd.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/polyfills", + "type": "class", + "attributes": { + "name": "@ember/polyfills", + "shortname": "@ember/polyfills", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/polyfills", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/polyfills/lib/assign.ts", + "line": 11, + "description": "

Copy properties from a source object to a target object. Source arguments remain unchanged.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assign } from '@ember/polyfills';\n\nvar a = { first: 'Yehuda' };\nvar b = { last: 'Katz' };\nvar c = { company: 'Other Company' };\nvar d = { company: 'Tilde Inc.' };\nassign(a, b, c, d); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' };
\n
\n
\n \n", + "itemtype": "method", + "name": "assign", + "params": [ + { + "name": "target", + "description": "The object to assign into", + "type": "Object" + }, + { + "name": "args", + "description": "The objects to copy properties from", + "type": "Object", + "multiple": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/polyfills", + "module": "@ember/polyfills" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/polyfills", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/runloop-1c8426a6db.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/runloop-1c8426a6db.json new file mode 100644 index 000000000..6c1541f27 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/runloop-1c8426a6db.json @@ -0,0 +1,497 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/runloop", + "type": "class", + "attributes": { + "name": "@ember/runloop", + "shortname": "@ember/runloop", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/runloop", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 104, + "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

Normally 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { run } from '@ember/runloop';\n\nrun(function() {\n  // code to be executed within a RunLoop\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "run", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "return value from invoking the passed function.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 149, + "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

Please note: This is not for normal usage, and should be used sparingly.

\n

If invoked when not within a run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { join } from '@ember/runloop';\n\njoin(function() {\n  // creates a new run-loop\n});
\n
\n
\n \n

Alternatively, if called within an existing run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "join", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Return value from invoking the passed function. Please note,\nwhen called within an existing loop, no return value is possible.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 208, + "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

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

Let'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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import 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
\n \n

In 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.

\n", + "itemtype": "method", + "name": "bind", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "returns a new function that will always have a particular context", + "type": "Function" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 322, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "begin", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 345, + "description": "

Ends a RunLoop. This must be called sometime after you call\nbegin() to flush any deferred actions. This is a lower-level way\nto use a RunLoop instead of using run().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "end", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 368, + "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

At 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "schedule", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'", + "type": "String" + }, + { + "name": "target", + "description": "target object to use as the context when invoking a method.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.", + "type": "String|Function" + }, + { + "name": "arguments*", + "description": "Optional arguments to be passed to the queued method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 441, + "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

You 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "later", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 489, + "description": "

Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling scheduleOnce with the "actions" queue.

\n", + "itemtype": "method", + "name": "once", + "static": 1, + "params": [ + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 520, + "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

Note that although you can pass optional arguments these will not be\nconsidered when looking for duplicates. New arguments will replace previous\ncalls.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Also note that for scheduleOnce to prevent additional calls, you need to\npass the same function instance. The following case works as expected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
function log() {\n  console.log('Logging only once');\n}\n\nfunction scheduleIt() {\n  scheduleOnce('actions', myContext, log);\n}\n\nscheduleIt();\nscheduleIt();
\n
\n
\n \n

But this other case will schedule the function multiple times:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { 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
\n \n

Available queues, and their order, can be found at queues

\n", + "itemtype": "method", + "name": "scheduleOnce", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'.", + "type": "String", + "optional": true + }, + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 614, + "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\nlater with a wait time of 1ms.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { 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
\n \n

Multiple 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

Note 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

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

One 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

The 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.

\n", + "itemtype": "method", + "name": "next", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 699, + "description": "

Cancels a scheduled item. Must be a value returned by later(),\nonce(), scheduleOnce(), next(), debounce(), or\nthrottle().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n
import {\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
\n
\n \n", + "itemtype": "method", + "name": "cancel", + "static": 1, + "params": [ + { + "name": "timer", + "description": "Timer object to cancel", + "type": "Object" + } + ], + "return": { + "description": "true if canceled or false/undefined if it wasn't found", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 770, + "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

This 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n \n

Immediate allows you to run the function immediately, but debounce\nother calls for this function until the wait time has elapsed. If\ndebounce 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "debounce", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to false.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 867, + "description": "

Ensure that the target method is never called more frequently than\nthe specified spacing period. The target method is called immediately.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "throttle", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "spacing", + "description": "Number of milliseconds to space out requests.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to true.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 61, + "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.

\n", + "itemtype": "property", + "name": "queues", + "type": "Array", + "default": "['actions', 'destroy']", + "access": "private", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/renderer" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/runloop", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/service-6ed4d344ea.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/service-6ed4d344ea.json new file mode 100644 index 000000000..0b875a983 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/service-6ed4d344ea.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/service", + "type": "class", + "attributes": { + "name": "@ember/service", + "shortname": "@ember/service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/service/index.ts", + "line": 13, + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + }, + { + "file": "packages/@ember/service/index.ts", + "line": 33, + "description": "

Creates a property that lazily looks up a service in the container. There are\nno restrictions as to what objects a service can be injected into.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service('auth') authManager;\n\n  model() {\n    return this.authManager.findCurrentUser();\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default Route.extend({\n  authManager: service('auth'),\n\n  model() {\n    return this.get('authManager').findCurrentUser();\n  }\n});
\n
\n
\n \n

This example will create an authManager property on the application route\nthat looks up the auth service in the container, making it easily accessible\nin the model hook.

\n", + "itemtype": "method", + "name": "service", + "static": 1, + "since": "4.1.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/template-780ce187d6.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/template-780ce187d6.json new file mode 100644 index 000000000..377bc81d9 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/template-780ce187d6.json @@ -0,0 +1,100 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/template", + "type": "class", + "attributes": { + "name": "@ember/template", + "shortname": "@ember/template", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/template", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/utils/managers.ts", + "line": 9, + "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).

\n", + "itemtype": "method", + "name": "setComponentManager", + "params": [ + { + "name": "factory", + "description": "a function to create the owner for an object", + "type": "Function" + }, + { + "name": "obj", + "description": "the object to associate with the componetn manager", + "type": "Object" + } + ], + "return": { + "description": "the same object passed in", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 61, + "description": "

Use this method to indicate that a string should be rendered as HTML\nwhen the string is used in a template. To say this another way,\nstrings marked with htmlSafe will not be HTML escaped.

\n

A word of warning - The htmlSafe method does not make the string safe;\nit only tells the framework to treat the string as if it is safe to render\nas HTML. If a string contains user inputs or other untrusted\ndata, you must sanitize the string before using the htmlSafe method.\nOtherwise your code is vulnerable to\nCross-Site Scripting.\nThere are many open source sanitization libraries to choose from,\nboth for front end and server-side sanitization.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { htmlSafe } from '@ember/template';\n\nconst someTrustedOrSanitizedString = "<div>Hello!</div>"\n\nhtmlSafe(someTrustedorSanitizedString)
\n
\n
\n \n", + "itemtype": "method", + "name": "htmlSafe", + "static": 1, + "return": { + "description": "A string that will not be HTML escaped by Handlebars.", + "type": "SafeString" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 98, + "description": "

Detects if a string was decorated using htmlSafe.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { htmlSafe, isHTMLSafe } from '@ember/template';\n\nvar plainString = 'plain string',\n    safeString = htmlSafe('<div>someValue</div>');\n\nisHTMLSafe(plainString); // false\nisHTMLSafe(safeString);  // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isHTMLSafe", + "static": 1, + "return": { + "description": "`true` if the string was decorated with `htmlSafe`, `false` otherwise.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/template", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/test-b2d4b7c12e.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/test-b2d4b7c12e.json new file mode 100644 index 000000000..c456cbf48 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/test-b2d4b7c12e.json @@ -0,0 +1,395 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/test", + "type": "class", + "attributes": { + "name": "@ember/test", + "shortname": "@ember/test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/test", + "namespace": "", + "methods": [ + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 51, + "description": "

This hook defers the readiness of the application, so that you can start\nthe app when your tests are ready to run. It also sets the router's\nlocation to 'none', so that the window's location will not be modified\n(preventing both accidental leaking of state between tests and interference\nwith your testing framework). setupForTesting should only be called after\nsetting a custom router class (for example App.Router = Router.extend().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.setupForTesting();
\n
\n
\n \n", + "itemtype": "method", + "name": "setupForTesting", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 90, + "description": "

This injects the test helpers into the helperContainer object. If an object is provided\nit will be used as the helperContainer. If helperContainer is not set it will default\nto window. If a function of the same name has already been defined it will be cached\n(so that it can be reset if the helper is removed with unregisterHelper or\nremoveTestHelpers).

\n

Any callbacks registered with onInjectHelpers will be called once the\nhelpers have been injected.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.injectTestHelpers();
\n
\n
\n \n", + "itemtype": "method", + "name": "injectTestHelpers", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 132, + "description": "

This removes all helpers that have been registered, and resets and functions\nthat were overridden by the helpers.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.removeTestHelpers();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "removeTestHelpers", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/helpers/current_path.js", + "line": 6, + "description": "

Returns the current path.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentPath(), 'some.path.index', "correct path was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentPath", + "return": { + "description": "The currently active path.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_route_name.js", + "line": 5, + "description": "

Returns the currently active route name.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
function validateRouteName() {\nequal(currentRouteName(), 'some.path', "correct route was transitioned into.");\n}\nvisit('/some/path').then(validateRouteName)
\n
\n
\n \n", + "itemtype": "method", + "name": "currentRouteName", + "return": { + "description": "The name of the currently active route.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_url.js", + "line": 6, + "description": "

Returns the current URL.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentURL(), '/some/path', "correct URL was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentURL", + "return": { + "description": "The currently active URL.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.js", + "line": 9, + "description": "

Resumes a test paused by pauseTest.

\n", + "itemtype": "method", + "name": "resumeTest", + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.js", + "line": 22, + "description": "

Pauses the current test - this is useful for debugging while testing or for test-driving.\nIt allows you to inspect the state of your application at any point.\nExample (The test will pause before clicking the button):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('/')\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

You may want to turn off the timeout before pausing.

\n

qunit (timeout available to use as of 2.4.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nassert.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

mocha (timeout happens automatically as of ember-mocha v0.14.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nthis.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n", + "since": "1.9.0", + "itemtype": "method", + "name": "pauseTest", + "return": { + "description": "A promise that will never resolve", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/visit.js", + "line": 3, + "description": "

Loads a route, sets up any controllers, and renders any templates associated\nwith the route as though a real user had triggered the route change while\nusing your app.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('posts/index').then(function() {\n  // assert something\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/wait.js", + "line": 9, + "description": "

Causes the run loop to process any pending events. This is used to ensure that\nany async operations from other helpers (or your assertions) have been processed.

\n

This is most often used as the return value for the helper functions (see 'click',\n'fillIn','visit',etc). However, there is a method to register a test helper which\nutilizes this method without the need to actually call wait() in your helpers.

\n

The wait helper is built into registerAsyncHelper by default. You will not need\nto return app.testHelpers.wait(); - the wait behavior is provided for you.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('loginUser', function(app, username, password) {\n  visit('secured/path/here')\n    .fillIn('#username', username)\n    .fillIn('#password', password)\n    .click('.submit');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "wait", + "params": [ + { + "name": "value", + "description": "The value to be returned.", + "type": "Object" + } + ], + "return": { + "description": "Promise that resolves to the passed value.", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/test/helpers.js", + "line": 8, + "description": "

registerHelper is used to register a test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

This helper can later be called without arguments because it will be\ncalled with app as the first parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nApp = Application.create();\nApp.injectTestHelpers();\nboot();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.js", + "line": 52, + "description": "

registerAsyncHelper is used to register an async test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerAsyncHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterAsyncHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

The advantage of an async helper is that it will not run\nuntil the last async helper has completed. All async helpers\nafter it will wait for it complete before running.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('deletePost', function(app, postId) {\n  click('.delete-' + postId);\n});\n\n// ... in your test\nvisit('/post/2');\ndeletePost(2);\nvisit('/post/3');\ndeletePost(3);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerAsyncHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.js", + "line": 105, + "description": "

Remove a previously added helper method.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { unregisterHelper } from '@ember/test';\n\nunregisterHelper('wait');
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregisterHelper", + "static": 1, + "params": [ + { + "name": "name", + "description": "The helper to remove.", + "type": "String" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.js", + "line": 7, + "description": "

This allows ember-testing to play nicely with other asynchronous\nevents, such as an application that is waiting for a CSS3\ntransition or an IndexDB transaction. The waiter runs periodically\nafter each async helper (i.e. click, andThen, visit, etc) has executed,\nuntil the returning result is truthy. After the waiters finish, the next async helper\nis executed and the process repeats.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(function() {\n  return myPendingTransactions() === 0;\n});
\n
\n
\n \n

The context argument allows you to optionally specify the this\nwith which your callback will be invoked.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(MyDB, MyDB.hasPendingTransactions);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.js", + "line": 55, + "description": "

unregisterWaiter is used to unregister a callback that was\nregistered with registerWaiter.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "unregisterWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.js", + "line": 83, + "description": "

Iterates through each registered test waiter, and invokes\nits callback. If any waiter returns false, this method will return\ntrue indicating that the waiters have not settled yet.

\n

This is generally used internally from the acceptance/integration test\ninfrastructure.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "checkWaiters", + "class": "@ember/test", + "module": "@ember/test" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 10, + "description": "

This property contains the testing helpers for the current application. These\nare created once you call injectTestHelpers on your Application\ninstance. The included helpers are also available on the window object by\ndefault, but can be used from this object on the individual application also.

\n", + "itemtype": "property", + "name": "testHelpers", + "type": "{Object}", + "default": "{}", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 23, + "description": "

This property will contain the original methods that were registered\non the helperContainer before injectTestHelpers is called.

\n

When removeTestHelpers is called, these methods are restored to the\nhelperContainer.

\n", + "itemtype": "property", + "name": "originalMethods", + "type": "{Object}", + "default": "{}", + "access": "private", + "tagname": "", + "since": "1.3.0", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 38, + "description": "

This property indicates whether or not this application is currently in\ntesting mode. This is set when setupForTesting is called on the current\napplication.

\n", + "itemtype": "property", + "name": "testing", + "type": "{Boolean}", + "default": "false", + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.js", + "line": 78, + "description": "

This will be used as the container to inject the test helpers into. By\ndefault the helpers are injected into window.

\n", + "itemtype": "property", + "name": "helperContainer", + "type": "{Object} The object to be used for test helpers.", + "default": "window", + "since": "1.2.0", + "access": "private", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/test", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/utils-49fddeb959.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/utils-49fddeb959.json new file mode 100644 index 000000000..1475fe7fe --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@ember/utils-49fddeb959.json @@ -0,0 +1,213 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/utils", + "type": "class", + "attributes": { + "name": "@ember/utils", + "shortname": "@ember/utils", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/utils", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/is_blank.ts", + "line": 5, + "description": "

A value is blank if it is empty or a whitespace string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "isBlank", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_empty.ts", + "line": 5, + "description": "

Verifies that a value is null or undefined, an empty string, or an empty\narray.

\n

Constrains the rules on isNone by returning true for empty strings and\nempty arrays.

\n

If the value is an object with a size property of type number, it is used\nto check emptiness.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
isEmpty(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
\n
\n \n", + "itemtype": "method", + "name": "isEmpty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_none.ts", + "line": 4, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
isNone(null);          // true\nisNone(undefined);     // true\nisNone('');            // false\nisNone([]);            // false\nisNone(function() {}); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isNone", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_present.ts", + "line": 5, + "description": "

A value is present if it not isBlank.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
isPresent(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
\n
\n \n", + "itemtype": "method", + "name": "isPresent", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.8.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/compare.ts", + "line": 51, + "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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { compare } from '@ember/utils';\n\ncompare('hello', 'hello');  // 0\ncompare('abc', 'dfg');      // -1\ncompare(2, 1);              // 1
\n
\n
\n \n

If 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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { compare } from '@ember/utils';\n\ncompare('hello', 50);       // 1\ncompare(50, 'hello');       // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "compare", + "static": 1, + "params": [ + { + "name": "v", + "description": "First value to compare", + "type": "Object" + }, + { + "name": "w", + "description": "Second value to compare", + "type": "Object" + } + ], + "return": { + "description": "-1 if v < w, 0 if v = w and 1 if v > w.", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/is-equal.ts", + "line": 4, + "description": "

Compares two objects, returning true if they are equal.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { isEqual } from '@ember/utils';\n\nisEqual('hello', 'hello');                   // true\nisEqual(1, 2);                               // false
\n
\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Due 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { isEqual } from '@ember/utils';\n\nisEqual([4, 2], [4, 2]);                     // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEqual", + "static": 1, + "params": [ + { + "name": "a", + "description": "first object to compare", + "type": "Object" + }, + { + "name": "b", + "description": "second object to compare", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/type-of.ts", + "line": 40, + "description": "

Returns a consistent type for the passed object.

\n

Use 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\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
\n
\n \n

Examples:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "typeOf", + "params": [ + { + "name": "item", + "description": "the item to check" + } + ], + "return": { + "description": "the type", + "type": "String" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/utils", + "module": "@ember/utils" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/utils", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@glimmer/tracking-d4e5f86c0e.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@glimmer/tracking-d4e5f86c0e.json new file mode 100644 index 000000000..6675ead72 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@glimmer/tracking-d4e5f86c0e.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.5.1-@glimmer/tracking", + "type": "class", + "attributes": { + "name": "@glimmer/tracking", + "shortname": "@glimmer/tracking", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 22, + "description": "

Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are static, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>Count: {{this.count}}</div>\n<div>Times Ten: {{this.timesTen}}</div>\n<div>\n  <button {{on "click" this.plusOne}}>\n    Plus One\n  </button>\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class CounterComponent extends Component {\n  @tracked count = 0;\n\n  get timesTen() {\n    return this.count * 10;\n  }\n\n  @action\n  plusOne() {\n    this.count += 1;\n  }\n}
\n
\n
\n \n

Both the {{this.count}} and the {{this.timesTen}} properties in the\ntemplate will update whenever the button is clicked. Any tracked properties\nthat are used in any way to calculate a value that is used in the template\nwill cause a rerender when updated - this includes through method calls and\nother means:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nclass Entry {\n  @tracked name;\n  @tracked phoneNumber;\n\n  constructor(name, phoneNumber) {\n    this.name = name;\n    this.phoneNumber = phoneNumber;\n  }\n}\n\nexport default class PhoneBookComponent extends Component {\n  entries = [\n    new Entry('Pizza Palace', 5551234),\n    new Entry('1st Street Cleaners', 5554321),\n    new Entry('Plants R Us', 5552468),\n  ];\n\n  // Any usage of this property will update whenever any of the names in the\n  // entries arrays are updated\n  get names() {\n    return this.entries.map(e => e.name);\n  }\n\n  // Any usage of this property will update whenever any of the numbers in the\n  // entries arrays are updated\n  get numbers() {\n    return this.getFormattedNumbers();\n  }\n\n  getFormattedNumbers() {\n    return this.entries\n      .map(e => e.phoneNumber)\n      .map(number => {\n        let numberString = '' + number;\n\n        return numberString.slice(0, 3) + '-' + numberString.slice(3);\n      });\n  }\n}
\n
\n
\n \n

It's important to note that setting tracked properties will always trigger an\nupdate, even if the property is set to the same value as it was before.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let entry = new Entry('Pizza Palace', 5551234);\n\n// if entry was used when rendering, this would cause a rerender, even though\n// the name is being set to the same value as it was before\nentry.name = entry.name;
\n
\n
\n \n

tracked can also be used with the classic Ember object model in a similar\nmanner to classic computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked(),\n  phoneNumber: tracked()\n});
\n
\n
\n \n

Often this is unnecessary, but to ensure robust auto-tracking behavior it is\nadvisable to mark tracked state appropriately wherever possible.

\n

This form of tracked also accepts an optional configuration object\ncontaining either an initial value or an initializer function (but not\nboth).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked({ value: 'Zoey' }),\n  favoriteSongs: tracked({\n    initializer: () => ['Raspberry Beret', 'Time After Time']\n  })\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "tracked", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 158, + "description": "

Gives the getter a caching behavior. The return value of the getter\nwill be cached until any of the properties it is entangled with\nare invalidated. This is useful when a getter is expensive and\nused very often.

\n

For instance, in this GuestList class, we have the sortedGuests\ngetter that sorts the guests alphabetically:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
  import { tracked } from '@glimmer/tracking';\n\n  class GuestList {\n    @tracked guests = ['Zoey', 'Tomster'];\n\n    get sortedGuests() {\n      return this.guests.slice().sort()\n    }\n  }
\n
\n
\n \n

Every time sortedGuests is accessed, a new array will be created and sorted,\nbecause JavaScript getters do not cache by default. When the guest list\nis small, like the one in the example, this is not a problem. However, if\nthe guest list were to grow very large, it would mean that we would be doing\na large amount of work each time we accessed sortedGetters. With @cached,\nwe can cache the value instead:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
  import { tracked, cached } from '@glimmer/tracking';\n\n  class GuestList {\n    @tracked guests = ['Zoey', 'Tomster'];\n\n    @cached\n    get sortedGuests() {\n      return this.guests.slice().sort()\n    }\n  }
\n
\n
\n \n

Now the sortedGuests getter will be cached based on autotracking.\nIt will only rerun and create a new sorted array when the guests tracked\nproperty is updated.

\n

Tradeoffs

\n

Overuse is discouraged.

\n

In general, you should avoid using @cached unless you have confirmed that\nthe getter you are decorating is computationally expensive. @cached adds\na small amount of overhead to the getter, making it more expensive.\nWhile this overhead is small, if @cached is overused it can add up to a\nlarge impact overall in your app. Many getters and tracked properties\nare only accessed once, rendered, and then never rerendered, so adding\n@cached when it is unnecessary can negatively impact performance.

\n

Also, @cached may rerun even if the values themselves have not changed,\nsince tracked properties will always invalidate even if their underlying\nvalue did not change.\nFor example updating an integer value from 5 to an other 5.

\n

Avoiding a cache invalidation in this case is not something that can\nbe achieved on the @cached decorator itself, but rather when updating\nthe underlying values, by applying a diff checking mecanism:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
if (newValue !== this.trackedProp) {\n  this.trackedProp = newValue;\n}
\n
\n
\n \n

Here equal values won't update the property, therefore not triggering a\ncache invalidation.

\n

The cost of these edge-guards adds up to the tradoff calculation of using\na caching strategy, hence requiring a very sensitive approach regarding\nperformance.

\n", + "itemtype": "method", + "name": "cached", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@glimmer/tracking", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-@glimmer/tracking/primitives/cache-e3adb4f77d.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-@glimmer/tracking/primitives/cache-e3adb4f77d.json new file mode 100644 index 000000000..3386fe987 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-@glimmer/tracking/primitives/cache-e3adb4f77d.json @@ -0,0 +1,77 @@ +{ + "data": { + "id": "ember-4.5.1-@glimmer/tracking/primitives/cache", + "type": "class", + "attributes": { + "name": "@glimmer/tracking/primitives/cache", + "shortname": "@glimmer/tracking/primitives/cache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking/primitives/cache", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 14, + "description": "

Receives a function, and returns a wrapped version of it that memoizes based on\nautotracking. The function will only rerun whenever any tracked values used\nwithin it have changed. Otherwise, it will return the previous value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state. Now, `counter` will\n  // only rerun if `state.value` changes.\n  state.value;\n\n  return ++computeCount;\n});\n\ngetValue(counter); // 1\n\n// returns the same value because no tracked state has changed\ngetValue(counter); // 1\n\nstate.value = 'foo';\n\n// reruns because a tracked value used in the function has changed,\n// incermenting the counter\ngetValue(counter); // 2
\n
\n
\n \n", + "itemtype": "method", + "name": "createCache", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 56, + "description": "

Gets the value of a cache created with createCache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  return ++computeCount;\n});\n\ngetValue(counter); // 1
\n
\n
\n \n", + "itemtype": "method", + "name": "getValue", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 78, + "description": "

Can be used to check if a memoized function is constant. If no tracked state\nwas used while running a memoized function, it will never rerun, because nothing\ncan invalidate its result. isConst can be used to determine if a memoized\nfunction is constant or not, in order to optimize code surrounding that\nfunction.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue, isConst } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state\n  state.value;\n\n  return computeCount++;\n});\n\nlet constCounter = createCache(() => {\n  return computeCount++;\n});\n\ngetValue(counter);\ngetValue(constCounter);\n\nisConst(counter); // false\nisConst(constCounter); // true
\n
\n
\n \n

If called on a cache that hasn't been accessed yet, it will throw an\nerror. This is because there's no way to know if the function will be constant\nor not yet, and so this helps prevent missing an optimization opportunity on\naccident.

\n", + "itemtype": "method", + "name": "isConst", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@glimmer/tracking/primitives/cache", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Application-63140add7d.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Application-63140add7d.json new file mode 100644 index 000000000..8db298fd4 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Application-63140add7d.json @@ -0,0 +1,799 @@ +{ + "data": { + "id": "ember-4.5.1-Application", + "type": "class", + "attributes": { + "name": "Application", + "shortname": "Application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/lib/application.ts", + "line": 32, + "description": "

An instance of Application is the starting point for every Ember\napplication. It instantiates, initializes and coordinates the\nobjects that make up your app.

\n

Each Ember app has one and only one Application object. Although\nEmber CLI creates this object implicitly, the Application class\nis defined in the app/app.js. You can define a ready method on the\nApplication class, which will be run by Ember when the application is\ninitialized.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
const App = Application.extend({\n  ready() {\n    // your code here\n  }\n})
\n
\n
\n \n

Because Application ultimately inherits from Ember.Namespace, any classes\nyou create will have useful string representations when calling toString().\nSee the Ember.Namespace documentation for more information.

\n

While you can think of your Application as a container that holds the\nother classes in your application, there are several other responsibilities\ngoing on under-the-hood that you may want to understand. It is also important\nto understand that an Application is different from an ApplicationInstance.\nRefer to the Guides to understand the difference between these.

\n

Event Delegation

\n

Ember uses a technique called event delegation. This allows the framework\nto set up a global, shared event listener instead of requiring each view to\ndo it manually. For example, instead of each view registering its own\nmousedown listener on its associated element, Ember sets up a mousedown\nlistener on the body.

\n

If a mousedown event occurs, Ember will look at the target of the event and\nstart walking up the DOM node tree, finding corresponding views and invoking\ntheir mouseDown method as it goes.

\n

Application has a number of default events that it listens for, as\nwell as a mapping from lowercase events to camel-cased view method names. For\nexample, the keypress event causes the keyPress method on the view to be\ncalled, the dblclick event causes doubleClick to be called, and so on.

\n

If there is a bubbling browser event that Ember does not listen for by\ndefault, you can specify custom events and their corresponding view method\nnames by setting the application's customEvents property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // add support for the paste event\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent Ember from setting up a listener for a default event,\nspecify the event name with a null value in the customEvents\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // prevent listeners for mouseenter/mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n

By default, the application sets up these event listeners on the document\nbody. However, in cases where you are embedding an Ember application inside\nan existing page, you may want it to set up the listeners on an element\ninside the body.

\n

For example, if only events inside a DOM element with the ID of ember-app\nshould be delegated, set your application's rootElement property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  rootElement: '#ember-app'\n});
\n
\n
\n \n

The rootElement can be either a DOM element or a CSS selector\nstring. Note that views appended to the DOM outside the root element will\nnot receive events. If you specify a custom root element, make sure you only\nappend views inside it!

\n

To learn more about the events Ember components use, see

\n

components/handling-events.

\n

Initializers

\n

To add behavior to the Application's boot process, you can define initializers in\nthe app/initializers directory, or with ember generate initializer using Ember CLI.\nThese files should export a named initialize function which will receive the created application\nobject as its first argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
export function initialize(application) {\n  // application.inject('route', 'foo', 'service:foo');\n}
\n
\n
\n \n

Application initializers can be used for a variety of reasons including:

\n
    \n
  • setting up external libraries
  • \n
  • injecting dependencies
  • \n
  • setting up event listeners in embedded apps
  • \n
  • deferring the boot process using the deferReadiness and advanceReadiness APIs.
  • \n
\n

Routing

\n

In addition to creating your application's router, Application is\nalso responsible for telling the router when to start routing. Transitions\nbetween routes can be logged with the LOG_TRANSITIONS flag, and more\ndetailed intra-transition logging can be logged with\nthe LOG_TRANSITIONS_INTERNAL flag:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  LOG_TRANSITIONS: true, // basic logging of successful transitions\n  LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n});
\n
\n
\n \n

By default, the router will begin trying to translate the current URL into\napplication state once the browser emits the DOMContentReady event. If you\nneed to defer routing, you can call the application's deferReadiness()\nmethod. Once routing can begin, call the advanceReadiness() method.

\n

If there is any setup required before routing begins, you can implement a\nready() method on your app that will be invoked immediately before routing\nbegins.

\n", + "extends": "Engine", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/application/lib/application.ts", + "line": 186, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 423, + "description": "

Create an ApplicationInstance for this application.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the application instance", + "type": "ApplicationInstance" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 448, + "description": "

Start tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is created.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_watchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 459, + "description": "

Stop tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is about to be destroyed.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_unwatchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 472, + "description": "

Enable the legacy globals mode by allowing this application to act\nas a global namespace. See the docs on the _globalsMode property\nfor details.

\n

Most of these features are already deprecated in 1.x, so we can\nstop using them internally and try to remove them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareForGlobalsMode", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 519, + "description": "

Automatically kick-off the boot process for the application once the\nDOM has become ready.

\n

The initialization itself is scheduled on the actions queue which\nensures that code-loading finishes before booting.

\n

If you are asynchronously loading code, you should call deferReadiness()\nto defer booting, and then call advanceReadiness() once all of your code\nhas finished loading.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "waitForDOMReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 559, + "description": "

This is the autoboot flow:

\n
    \n
  1. Boot the app by calling this.boot()
  2. \n
  3. Create an instance (or use the __deprecatedInstance__ in globals mode)
  4. \n
  5. Boot the instance by calling instance.boot()
  6. \n
  7. Invoke the App.ready() callback
  8. \n
  9. Kick-off routing on the instance
  10. \n
\n

Ideally, this is all we would need to do:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
_autoBoot() {\n  this.boot().then(() => {\n    let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance();\n    return instance.boot();\n  }).then((instance) => {\n    App.ready();\n    instance.startRouting();\n  });\n}
\n
\n
\n \n

Unfortunately, we cannot actually write this because we need to participate\nin the "synchronous" boot process. While the code above would work fine on\nthe initial boot (i.e. DOM ready), when App.reset() is called, we need to\nboot a new instance synchronously (see the documentation on _bootSync()\nfor details).

\n

Because of this restriction, the actual logic of this method is located\ninside didBecomeReady().

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "domReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 604, + "description": "

Use this to defer readiness until some condition is true.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Application from '@ember/application';\n\nlet App = Application.create();\n\nApp.deferReadiness();\n\nfetch('/auth-token')\n.then(response => response.json())\n.then(data => {\n  App.token = data.token;\n  App.advanceReadiness();\n});
\n
\n
\n \n

This allows you to perform asynchronous setup logic and defer\nbooting your application until the setup has finished.

\n

However, if the setup requires a loading UI, it might be better\nto use the router for this purpose.

\n", + "itemtype": "method", + "name": "deferReadiness", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 654, + "description": "

Call advanceReadiness after any asynchronous setup logic has completed.\nEach call to deferReadiness must be matched by a call to advanceReadiness\nor the application will never become ready and routing will not begin.

\n", + "itemtype": "method", + "name": "advanceReadiness", + "see": [ + "{Application#deferReadiness}" + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 693, + "description": "

Initialize the application and return a promise that resolves with the Application\nobject when the boot process is complete.

\n

Run any application initializers and run the application load hook. These hooks may\nchoose to defer readiness. For example, an authentication hook might want to defer\nreadiness until the auth token has been retrieved.

\n

By default, this method is called automatically on "DOM ready"; however, if autoboot\nis disabled, this is automatically called when the first application instance is\ncreated via visit.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 774, + "description": "

Reset the application. This is typically used only in tests. It cleans up\nthe application in the following order:

\n
    \n
  1. Deactivate existing routes
  2. \n
  3. Destroy all objects in the container
  4. \n
  5. Create a new application container
  6. \n
  7. Re-route to the existing url
  8. \n
\n

Typical Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    App.reset();\n  }\n});\n\ntest('first test', function() {\n  // App is freshly reset\n});\n\ntest('second test', function() {\n  // App is again freshly reset\n});
\n
\n
\n \n

Advanced Example:

\n

Occasionally you may want to prevent the app from initializing during\nsetup. This could enable extra configuration, or enable asserting prior\nto the app becoming ready.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    run(function() {\n      App.reset();\n      App.deferReadiness();\n    });\n  }\n});\n\ntest('first test', function() {\n  ok(true, 'something before app is initialized');\n\n  run(function() {\n    App.advanceReadiness();\n  });\n\n  ok(true, 'something after app is initialized');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reset", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 878, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "didBecomeReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 956, + "description": "

Boot a new instance of ApplicationInstance for the current\napplication and navigate it to the given url. Returns a Promise that\nresolves with the instance when the initial routing and rendering is\ncomplete, or rejects with any error that occurred during the boot process.

\n

When autoboot is disabled, calling visit would first cause the\napplication to boot, which runs the application initializers.

\n

This method also takes a hash of boot-time configuration options for\ncustomizing the instance's behavior. See the documentation on\nApplicationInstance.BootOptions for details.

\n

ApplicationInstance.BootOptions is an interface class that exists\npurely to document the available options; you do not need to construct it\nmanually. Simply pass a regular JavaScript object containing of the\ndesired options:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Supported Scenarios

\n

While the BootOptions class exposes a large number of knobs, not all\ncombinations of them are valid; certain incompatible combinations might\nresult in unexpected behavior.

\n

For example, booting the instance in the full browser environment\nwhile specifying a foreign document object (e.g. { isBrowser: true, document: iframe.contentDocument }) does not work correctly today,\nlargely due to Ember's jQuery dependency.

\n

Currently, there are three officially supported scenarios/configurations.\nUsages outside of these scenarios are not guaranteed to work, but please\nfeel free to file bug reports documenting your experience and any issues\nyou encountered to help expand support.

\n

Browser Applications (Manual Boot)

\n

The setup is largely similar to how Ember works out-of-the-box. Normally,\nEmber will boot a default instance for your Application on "DOM ready".\nHowever, you can customize this behavior by disabling autoboot.

\n

For example, this allows you to render a miniture demo of your application\ninto a specific area on your marketing website:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let options = {\n    // Override the router's location adapter to prevent it from updating\n    // the URL in the address bar\n    location: 'none',\n\n    // Override the default `rootElement` on the app to render into a\n    // specific `div` on the page\n    rootElement: '#demo'\n  };\n\n  // Start the app at the special demo URL\n  App.visit('/demo', options);\n});
\n
\n
\n \n

Or perhaps you might want to boot two instances of your app on the same\npage for a split-screen multiplayer experience:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let sessionId = MyApp.generateSessionID();\n\n  let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' });\n  let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' });\n\n  Promise.all([player1, player2]).then(() => {\n    // Both apps have completed the initial render\n    $('#loading').fadeOut();\n  });\n});
\n
\n
\n \n

Do note that each app instance maintains their own registry/container, so\nthey will run in complete isolation by default.

\n

Server-Side Rendering (also known as FastBoot)

\n

This setup allows you to run your Ember app in a server environment using\nNode.js and render its content into static HTML for SEO purposes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap);\n\nfunction renderURL(url) {\n  let dom = new SimpleDOM.Document();\n  let rootElement = dom.body;\n  let options = { isBrowser: false, document: dom, rootElement: rootElement };\n\n  return MyApp.visit(options).then(instance => {\n    try {\n      return HTMLSerializer.serialize(rootElement.firstChild);\n    } finally {\n      instance.destroy();\n    }\n  });\n}
\n
\n
\n \n

In this scenario, because Ember does not have access to a global document\nobject in the Node.js environment, you must provide one explicitly. In practice,\nin the non-browser environment, the stand-in document object only needs to\nimplement a limited subset of the full DOM API. The SimpleDOM library is known\nto work.

\n

Since there is no DOM access in the non-browser environment, you must also\nspecify a DOM Element object in the same document for the rootElement option\n(as opposed to a selector string like "body").

\n

See the documentation on the isBrowser, document and rootElement properties\non ApplicationInstance.BootOptions for details.

\n

Server-Side Resource Discovery

\n

This setup allows you to run the routing layer of your Ember app in a server\nenvironment using Node.js and completely disable rendering. This allows you\nto simulate and discover the resources (i.e. AJAX requests) needed to fulfill\na given request and eagerly "push" these resources to the client.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
service.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import BrowserNetworkService from 'app/services/network/browser';\nimport NodeNetworkService from 'app/services/network/node';\n\n// Inject a (hypothetical) service for abstracting all AJAX calls and use\n// the appropriate implementation on the client/server. This also allows the\n// server to log all the AJAX calls made during a particular request and use\n// that for resource-discovery purpose.\n\nexport function initialize(application) {\n  if (window) { // browser\n    application.register('service:network', BrowserNetworkService);\n  } else { // node\n    application.register('service:network', NodeNetworkService);\n  }\n};\n\nexport default {\n  name: 'network-service',\n  initialize: initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\n// An example of how the (hypothetical) service is used in routes.\n\nexport default class IndexRoute extends Route {\n  @service network;\n\n  model(params) {\n    return this.network.fetch(`/api/posts/${params.post_id}.json`);\n  }\n\n  afterModel(post) {\n    if (post.isExternalContent) {\n      return this.network.fetch(`/api/external/?url=${post.externalURL}`);\n    } else {\n      return post;\n    }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
// Finally, put all the pieces together\n\nfunction discoverResourcesFor(url) {\n  return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => {\n    let networkService = instance.lookup('service:network');\n    return networkService.requests; // => { "/api/posts/123.json": "..." }\n  });\n}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "The initial URL to navigate to", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "ApplicationInstance.BootOptions" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 61, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 208, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 284, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 345, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 358, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 370, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 383, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 391, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 399, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 413, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 447, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Enginer" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 51, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + } + ], + "events": [ + { + "file": "packages/@ember/application/lib/application.ts", + "line": 931, + "description": "

Called when the Application has become ready, immediately before routing\nbegins. The call will be delayed until the DOM has become ready.

\n", + "itemtype": "event", + "name": "ready", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + } + ], + "properties": [ + { + "file": "packages/@ember/application/lib/application.ts", + "line": 221, + "description": "

The root DOM element of the Application. This can be specified as an\nelement or a selector string.

\n

This is the element that will be passed to the Application's,\neventDispatcher, which sets up the listeners for event delegation. Every\nview in your application should be a child of the element you specify here.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 236, + "itemtype": "property", + "name": "_document", + "type": "Document | null", + "default": "'window.document'", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 245, + "description": "

The Ember.EventDispatcher responsible for delegating events to this\napplication's views.

\n

The event dispatcher is created by the application at initialization time\nand sets up event listeners on the DOM element described by the\napplication's rootElement property.

\n

See the documentation for Ember.EventDispatcher for more information.

\n", + "itemtype": "property", + "name": "eventDispatcher", + "type": "Ember.EventDispatcher", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 262, + "description": "

The DOM events for which the event dispatcher should listen.

\n

By default, the application's Ember.EventDispatcher listens\nfor a set of standard DOM events, such as mousedown and\nkeyup, and delegates them to your application's Ember.View\ninstances.

\n

If you would like additional bubbling events to be delegated to your\nviews, set your Application's customEvents property\nto a hash containing the DOM event name as the key and the\ncorresponding view method name as the value. Setting an event to\na value of null will prevent a default event listener from being\nadded for that event.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // add support for the paste event\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // remove support for mouseenter / mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "customEvents", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 310, + "description": "

Whether the application should automatically start routing and render\ntemplates to the rootElement on DOM ready. While default by true,\nother environments such as FastBoot or a testing harness can set this\nproperty to false and control the precise timing and behavior of the boot\nprocess.

\n", + "itemtype": "property", + "name": "autoboot", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 324, + "description": "

Whether the application should be configured for the legacy "globals mode".\nUnder this mode, the Application object serves as a global namespace for all\nclasses.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Application from '@ember/application';\nimport Component from '@ember/component';\n\nlet App = Application.create({\n  ...\n});\n\nApp.Router.reopen({\n  location: 'none'\n});\n\nApp.Router.map({\n  ...\n});\n\nApp.MyComponent = Component.extend({\n  ...\n});
\n
\n
\n \n

This flag also exposes other internal APIs that assumes the existence of\na special "default instance", like App.__container__.lookup(...).

\n

This option is currently not configurable, its value is derived from\nthe autoboot flag – disabling autoboot also implies opting-out of\nglobals mode support, although they are ultimately orthogonal concerns.

\n

Some of the global modes features are already deprecated in 1.x. The\nexistence of this flag is to untangle the globals mode code paths from\nthe autoboot code paths, so that these legacy features can be reviewed\nfor deprecation/removal separately.

\n

Forcing the (autoboot=true, _globalsMode=false) here and running the tests\nwould reveal all the places where we are still relying on these legacy\nbehavior internally (mostly just tests).

\n", + "itemtype": "property", + "name": "_globalsMode", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 373, + "description": "

An array of application instances created by buildInstance(). Used\ninternally to ensure that all instances get destroyed.

\n", + "itemtype": "property", + "name": "_applicationInstances", + "type": "Array", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 324, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 337, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-Engine", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-ApplicationInstance-89848557db.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-ApplicationInstance-89848557db.json new file mode 100644 index 000000000..ee7587687 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-ApplicationInstance-89848557db.json @@ -0,0 +1,1052 @@ +{ + "data": { + "id": "ember-4.5.1-ApplicationInstance", + "type": "class", + "attributes": { + "name": "ApplicationInstance", + "shortname": "ApplicationInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/instance.ts", + "line": 28, + "description": "

The ApplicationInstance encapsulates all of the stateful aspects of a\nrunning Application.

\n

At a high-level, we break application boot into two distinct phases:

\n
    \n
  • Definition time, where all of the classes, templates, and other\ndependencies are loaded (typically in the browser).
  • \n
  • Run time, where we begin executing the application once everything\nhas loaded.
  • \n
\n

Definition time can be expensive and only needs to happen once since it is\nan idempotent operation. For example, between test runs and FastBoot\nrequests, the application stays the same. It is only the state that we want\nto reset.

\n

That state is what the ApplicationInstance manages: it is responsible for\ncreating the container that contains all application state, and disposing of\nit once the particular test run or FastBoot request has finished.

\n", + "access": "public", + "tagname": "", + "extends": "EngineInstance", + "methods": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 305, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 39, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 86, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 152, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 169, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 199, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 38, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 64, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 125, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 51, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 54, + "description": "

The Application for which this is an instance.

\n", + "itemtype": "property", + "name": "application", + "type": "Application", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 62, + "description": "

The root DOM element of the Application as an element or a\nCSS selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "String|DOMElement", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 47, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 30, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-EngineInstance", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-ApplicationInstance.BootOptions-bdf7acc41d.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-ApplicationInstance.BootOptions-bdf7acc41d.json new file mode 100644 index 000000000..d16551842 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-ApplicationInstance.BootOptions-bdf7acc41d.json @@ -0,0 +1,143 @@ +{ + "data": { + "id": "ember-4.5.1-ApplicationInstance.BootOptions", + "type": "class", + "attributes": { + "name": "ApplicationInstance.BootOptions", + "shortname": "ApplicationInstance.BootOptions", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "ApplicationInstance", + "file": "packages/@ember/application/instance.ts", + "line": 325, + "description": "

A list of boot-time configuration options for customizing the behavior of\nan ApplicationInstance.

\n

This is an interface class that exists purely to document the available\noptions; you do not need to construct it manually. Simply pass a regular\nJavaScript object containing the desired options into methods that require\none of these options object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Not all combinations of the supported options are valid. See the documentation\non Application#visit for the supported configurations.

\n

Internal, experimental or otherwise unstable flags are marked as private.

\n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 348, + "description": "

Interactive mode: whether we need to set up event delegation and invoke\nlifecycle callbacks on Components.

\n", + "itemtype": "property", + "name": "isInteractive", + "type": "boolean", + "default": "auto-detected", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 359, + "itemtype": "property", + "name": "_renderMode", + "type": "string", + "default": "undefined", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 367, + "description": "

Run in a full browser environment.

\n

When this flag is set to false, it will disable most browser-specific\nand interactive features. Specifically:

\n
    \n
  • It does not use jQuery to append the root view; the rootElement\n(either specified as a subsequent option or on the application itself)\nmust already be an Element in the given document (as opposed to a\nstring selector).

    \n
  • \n
  • It does not set up an EventDispatcher.

    \n
  • \n
  • It does not run any Component lifecycle hooks (such as didInsertElement).

    \n
  • \n
  • It sets the location option to "none". (If you would like to use\nthe location adapter specified in the app's router instead, you can also\nspecify { location: null } to specifically opt-out.)

    \n
  • \n
\n", + "itemtype": "property", + "name": "isBrowser", + "type": "boolean", + "default": "auto-detected", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 393, + "description": "

If present, overrides the router's location property with this\nvalue. This is useful for environments where trying to modify the\nURL would be inappropriate.

\n", + "itemtype": "property", + "name": "location", + "type": "string", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 405, + "description": "

Disable rendering completely.

\n

When this flag is set to false, it will disable the entire rendering\npipeline. Essentially, this puts the app into "routing-only" mode. No\ntemplates will be rendered, and no Components will be created.

\n", + "itemtype": "property", + "name": "shouldRender", + "type": "boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 419, + "description": "

If present, render into the given Document object instead of the\nglobal window.document object.

\n

In practice, this is only useful in non-browser environment or in\nnon-interactive mode, because Ember's jQuery dependency is\nimplicitly bound to the current document, causing event delegation\nto not work properly when the app is rendered into a foreign\ndocument object (such as an iframe's contentDocument).

\n

In non-browser mode, this could be a "Document-like" object as\nEmber only interact with a small subset of the DOM API in non-\ninteractive mode. While the exact requirements have not yet been\nformalized, the SimpleDOM library's implementation is known to\nwork.

\n", + "itemtype": "property", + "name": "document", + "type": "Document", + "default": "the global `document` object", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 442, + "description": "

If present, overrides the application's rootElement property on\nthe instance. This is useful for testing environment, where you\nmight want to append the root view to a fixture area.

\n

In non-browser mode, because Ember does not have access to jQuery,\nthis options must be specified as a DOM Element object instead of\na selector string.

\n

See the documentation on Application's rootElement for\ndetails.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "String|Element", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-ArrayProxy-c362311937.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-ArrayProxy-c362311937.json new file mode 100644 index 000000000..b3966b9be --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-ArrayProxy-c362311937.json @@ -0,0 +1,1834 @@ +{ + "data": { + "id": "ember-4.5.1-ArrayProxy", + "type": "class", + "attributes": { + "name": "ArrayProxy", + "shortname": "ArrayProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.ts", + "line": 58, + "description": "

An ArrayProxy wraps any other object that implements Array and/or\nMutableArray, forwarding all requests. This makes it very useful for\na number of binding use cases or other cases where being able to swap\nout the underlying array is useful.

\n

A simple example of usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({ content: A(pets) });\n\nap.get('firstObject');                        // 'dog'\nap.set('content', ['amoeba', 'paramecium']);\nap.get('firstObject');                        // 'amoeba'
\n
\n
\n \n

This class can also be useful as a layer to transform the contents of\nan array, as they are accessed. This can be done by overriding\nobjectAtContent:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({\n    content: A(pets),\n    objectAtContent: function(idx) {\n        return this.get('content').objectAt(idx).toUpperCase();\n    }\n});\n\nap.get('firstObject'); // . 'DOG'
\n
\n
\n \n

When overriding this class, it is important to place the call to\n_super after setting content so the internal observers have\na chance to fire properly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nexport default ArrayProxy.extend({\n  init() {\n    this.set('content', A(['dog', 'cat', 'fish']));\n    this._super(...arguments);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.ts", + "line": 183, + "description": "

Should actually retrieve the object at the specified index from the\ncontent. You can override this method in subclasses to transform the\ncontent item to something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "objectAtContent", + "params": [ + { + "name": "idx", + "description": "The index to retrieve.", + "type": "Number" + } + ], + "return": { + "description": "the value or undefined if none found", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.ts", + "line": 211, + "description": "

Should actually replace the specified objects on the content array.\nYou can override this method in subclasses to transform the content item\ninto something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "replaceContent", + "params": [ + { + "name": "idx", + "description": "The starting index", + "type": "Number" + }, + { + "name": "amt", + "description": "The number of items to remove from the content.", + "type": "Number" + }, + { + "name": "objects", + "description": "Optional array of objects to insert.", + "type": "EmberArray" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1349, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1368, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1394, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1416, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1441, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1461, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1481, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1507, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1532, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1552, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1573, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1592, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1619, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1647, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1664, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1690, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1117, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1155, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1167, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1183, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1216, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1260, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1279, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1301, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.ts", + "line": 171, + "description": "

The content array. Must be an object that implements Array and/or\nMutableArray.

\n", + "itemtype": "property", + "name": "content", + "type": "EmberArray", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.ts", + "line": 394, + "description": "

The array that the proxy pretends to be. In the default ArrayProxy\nimplementation, this and content are the same. Subclasses of ArrayProxy\ncan override this property to provide things like sorting and filtering.

\n", + "itemtype": "property", + "name": "arrangedContent", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Component-3d6ca8c512.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Component-3d6ca8c512.json new file mode 100644 index 000000000..70e582a9d --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Component-3d6ca8c512.json @@ -0,0 +1,1587 @@ +{ + "data": { + "id": "ember-4.5.1-Component", + "type": "class", + "attributes": { + "name": "Component", + "shortname": "Component", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 38, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault component's for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Classic components. If you are looking for the\nAPI documentation for Template-only or Glimmer components, it is\navailable here.

\n

Defining a Classic Component

\n

If you want to customize the component in order to handle events, transform\narguments or maintain internal state, you implement a subclass of Component.

\n

One example is to add computed properties to your component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  displayName: computed('person.title', 'person.firstName', 'person.lastName', function() {\n    let { title, firstName, lastName } = this.person;\n\n    if (title) {\n      return `${title} ${lastName}`;\n    } else {\n      return `${firstName} ${lastName}`;\n    }\n  })\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

Customizing a Classic Component's HTML Element in JavaScript

\n

HTML Tag

\n

The default HTML tag name used for a component's HTML representation is div.\nThis can be customized by setting the tagName property.

\n

Consider the following component class:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
paragraph.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'em'\n});
\n
\n
\n \n

When invoked, this component would produce output that looks something like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<em id="ember1" class="ember-view"></em>
\n
\n
\n \n

HTML class Attribute

\n

The HTML class attribute of a component's tag can be set by providing a\nclassNames property that is set to an array of strings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class']\n});
\n
\n
\n \n

Invoking this component will produce output that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class"></div>
\n
\n
\n \n

class attribute values can also be set by providing a classNameBindings\nproperty set to an array of properties names for the component. The return\nvalue of these properties will be added as part of the value for the\ncomponents's class attribute. These properties can be computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class'],\n  classNameBindings: ['propertyA', 'propertyB'],\n\n  propertyA: 'from-a',\n  propertyB: computed(function() {\n    if (someLogic) { return 'from-b'; }\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

Note that classNames and classNameBindings is in addition to the class\nattribute passed with the angle bracket invocation syntax. Therefore, if this\ncomponent was invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyWidget class="from-invocation" />
\n
\n
\n \n

The resulting HTML will look similar to this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="from-invocation ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

If the value of a class name binding returns a boolean the property name\nitself will be used as the class name if the property is true. The class name\nwill not be added if the value is false or undefined.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['hovered'],\n\n  hovered: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view hovered"></div>
\n
\n
\n \n

Custom Class Names for Boolean Values

\n

When using boolean class name bindings you can supply a string value other\nthan the property name for use as the class HTML attribute by appending the\npreferred value after a ":" character when defining the binding:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['awesome:so-very-cool'],\n\n  awesome: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view so-very-cool"></div>
\n
\n
\n \n

Boolean value class name bindings whose property names are in a\ncamelCase-style format will be converted to a dasherized format:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isUrgent'],\n\n  isUrgent: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view is-urgent"></div>
\n
\n
\n \n

Class name bindings can also refer to object values that are found by\ntraversing a path relative to the component itself:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport EmberObject from '@ember/object';\n\nexport default Component.extend({\n  classNameBindings: ['messages.empty'],\n\n  messages: EmberObject.create({\n    empty: true\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view empty"></div>
\n
\n
\n \n

If you want to add a class name for a property which evaluates to true and\nand a different class name if it evaluates to false, you can pass a binding\nlike this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isEnabled:enabled:disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view enabled"></div>
\n
\n
\n \n

When isEnabled is false, the resulting HTML representation looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

This syntax offers the convenience to add a class if a property is false:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\n// Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\nexport default Component.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component when the isEnabled property is true will produce\nHTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view"></div>
\n
\n
\n \n

Invoking it when the isEnabled property on the component is false will\nproduce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

Updates to the value of a class name binding will result in automatic update\nof the HTML class attribute in the component's rendered HTML\nrepresentation. If the value becomes false or undefined the class name\nwill be removed.

\n

Both classNames and classNameBindings are concatenated properties. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Other HTML Attributes

\n

The HTML attribute section of a component's tag can be set by providing an\nattributeBindings property set to an array of property names on the component.\nThe return value of these properties will be used as the value of the component's\nHTML associated attribute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['href'],\n\n  href: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

One property can be mapped on to another by placing a ":" between\nthe source property and the destination property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['url:href'],\n\n  url: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

HTML attributes passed with angle bracket invocations will take precedence\nover those specified in attributeBindings. Therefore, if this component was\ninvoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyAnchor href="http://bing.com" @url="http://google.com" />
\n
\n
\n \n

The resulting HTML will looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://bing.com"></a>
\n
\n
\n \n

Note that the href attribute is ultimately set to http://bing.com,\ndespite it having attribute binidng to the url property, which was\nset to http://google.com.

\n

Namespaced attributes (e.g. xlink:href) are supported, but have to be\nmapped, since : is not a valid character for properties in Javascript:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
use.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'use',\n  attributeBindings: ['xlinkHref:xlink:href'],\n\n  xlinkHref: '#triangle'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<use xlink:href="#triangle"></use>
\n
\n
\n \n

If the value of a property monitored by attributeBindings is a boolean, the\nattribute will be present or absent depending on the value:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: false\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id="ember1" class="ember-view" />
\n
\n
\n \n

attributeBindings can refer to computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: computed(function() {\n    if (someLogic) {\n      return true;\n    } else {\n      return false;\n    }\n  })\n});
\n
\n
\n \n

To prevent setting an attribute altogether, use null or undefined as the\nvalue of the property used in attributeBindings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'form',\n  attributeBindings: ['novalidate'],\n  novalidate: null\n});
\n
\n
\n \n

Updates to the property of an attribute binding will result in automatic\nupdate of the HTML attribute in the component's HTML output.

\n

attributeBindings is a concatenated property. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Layouts

\n

The layout property can be used to dynamically specify a template associated\nwith a component class, instead of relying on Ember to link together a\ncomponent class and a template based on file names.

\n

In general, applications should not use this feature, but it's commonly used\nin addons for historical reasons.

\n

The layout property should be set to the default export of a template\nmodule, which is the name of a template file without the .hbs extension.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>Person's Title</h1>\n<div class='details'>{{yield}}</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n
  import Component from '@ember/component';\n  import layout from '../templates/components/person-profile';\n\n  export default Component.extend({\n    layout\n  });
\n
\n
\n \n

If you invoke the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile>\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</PersonProfile>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#person-profile}}\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n{{/person-profile}}
\n
\n
\n \n

It will result in the following HTML output:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<h1>Person's Title</h1>\n  <div class="details">\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</div>
\n
\n
\n \n

Handling Browser Events

\n

Components can respond to user-initiated events in one of three ways: passing\nactions with angle bracket invocation, adding event handler methods to the\ncomponent's class, or adding actions to the component's template.

\n

Passing Actions With Angle Bracket Invocation

\n

For one-off events specific to particular instance of a component, it is possible\nto pass actions to the component's element using angle bracket invocation syntax.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyWidget {{action 'firstWidgetClicked'}} />\n\n<MyWidget {{action 'secondWidgetClicked'}} />
\n
\n
\n \n

In this case, when the first component is clicked on, Ember will invoke the\nfirstWidgetClicked action. When the second component is clicked on, Ember\nwill invoke the secondWidgetClicked action instead.

\n

Besides {{action}}, it is also possible to pass any arbitrary element modifiers\nusing the angle bracket invocation syntax.

\n

Event Handler Methods

\n

Components can also respond to user-initiated events by implementing a method\nthat matches the event name. This approach is appropriate when the same event\nshould be handled by all instances of the same component.

\n

An event object will be passed as the argument to the event handler method.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click(event) {\n    // `event.target` is either the component's element or one of its children\n    let tag = event.target.tagName.toLowerCase();\n    console.log('clicked on a `<${tag}>` HTML element!');\n  }\n});
\n
\n
\n \n

In this example, whenever the user clicked anywhere inside the component, it\nwill log a message to the console.

\n

It is possible to handle event types other than click by implementing the\nfollowing event handler methods. In addition, custom events can be registered\nby using Application.customEvents.

\n

Touch events:

\n
    \n
  • touchStart
  • \n
  • touchMove
  • \n
  • touchEnd
  • \n
  • touchCancel
  • \n
\n

Keyboard events:

\n
    \n
  • keyDown
  • \n
  • keyUp
  • \n
  • keyPress
  • \n
\n

Mouse events:

\n
    \n
  • mouseDown
  • \n
  • mouseUp
  • \n
  • contextMenu
  • \n
  • click
  • \n
  • doubleClick
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
\n

Form events:

\n
    \n
  • submit
  • \n
  • change
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
  • input
  • \n
\n

Drag and drop events:

\n
    \n
  • dragStart
  • \n
  • drag
  • \n
  • dragEnter
  • \n
  • dragLeave
  • \n
  • dragOver
  • \n
  • dragEnd
  • \n
  • drop
  • \n
\n

{{action}} Helper

\n

Instead of handling all events of a particular type anywhere inside the\ncomponent's element, you may instead want to limit it to a particular\nelement in the component's template. In this case, it would be more\nconvenient to implement an action instead.

\n

For example, you could implement the action hello for the person-profile\ncomponent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  actions: {\n    hello(name) {\n      console.log("Hello", name);\n    }\n  }\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
<h1>{{@person.name}}</h1>\n\n<button {{action 'hello' @person.name}}>\n  Say Hello to {{@person.name}}\n</button>
\n
\n
\n \n

When the user clicks the button, Ember will invoke the hello action,\npassing in the current value of @person.name as an argument.

\n

See Ember.Templates.helpers.action.

\n", + "extends": "Ember.CoreView", + "uses": [ + "Ember.ViewStateSupport", + "Ember.ViewMixin", + "Ember.ActionSupport", + "Ember.ClassNamesSupport", + "Ember.TargetActionSupport" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 655, + "description": "

Called when the attributes passed into the component have been updated.\n Called both during the initial render of a container and during a rerender.\n Can be used in place of an observer; code placed here will be executed\n every time any attribute updates.

\n", + "itemtype": "method", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 676, + "description": "

Called after a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "method", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 693, + "description": "

Called before a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "method", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 710, + "description": "

Called when the attributes passed into the component have been changed.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 727, + "description": "

Called when the component is about to update and rerender itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 744, + "description": "

Called when the component has updated and rerendered itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 950, + "description": "

Normally, Ember's component model is "write-only". The component takes a\nbunch of attributes that it got passed in, and uses them to render its\ntemplate.

\n

One nice thing about this model is that if you try to set a value to the\nsame thing as last time, Ember (through HTMLBars) will avoid doing any\nwork on the DOM.

\n

This is not just a performance optimization. If an attribute has not\nchanged, it is important not to clobber the element's "hidden state".\nFor example, if you set an input's value to the same value as before,\nit will clobber selection state and cursor position. In other words,\nsetting an attribute is not always idempotent.

\n

This method provides a way to read an element's attribute and also\nupdate the last value Ember knows about at the same time. This makes\nsetting an attribute idempotent.

\n

In particular, what this means is that if you get an <input> element's\nvalue attribute and then re-render the template with the same value,\nit will avoid clobbering the cursor and selection position.\nSince most attribute sets are idempotent in the browser, you typically\ncan get away with reading attributes using jQuery, but the most reliable\nway to do so is through this method.

\n", + "itemtype": "method", + "name": "readDOMAttr", + "params": [ + { + "name": "name", + "description": "the name of the attribute", + "type": "String" + } + ], + "return": { + "description": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 35, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 57, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 77, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 109, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 152, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 161, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 176, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 192, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 208, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 74, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 92, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 120, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 140, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 180, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 245, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 330, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 404, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 438, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 51, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.TargetActionSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 171, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 95, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 121, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 142, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 165, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 180, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 431, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Mixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 666, + "description": "

Called when the attributes passed into the component have been updated.\n Called both during the initial render of a container and during a rerender.\n Can be used in place of an observer; code placed here will be executed\n every time any attribute updates.

\n", + "itemtype": "event", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 685, + "description": "

Called after a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "event", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 702, + "description": "

Called before a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "event", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 719, + "description": "

Called when the attributes passed into the component have been changed.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 736, + "description": "

Called when the component is about to update and rerender itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 753, + "description": "

Called when the component has updated and rerendered itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 299, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 307, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 320, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 344, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 357, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 365, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 761, + "description": "

The HTML id of the component's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent @elementId="a-really-cool-id" />
\n
\n
\n \n

If not manually set a default value will be provided by the framework.\nOnce rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
export default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    var index = this.get('index');\n    this.set('elementId', `component-id${index}`);\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1010, + "description": "

Layout can be used to wrap content in a component.

\n", + "itemtype": "property", + "name": "layout", + "type": "Function", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1018, + "description": "

The name of the layout to lookup if no layout is provided.\nBy default Component will lookup a template with this name in\nEmber.TEMPLATES (a shared global object).

\n", + "itemtype": "property", + "name": "layoutName", + "type": "String", + "default": "undefined", + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1029, + "description": "

The WAI-ARIA role of the control represented by this view. For example, a\n button may have a role of type 'button', or a pane may have a role of\n type 'alertdialog'. This property is used by assistive software to help\n visually challenged users navigate rich web applications.

\n

The full list of valid WAI-ARIA roles is available at:\n https://www.w3.org/TR/wai-aria/#roles_categorization

\n", + "itemtype": "property", + "name": "ariaRole", + "type": "String", + "default": "undefined", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1054, + "description": "

Enables components to take a list of parameters as arguments.\n For example, a component that takes two parameters with the names\n name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: ['name', 'age']\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" 38}}
\n
\n
\n \n

The parameters can be referred to just like named parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Name: {{name}}, Age: {{age}}.
\n
\n
\n \n

Using a string instead of an array allows for an arbitrary number of\n parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: 'names'\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" "Michael" "Scott"}}
\n
\n
\n \n

The parameters can then be referred to by enumerating over the list:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{#each names as |name|}}{{name}}{{/each}}
\n
\n
\n \n", + "static": 1, + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "positionalParams", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 35, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 34, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 165, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 266, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 377, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/child_views_support.ts", + "line": 13, + "description": "

Array of child views. You should never edit this array directly.

\n", + "itemtype": "property", + "name": "childViews", + "type": "Array", + "default": "[]", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 35, + "description": "

Standard CSS class names to apply to the view's outer element. This\nproperty automatically inherits any class names defined by the view's\nsuperclasses as well.

\n", + "itemtype": "property", + "name": "classNames", + "type": "Array", + "default": "['ember-view']", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 47, + "description": "

A list of properties of the view to apply as class names. If the property\nis a string value, the value of that string will be applied as a class\nname.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'high' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['priority'],\n  priority: 'high'\n});
\n
\n
\n \n

If the value of the property is a Boolean, the name of that property is\nadded as a dasherized class name.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'is-urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would prefer to use a custom value instead of the dasherized\nproperty name, you can pass a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent:urgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would like to specify a class that should only be added when the\nproperty is false, you can declare a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'disabled' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: false\n});
\n
\n
\n \n

This list of properties is inherited from the component's superclasses as well.

\n", + "itemtype": "property", + "name": "classNameBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 26, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-Ember.CoreView", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-ComputedProperty-051ca7dcef.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-ComputedProperty-051ca7dcef.json new file mode 100644 index 000000000..8c9cfd462 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-ComputedProperty-051ca7dcef.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-4.5.1-ComputedProperty", + "type": "class", + "attributes": { + "name": "ComputedProperty", + "shortname": "ComputedProperty", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 74, + "description": "

@computed is a decorator that turns a JavaScript getter and setter into a\ncomputed property, which is a cached, trackable value. By default the getter\nwill only be called once and the result will be cached. You can specify\nvarious properties that your computed property depends on. This will force the\ncached result to be cleared if the dependencies are modified, and lazily recomputed the next time something asks for it.

\n

In the following example we decorate a getter - fullName - by calling\ncomputed with the property dependencies (firstName and lastName) as\narguments. The fullName getter will be called once (regardless of how many\ntimes it is accessed) as long as its dependencies do not change. Once\nfirstName or lastName are updated any future calls to fullName will\nincorporate the new values, and any watchers of the value such as templates\nwill be updated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet tom = new Person('Tom', 'Dale');\n\ntom.fullName; // 'Tom Dale'
\n
\n
\n \n

You can also provide a setter, which will be used when updating the computed\nproperty. Ember's set function must be used to update the property\nsince it will also notify observers of the property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(' ');\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

You can also pass a getter function or object with get and set functions\nas the last argument to the computed decorator. This allows you to define\ncomputed property macros:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { computed } from '@ember/object';\n\nfunction join(...keys) {\n  return computed(...keys, function() {\n    return keys.map(key => this[key]).join(' ');\n  });\n}\n\nclass Person {\n  @join('firstName', 'lastName')\n  fullName;\n}
\n
\n
\n \n

Note that when defined this way, getters and setters receive the key of the\nproperty they are decorating as the first argument. Setters receive the value\nthey are setting to as the second argument instead. Additionally, setters must\nreturn the value that should be cached:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { computed, set } from '@ember/object';\n\nfunction fullNameMacro(firstNameKey, lastNameKey) {\n  return computed(firstNameKey, lastNameKey, {\n    get() {\n      return `${this[firstNameKey]} ${this[lastNameKey]}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, firstNameKey, firstName);\n      set(this, lastNameKey, lastName);\n\n      return value;\n    }\n  });\n}\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @fullNameMacro('firstName', 'lastName') fullName;\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

Computed properties can also be used in classic classes. To do this, we\nprovide the getter and setter as the last argument like we would for a macro,\nand we assign it to a property on the class definition. This is an anonymous\ncomputed macro:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import EmberObject, { computed, set } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  // these will be supplied by `create`\n  firstName: null,\n  lastName: null,\n\n  fullName: computed('firstName', 'lastName', {\n    get() {\n      return `${this.firstName} ${this.lastName}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, 'firstName', firstName);\n      set(this, 'lastName', lastName);\n\n      return value;\n    }\n  })\n});\n\nlet tom = Person.create({\n  firstName: 'Tom',\n  lastName: 'Dale'\n});\n\ntom.get('fullName') // 'Tom Dale'
\n
\n
\n \n

You can overwrite computed property without setters with a normal property (no\nlonger computed) that won't change if dependencies change. You can also mark\ncomputed property as .readOnly() and block all attempts to set it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName').readOnly()\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet person = new Person();\nperson.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX>
\n
\n
\n \n

Additional resources:

\n\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 604, + "description": "

Call on a computed property to set it into read-only mode. When in this\nmode the computed property will throw an error when set.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  @computed().readOnly()\n  get guid() {\n    return 'guid-guid-guid';\n  }\n}\n\nlet person = new Person();\nset(person, 'guid', 'new-guid'); // will throw an exception
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  guid: computed(function() {\n    return 'guid-guid-guid';\n  }).readOnly()\n});\n\nlet person = Person.create();\nperson.set('guid', 'new-guid'); // will throw an exception
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "return": { + "description": "this", + "type": "ComputedProperty" + }, + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 654, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For example,\ncomputed property functions may close over variables that are then no longer\navailable for introspection. You can pass a hash of these values to a\ncomputed property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nclass Store {\n  @computed().meta({ type: Person })\n  get person() {\n    let personId = this.personId;\n    return Person.create({ id: personId });\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nconst Store = EmberObject.extend({\n  person: computed(function() {\n    let personId = this.get('personId');\n    return Person.create({ id: personId });\n  }).meta({ type: Person })\n});
\n
\n
\n \n

The hash that you pass to the meta() function will be saved on the\ncomputed property descriptor under the _meta key. Ember runtime\nexposes a public API for retrieving these values from classes,\nvia the metaForProperty() function.

\n", + "itemtype": "method", + "name": "meta", + "params": [ + { + "name": "meta", + "description": "", + "type": "Object" + } + ], + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Container-cab901bd09.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Container-cab901bd09.json new file mode 100644 index 000000000..fe2983555 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Container-cab901bd09.json @@ -0,0 +1,175 @@ +{ + "data": { + "id": "ember-4.5.1-Container", + "type": "class", + "attributes": { + "name": "Container", + "shortname": "Container", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 51, + "description": "

A container used to instantiate and cache objects.

\n

Every Container must be associated with a Registry, which is referenced\nto determine the factory and options that should be used to instantiate\nobjects.

\n

The public API for Container is still in flux and should not be considered\nstable.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 110, + "description": "

Given a fullName return a corresponding instance.\n The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter');\ntwitter instanceof Twitter; // => true\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted, an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "TypeOptions", + "optional": true + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 149, + "description": "

A depth first traversal, destroying the container, its descendant containers and all\ntheir managed objects.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "destroy", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 166, + "description": "

Clear either the entire cache or just the cache for a particular key.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "params": [ + { + "name": "fullName", + "description": "optional key to reset; if missing, resets everything", + "type": "String" + } + ], + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 183, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "return": { + "description": "", + "type": "Object" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 196, + "description": "

Given a fullName, return the corresponding factory. The consumer of the factory\nis responsible for the destruction of any factory instances, as there is no\nway for the container to ensure instances are destroyed when it itself is\ndestroyed.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 91, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registry", + "type": "Registry", + "since": "1.11.0", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 98, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "cache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 104, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "validationCache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-ContainerDebugAdapter-b5e02329e3.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-ContainerDebugAdapter-b5e02329e3.json new file mode 100644 index 000000000..705a8cc87 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-ContainerDebugAdapter-b5e02329e3.json @@ -0,0 +1,592 @@ +{ + "data": { + "id": "ember-4.5.1-ContainerDebugAdapter", + "type": "class", + "attributes": { + "name": "ContainerDebugAdapter", + "shortname": "ContainerDebugAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.ts", + "line": 16, + "description": "

The ContainerDebugAdapter helps the container and resolver interface\nwith tools that debug Ember such as the\nEmber Inspector\nfor Chrome and Firefox.

\n

This class can be extended by a custom resolver implementer\nto override some of the methods with library-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • canCatalogEntriesByType
  • \n
  • catalogEntriesByType
  • \n
\n

The adapter will need to be registered\nin the application's container as container-debug-adapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "containerDebugAdapter",\n\n  initialize(application) {\n    application.register('container-debug-adapter:main', require('app/container-debug-adapter'));\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "since": "1.5.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.ts", + "line": 67, + "description": "

Returns true if it is possible to catalog a list of available\nclasses in the resolver for a given type.

\n", + "itemtype": "method", + "name": "canCatalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "whether a list is available for this type.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.ts", + "line": 84, + "description": "

Returns the available classes a given type.

\n", + "itemtype": "method", + "name": "catalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "An array of strings.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.ts", + "line": 57, + "description": "

The resolver instance of the application\nbeing debugged. This property will be injected\non creation.

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-ContainerProxyMixin-e80dfa0a1d.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-ContainerProxyMixin-e80dfa0a1d.json new file mode 100644 index 000000000..4990a8f5b --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-ContainerProxyMixin-e80dfa0a1d.json @@ -0,0 +1,131 @@ +{ + "data": { + "id": "ember-4.5.1-ContainerProxyMixin", + "type": "class", + "attributes": { + "name": "ContainerProxyMixin", + "shortname": "ContainerProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 18, + "description": "

ContainerProxyMixin is used to provide public access to specific\ncontainer functionality.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 38, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "ContainerProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 64, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ContainerProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 125, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ContainerProxyMixin", + "module": "ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 30, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ContainerProxyMixin", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Controller-22f6e8498c.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Controller-22f6e8498c.json new file mode 100644 index 000000000..80ee46974 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Controller-22f6e8498c.json @@ -0,0 +1,724 @@ +{ + "data": { + "id": "ember-4.5.1-Controller", + "type": "class", + "attributes": { + "name": "Controller", + "shortname": "Controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "", + "file": "packages/@ember/controller/index.ts", + "line": 11, + "extends": "EmberObject", + "uses": [ + "Ember.ControllerMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 53, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 74, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 95, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 185, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 171, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 25, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 21, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 41, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 26, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-CoreObject-f282cfa26f.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-CoreObject-f282cfa26f.json new file mode 100644 index 000000000..bdd99953d --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-CoreObject-f282cfa26f.json @@ -0,0 +1,158 @@ +{ + "data": { + "id": "ember-4.5.1-CoreObject", + "type": "class", + "attributes": { + "name": "CoreObject", + "shortname": "CoreObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 174, + "description": "

CoreObject is the base class for all Ember constructs. It establishes a\nclass system based on Ember's Mixin system, and provides the basis for the\nEmber Object Model. CoreObject should generally not be used directly,\ninstead you should use EmberObject.

\n

Usage

\n

You can define a class by extending from CoreObject using the extend\nmethod:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Person = CoreObject.extend({\n  name: 'Tomster',\n});
\n
\n
\n \n

For detailed usage, see the Object Model\nsection of the guides.

\n

Usage with Native Classes

\n

Native JavaScript class syntax can be used to extend from any CoreObject\nbased class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
class Person extends CoreObject {\n  init() {\n    super.init(...arguments);\n    this.name = 'Tomster';\n  }\n}
\n
\n
\n \n

Some notes about class usage:

\n
    \n
  • new syntax is not currently supported with classes that extend from\nEmberObject or CoreObject. You must continue to use the create method\nwhen making new instances of classes, even if they are defined using native\nclass syntax. If you want to use new syntax, consider creating classes\nwhich do not extend from EmberObject or CoreObject. Ember features,\nsuch as computed properties and decorators, will still work with base-less\nclasses.
  • \n
  • Instead of using this._super(), you must use standard super syntax in\nnative classes. See the MDN docs on classes\nfor more details.
  • \n
  • Native classes support using constructors\nto set up newly-created instances. Ember uses these to, among other things,\nsupport features that need to retrieve other entities by name, like Service\ninjection and getOwner. To ensure your custom instance setup logic takes\nplace after this important work is done, avoid using the constructor in\nfavor of init.
  • \n
  • Properties passed to create will be available on the instance by the time\ninit runs, so any code that requires these values should work at that\ntime.
  • \n
  • Using native classes, and switching back to the old Ember Object model is\nfully supported.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.5.1-Helper" + }, + { + "type": "class", + "id": "ember-4.5.1-EmberObject" + } + ] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-DataAdapter-030ae80920.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-DataAdapter-030ae80920.json new file mode 100644 index 000000000..e448c967f --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-DataAdapter-030ae80920.json @@ -0,0 +1,935 @@ +{ + "data": { + "id": "ember-4.5.1-DataAdapter", + "type": "class", + "attributes": { + "name": "DataAdapter", + "shortname": "DataAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 158, + "description": "

The DataAdapter helps a data persistence library\ninterface with tools that debug Ember such\nas the Ember Inspector\nfor Chrome and Firefox.

\n

This class will be extended by a persistence library\nwhich will override some of the methods with\nlibrary-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • getFilters
  • \n
  • detect
  • \n
  • columnsForType
  • \n
  • getRecords
  • \n
  • getRecordColumnValues
  • \n
  • getRecordKeywords
  • \n
  • getRecordFilterValues
  • \n
  • getRecordColor
  • \n
\n

The adapter will need to be registered\nin the application's container as dataAdapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "data-adapter",\n\n  initialize: function(application) {\n    application.register('data-adapter:main', DS.DataAdapter);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 285, + "description": "

Specifies how records can be filtered.\nRecords returned will need to have a filterValues\nproperty with a key for every name in the returned array.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getFilters", + "return": { + "description": "List of objects defining filters.\n The object should have a `name` and `desc` property.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 299, + "description": "

Fetch the model types and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchModelTypes", + "params": [ + { + "name": "typesAdded", + "description": "Callback to call to add types.\nTakes an array of objects containing wrapped types (returned from `wrapModelType`).", + "type": "Function" + }, + { + "name": "typesUpdated", + "description": "Callback to call when a type has changed.\nTakes an array of objects containing wrapped types.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 347, + "description": "

Fetch the records of a given type and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchRecords", + "params": [ + { + "name": "modelName", + "description": "The model name.", + "type": "String" + }, + { + "name": "recordsAdded", + "description": "Callback to call to add records.\nTakes an array of objects containing wrapped records.\nThe object should have the following properties:\n columnValues: {Object} The key and value of a table cell.\n object: {Object} The actual record object.", + "type": "Function" + }, + { + "name": "recordsUpdated", + "description": "Callback to call when a record has changed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + }, + { + "name": "recordsRemoved", + "description": "Callback to call when a record has removed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 419, + "description": "

Clear all observers before destruction

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 437, + "description": "

Detect whether a class is a model.

\n

Test that against the model class\nof your persistence library.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "detect", + "return": { + "description": "boolean Whether the class is a model class or not." + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 451, + "description": "

Get the columns for a given model type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "columnsForType", + "return": { + "description": "An array of columns of the following format:\n name: {String} The name of the column.\n desc: {String} Humanized description (what would show in a table column name).", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 464, + "description": "

Adds observers to a model type class.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "observeModelType", + "params": [ + { + "name": "modelName", + "description": "The model type name.", + "type": "String" + }, + { + "name": "typesUpdated", + "description": "Called when a type is modified.", + "type": "Function" + } + ], + "return": { + "description": "The function to call to remove observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 501, + "description": "

Wraps a given model type and observes changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapModelType", + "params": [ + { + "name": "klass", + "description": "A model class.", + "type": "Class" + }, + { + "name": "modelName", + "description": "Name of the class.", + "type": "String" + } + ], + "return": { + "description": "The wrapped type has the following format:\n name: {String} The name of the type.\n count: {Integer} The number of records available.\n columns: {Columns} An array of columns to describe the record.\n object: {Class} The actual Model type class.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 525, + "description": "

Fetches all models defined in the application.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getModelTypes", + "return": { + "description": "Array of model types.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 550, + "description": "

Loops over all namespaces and all objects\nattached to them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getObjectsOnNamespaces", + "return": { + "description": "Array of model type strings.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 579, + "description": "

Fetches all loaded records for a given type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecords", + "return": { + "description": "An array of records.\n This array will be observed for changes,\n so it should update when new records are added/removed.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 592, + "description": "

Wraps a record and observers changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapRecord", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The wrapped record. Format:\ncolumnValues: {Array}\nsearchKeywords: {Array}", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 612, + "description": "

Gets the values for each column.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColumnValues", + "return": { + "description": "Keys should match column names defined\nby the model type.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 624, + "description": "

Returns keywords to match when searching records.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordKeywords", + "return": { + "description": "Relevant keywords for search.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 635, + "description": "

Returns the values of filters defined by getFilters.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordFilterValues", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The filter values.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 647, + "description": "

Each record can have a color that represents its state.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColor", + "params": [ + { + "name": "record", + "description": "The record instance", + "type": "Object" + } + ], + "return": { + "description": "The records color.\n Possible options: black, red, blue, green.", + "type": "String" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 214, + "description": "

The container-debug-adapter which is used\nto list all models.

\n", + "itemtype": "property", + "name": "containerDebugAdapter", + "default": "undefined", + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 224, + "description": "

The number of attributes to send\nas columns. (Enough to make the record\nidentifiable).

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "attributeLimit", + "default": "3", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 236, + "description": "

Ember Data > v1.0.0-beta.18\nrequires string model names to be passed\naround instead of the actual factories.

\n

This is a stamp for the Ember Inspector\nto differentiate between the versions\nto be able to support older versions too.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "acceptsModelName", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 250, + "description": "

Map from records arrays to RecordsWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "recordsWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 258, + "description": "

Map from records arrays to TypeWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "typeWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 266, + "description": "

Callback that is currently scheduled on backburner end to flush and check\nall active watchers.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "flushWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 276, + "description": "

Stores all methods that clear observers.\nThese methods will be called on destruction.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "releaseMethods", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.ActionHandler-f71a1f1cd0.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.ActionHandler-f71a1f1cd0.json new file mode 100644 index 000000000..2aaa83aa9 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.ActionHandler-f71a1f1cd0.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.5.1-Ember.ActionHandler", + "type": "class", + "attributes": { + "name": "Ember.ActionHandler", + "shortname": "Ember.ActionHandler", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.ControllerMixin", + "Ember.CoreView" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 8, + "description": "

Ember.ActionHandler is available on some familiar classes including\nRoute, Component, and Controller.\n(Internally the mixin is used by Ember.CoreView, Ember.ControllerMixin,\nand Route and available to the above classes through\ninheritance.)

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 171, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 26, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.ControllerMixin-ffe5a19a2d.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.ControllerMixin-ffe5a19a2d.json new file mode 100644 index 000000000..1ca10c2c5 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.ControllerMixin-ffe5a19a2d.json @@ -0,0 +1,223 @@ +{ + "data": { + "id": "ember-4.5.1-Ember.ControllerMixin", + "type": "class", + "attributes": { + "name": "Ember.ControllerMixin", + "shortname": "Ember.ControllerMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Controller" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 11, + "uses": [ + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 53, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 74, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 95, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 185, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 171, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 25, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 21, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.js", + "line": 41, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 26, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.CoreView-f27c5dbab7.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.CoreView-f27c5dbab7.json new file mode 100644 index 000000000..27550596e --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.CoreView-f27c5dbab7.json @@ -0,0 +1,933 @@ +{ + "data": { + "id": "ember-4.5.1-Ember.CoreView", + "type": "class", + "attributes": { + "name": "Ember.CoreView", + "shortname": "Ember.CoreView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 6, + "description": "

Ember.CoreView is an abstract class that exists to give view-like behavior\nto both Ember's main view class Component and other classes that don't need\nthe full functionality of Component.

\n

Unless you have specific needs for CoreView, you will use Component\nin your applications.

\n", + "extends": "EmberObject", + "deprecated": true, + "deprecationMessage": "Use `Component` instead.", + "uses": [ + "Evented", + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 35, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 57, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 77, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 109, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 152, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 161, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 176, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 192, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 208, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 74, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 95, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 121, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 142, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 165, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 180, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 171, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 35, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 26, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.5.1-Component" + } + ] + }, + "module": { + "data": { + "id": "ember-4.5.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.EventDispatcher-b176602c1c.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.EventDispatcher-b176602c1c.json new file mode 100644 index 000000000..f17d02564 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.EventDispatcher-b176602c1c.json @@ -0,0 +1,174 @@ +{ + "data": { + "id": "ember-4.5.1-Ember.EventDispatcher", + "type": "class", + "attributes": { + "name": "Ember.EventDispatcher", + "shortname": "Ember.EventDispatcher", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 19, + "description": "

Ember.EventDispatcher handles delegating browser events to their\ncorresponding Ember.Views. For example, when you click on a view,\nEmber.EventDispatcher ensures that that view's mouseDown method gets\ncalled.

\n", + "access": "private", + "tagname": "", + "extends": "Ember.Object", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 114, + "description": "

Sets up event listeners for standard browser events.

\n

This will be called after the browser sends a DOMContentReady event. By\ndefault, it will set up all of the listeners on the document body. If you\nwould like to register the listeners on a different element, set the event\ndispatcher's root property.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "params": [ + { + "name": "addedEvents", + "description": "", + "type": "Object" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 208, + "description": "

Setup event listeners for the given browser event name

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForBrowserEvent", + "params": [ + { + "name": "event", + "description": "the name of the event in the browser" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 221, + "description": "

Setup event listeners for the given Ember event name (camel case)

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForEmberEvent", + "params": [ + { + "name": "eventName", + "description": "" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 238, + "description": "

Registers an event listener on the rootElement. If the given event is\ntriggered, the provided event handler will be triggered on the target view.

\n

If the target view does not implement the event handler, or if the handler\nreturns false, the parent view will be called. The event will continue to\nbubble to each successive parent view until it reaches the top.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandler", + "params": [ + { + "name": "rootElement", + "description": "", + "type": "Element" + }, + { + "name": "event", + "description": "the name of the event in the browser", + "type": "String" + }, + { + "name": "eventName", + "description": "the name of the method to call on the view", + "type": "String" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/system/action_manager.ts", + "line": 9, + "description": "

Global action id hash.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registeredActions", + "type": "Object", + "class": "Ember.EventDispatcher", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 31, + "description": "

The set of events names (and associated handler function names) to be setup\nand dispatched by the EventDispatcher. Modifications to this list can be done\nat setup time, generally via the Application.customEvents hash.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "events", + "type": "Object", + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 91, + "description": "

The root DOM element to which event listeners should be attached. Event\nlisteners will be attached to the document unless this is overridden.

\n

Can be specified as a DOMElement or a selector string.

\n

The default body is a string since this may be evaluated before document.body\nexists in the DOM.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.Object", + "type": "missing" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.NativeArray-922f241686.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.NativeArray-922f241686.json new file mode 100644 index 000000000..a007a3ea3 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.NativeArray-922f241686.json @@ -0,0 +1,1636 @@ +{ + "data": { + "id": "ember-4.5.1-Ember.NativeArray", + "type": "class", + "attributes": { + "name": "Ember.NativeArray", + "shortname": "Ember.NativeArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1748, + "description": "

The NativeArray mixin contains the properties needed to make the native\nArray support MutableArray and all of its dependent APIs. Unless you\nhave EmberENV.EXTEND_PROTOTYPES or EmberENV.EXTEND_PROTOTYPES.Array set to\nfalse, this will be applied automatically. Otherwise you can apply the mixin\nat anytime by calling Ember.NativeArray.apply(Array.prototype).

\n", + "uses": [ + "Observable", + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1349, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1368, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1394, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1416, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1441, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1461, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1481, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1507, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1532, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1552, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1573, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1592, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1619, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1647, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1664, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1690, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1117, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1155, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1167, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1183, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1216, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1260, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1279, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1301, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.TargetActionSupport-970d8a170f.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.TargetActionSupport-970d8a170f.json new file mode 100644 index 000000000..52aa52f57 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.TargetActionSupport-970d8a170f.json @@ -0,0 +1,101 @@ +{ + "data": { + "id": "ember-4.5.1-Ember.TargetActionSupport", + "type": "class", + "attributes": { + "name": "Ember.TargetActionSupport", + "shortname": "Ember.TargetActionSupport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 10, + "description": "

Ember.TargetActionSupport is a mixin that can be included in a class\nto add a triggerAction method with semantics similar to the Handlebars\n{{action}} helper. In normal Ember usage, the {{action}} helper is\nusually the best choice. This mixin is most often useful when you are\ndoing more complex event handling in Components.

\n", + "extends": "Mixin", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 51, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 431, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Mixin" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-Mixin", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.Templates.components-8533baa263.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.Templates.components-8533baa263.json new file mode 100644 index 000000000..0e6f701b6 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.Templates.components-8533baa263.json @@ -0,0 +1,85 @@ +{ + "data": { + "id": "ember-4.5.1-Ember.Templates.components", + "type": "class", + "attributes": { + "name": "Ember.Templates.components", + "shortname": "Ember.Templates.components", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 66, + "description": "

The Input component lets you create an HTML <input> element.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value="987" />
\n
\n
\n \n

creates an <input> element with type="text" and value set to 987.

\n

Text field

\n

If no type argument is specified, a default of type 'text' is used.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Search:\n<Input @value={{this.searchWord}} />
\n
\n
\n \n

In this example, the initial value in the <input> will be set to the value of\nthis.searchWord. If the user changes the text, the value of this.searchWord will also be\nupdated.

\n

Actions

\n

The Input component takes a number of arguments with callbacks that are invoked in response to\nuser events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-down
  • \n
  • key-press
  • \n
  • key-up
  • \n
\n

These callbacks are passed to Input like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Starting with Ember Octane, we recommend using the {{on}} modifier to call actions\non specific events, such as the input event.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
<label for="input-name">Name:</label>\n<Input\n  @id="input-name"\n  @value={{this.name}}\n  {{on "input" this.validateName}}\n/>
\n
\n
\n \n

The event name (e.g. focusout, input, keydown) always follows the casing\nthat the HTML standard uses.

\n

<input> HTML Attributes to Avoid

\n

In most cases, if you want to pass an attribute to the underlying HTML <input> element, you\ncan pass the attribute directly, just like any other Ember component.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @type="text" size="10" />
\n
\n
\n \n

In this example, the size attribute will be applied to the underlying <input> element in the\noutputted HTML.

\n

However, there are a few attributes where you must use the @ version.

\n
    \n
  • @type: This argument is used to control which Ember component is used under the hood
  • \n
  • @value: The @value argument installs a two-way binding onto the element. If you wanted a\none-way binding, use <input> with the value property and the input event instead.
  • \n
  • @checked (for checkboxes): like @value, the @checked argument installs a two-way binding\nonto the element. If you wanted a one-way binding, use <input type="checkbox"> with\nchecked and the input event instead.
  • \n
\n

Extending TextField

\n

Internally, <Input @type="text" /> creates an instance of TextField, passing arguments from\nthe helper to TextField's create method. Subclassing TextField is supported but not\nrecommended.

\n

See TextField

\n

Checkbox

\n

To create an <input type="checkbox">:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Emberize Everything:\n<Input @type="checkbox" @checked={{this.isEmberized}} name="isEmberized" />
\n
\n
\n \n

This will bind the checked state of this checkbox to the value of isEmberized -- if either one\nchanges, it will be reflected in the other.

\n

Extending Checkbox

\n

Internally, <Input @type="checkbox" /> creates an instance of Checkbox. Subclassing\nTextField is supported but not recommended.

\n

See Checkbox

\n", + "itemtype": "method", + "name": "Input", + "see": [ + "{TextField}", + "{Checkbox}" + ], + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 41, + "description": "

The LinkTo component renders a link to the supplied routeName passing an optionally\nsupplied model to the route as its model context of the route. The block for LinkTo\nbecomes the contents of the rendered element:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

Disabling the LinkTo component

\n

The LinkTo component can be disabled by using the disabled argument. A disabled link\ndoesn't result in a transition when activated, and adds the disabled class to the <a>\nelement.

\n

(The class name to apply to the element can be overridden by using the disabledClass\nargument)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @disabled={{true}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

Handling href

\n

<LinkTo> will use your application's Router to fill the element's href property with a URL\nthat matches the path to the supplied routeName.

\n

Handling current route

\n

The LinkTo component will apply a CSS class name of 'active' when the application's current\nroute matches the supplied routeName. For example, if the application's current route is\n'photoGallery.recent', then the following invocation of LinkTo:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

will result in

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="active">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

The CSS class used for active classes can be customized by passing an activeClass argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent' @activeClass="current-url">\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="current-url">\n  Great Hamster Photos\n</a>
\n
\n
\n \n\n

If you need a link to be 'active' even when it doesn't match the current route, you can use the\ncurrent-when argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @current-when='photos'>\n  Photo Gallery\n</LinkTo>
\n
\n
\n \n

This may be helpful for keeping links active for:

\n
    \n
  • non-nested routes that are logically related
  • \n
  • some secondary menu approaches
  • \n
  • 'top navigation' with 'sub navigation' scenarios
  • \n
\n

A link will be active if current-when is true or the current\nroute is the route this link would transition to.

\n

To match multiple routes 'space-separate' the routes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='gallery' @current-when='photos drawings paintings'>\n  Art Gallery\n</LinkTo>
\n
\n
\n \n

Supplying a model

\n

An optional model argument can be used for routes whose\npaths contain dynamic segments. This argument will become\nthe model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", {path: "hamster-photos/:photo_id"});\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{this.aPhoto}}>\n  {{aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

Supplying multiple models

\n

For deep-linking to route paths that contain multiple\ndynamic segments, the models argument can be used.

\n

As the router transitions through the route path, each\nsupplied model argument will become the context for the\nroute with the dynamic segments:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() {\n    this.route("comment", {path: "comments/:comment_id"});\n  });\n});
\n
\n
\n \n

This argument will become the model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.comment' @models={{array this.aPhoto this.comment}}>\n  {{comment.body}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42/comments/718">\n  A+++ would snuggle again.\n</a>
\n
\n
\n \n

Supplying an explicit dynamic segment value

\n

If you don't have a model object available to pass to LinkTo,\nan optional string or integer argument can be passed for routes whose\npaths contain dynamic segments. This argument will become the value\nof the dynamic segment:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{aPhotoId}}>\n  {{this.aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

When transitioning into the linked route, the model hook will\nbe triggered with parameters including this passed identifier.

\n

Supplying query parameters

\n

If you need to add optional key-value pairs that appear to the right of the ? in a URL,\nyou can use the query argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @query={{hash page=1 per_page=20}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos?page=1&per_page=20">\n  Great Hamster Photos\n</a>
\n
\n
\n \n", + "itemtype": "method", + "name": "LinkTo", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 9, + "description": "

The Textarea component inserts a new instance of <textarea> tag into the template.

\n

The @value argument provides the content of the <textarea>.

\n

This template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value="A bunch of text" />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  A bunch of text\n</textarea>
\n
\n
\n \n

The @value argument is two-way bound. If the user types text into the textarea, the @value\nargument is updated. If the @value argument is updated, the text in the textarea is updated.

\n

In the following example, the writtenWords property on the component will be updated as the user\ntypes 'Lots of text' into the text area of their browser's window.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class WordEditorComponent extends Component {\n  @tracked writtenWords = "Lots of text that IS bound";\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{writtenWords}} />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  Lots of text that IS bound\n</textarea>
\n
\n
\n \n

If you wanted a one way binding, you could use the <textarea> element directly, and use the\nvalue DOM property and the input event.

\n

Actions

\n

The Textarea component takes a number of arguments with callbacks that are invoked in\nresponse to user events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-press
  • \n
\n

These callbacks are passed to Textarea like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Classic Invocation Syntax

\n

The Textarea component can also be invoked using curly braces, just like any other Ember\ncomponent.

\n

For example, this is an invocation using angle-bracket notation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

You could accomplish the same thing using classic invocation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{textarea value=this.searchWord enter=this.query}}
\n
\n
\n \n

The main difference is that angle-bracket invocation supports any HTML attribute using HTML\nattribute syntax, because attributes and arguments have different syntax when using angle-bracket\ninvocation. Curly brace invocation, on the other hand, only has a single syntax for arguments,\nand components must manually map attributes onto component arguments.

\n

When using classic invocation with {{textarea}}, only the following attributes are mapped onto\narguments:

\n
    \n
  • rows
  • \n
  • cols
  • \n
  • name
  • \n
  • selectionEnd
  • \n
  • selectionStart
  • \n
  • autocomplete
  • \n
  • wrap
  • \n
  • lang
  • \n
  • dir
  • \n
  • value
  • \n
\n

Classic layout and layoutName properties

\n

Because HTML textarea elements do not contain inner HTML the layout and\nlayoutName properties will not be applied.

\n", + "itemtype": "method", + "name": "Textarea", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.Templates.helpers-27af8be267.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.Templates.helpers-27af8be267.json new file mode 100644 index 000000000..f3c569bb1 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.Templates.helpers-27af8be267.json @@ -0,0 +1,484 @@ +{ + "data": { + "id": "ember-4.5.1-Ember.Templates.helpers", + "type": "class", + "attributes": { + "name": "Ember.Templates.helpers", + "shortname": "Ember.Templates.helpers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 86, + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 45, + "description": "

See Ember.Templates.components.Input.

\n", + "itemtype": "method", + "name": "input", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 253, + "description": "

See Ember.Templates.components.LinkTo.

\n", + "itemtype": "method", + "name": "link-to", + "see": [ + "{Ember.Templates.components.LinkTo}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 122, + "description": "

See Ember.Templates.components.Textarea.

\n", + "itemtype": "method", + "name": "textarea", + "see": [ + "{Ember.Templates.components.Textarea}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/action.ts", + "line": 23, + "description": "

The {{action}} helper provides a way to pass triggers for behavior (usually\njust a function) between components, and into components from controllers.

\n

Passing functions with the action helper

\n

There are three contexts an action helper can be used in. The first two\ncontexts to discuss are attribute context, and Handlebars value context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>\n{{! Examples of Handlebars value context }}\n{{input on-input=(action "save")}}\n{{yield (action "refreshData") andAnotherParam}}
\n
\n
\n \n

In these contexts,\nthe helper is called a "closure action" helper. Its behavior is simple:\nIf passed a function name, read that function off the actions property\nof the current context. Once that function is read, or immediately if a function was\npassed, create a closure over that function and any arguments.\nThe resulting value of an action helper used this way is simply a function.

\n

For example, in the attribute context:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>
\n
\n
\n \n

The resulting template render logic would be:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
var div = document.createElement('div');\nvar actionFunction = (function(context){\n  return function() {\n    return context.actions.save.apply(context, arguments);\n  };\n})(context);\ndiv.onclick = actionFunction;
\n
\n
\n \n

Thus when the div is clicked, the action on that context is called.\nBecause the actionFunction is just a function, closure actions can be\npassed between components and still execute in the correct context.

\n

Here is an example action handler on a component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  save() {\n    this.model.save();\n  }\n}
\n
\n
\n \n

Actions are always looked up on the actions property of the current context.\nThis avoids collisions in the naming of common actions, such as destroy.\nTwo options can be passed to the action helper when it is used in this way.

\n
    \n
  • target=someProperty will look to someProperty instead of the current\ncontext for the actions hash. This can be useful when targeting a\nservice for actions.
  • \n
  • value="target.value" will read the path target.value off the first\nargument to the action when it is called and rewrite the first argument\nto be that value. This is useful when attaching actions to event listeners.
  • \n
\n

Invoking an action

\n

Closure actions curry both their scope and any arguments. When invoked, any\nadditional arguments are added to the already curried list.\nActions are presented in JavaScript as callbacks, and are\ninvoked like any other JavaScript function.

\n

For example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.hbs
1\n
{{input on-input=(action (action 'setName' @model) value="target.value")}}
\n
\n
\n \n

The first argument (@model) was curried over, and the run-time argument (event)\nbecomes a second argument. Action calls can be nested this way because each simply\nreturns a function. Any function can be passed to the {{action}} helper, including\nother actions.

\n

Actions invoked with sendAction have the same currying behavior as demonstrated\nwith on-input above. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyInput @submit={{action 'setName' @model}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-input submit=(action 'setName' @model)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    // Note that model is not passed, it was curried in the template\n    this.submit('bob');\n  }\n});
\n
\n
\n \n

Attaching actions to DOM elements

\n

The third context of the {{action}} helper can be called "element space".\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of element space }}\n<div {{action "save"}}></div>
\n
\n
\n \n

Used this way, the {{action}} helper provides a useful shortcut for\nregistering an HTML element in a template for a single DOM event and\nforwarding that interaction to the template's context (controller or component).\nIf the context of a template is a controller, actions used this way will\nbubble to routes when the controller does not implement the specified action.\nOnce an action hits a route, it will bubble through the route hierarchy.

\n

Event Propagation

\n

{{action}} helpers called in element space can control event bubbling. Note\nthat the closure style actions cannot.

\n

Events triggered through the action helper will automatically have\n.preventDefault() called on them. You do not need to do so in your event\nhandlers. If you need to allow event propagation (to handle file inputs for\nexample) you can supply the preventDefault=false option to the {{action}} helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<div {{action "sayHello" preventDefault=false}}>\n  <input type="file" />\n  <input type="checkbox" />\n</div>
\n
\n
\n \n

To disable bubbling, pass bubbles=false to the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<button {{action 'edit' post bubbles=false}}>Edit</button>
\n
\n
\n \n

To disable bubbling with closure style actions you must create your own\nwrapper helper that makes use of event.stopPropagation():

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div onclick={{disable-bubbling (action "sayHello")}}>Hello</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
bubbling.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { helper } from '@ember/component/helper';\n\nexport function disableBubbling([action]) {\n  return function(event) {\n    event.stopPropagation();\n    return action(event);\n  };\n}\nexport default helper(disableBubbling);
\n
\n
\n \n

If you need the default handler to trigger you should either register your\nown event handler, or use event methods on your view class. See\n"Responding to Browser Events"\nin the documentation for Component for more information.

\n

Specifying DOM event type

\n

{{action}} helpers called in element space can specify an event type.\nBy default the {{action}} helper registers for DOM click events. You can\nsupply an on option to the helper to specify a different DOM event name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" on="doubleClick"}}>\n  click me\n</div>
\n
\n
\n \n

See "Event Names" for a list of\nacceptable DOM event names.

\n

Specifying whitelisted modifier keys

\n

{{action}} helpers called in element space can specify modifier keys.\nBy default the {{action}} helper will ignore click events with pressed modifier\nkeys. You can supply an allowedKeys option to specify which keys should not be ignored.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="alt"}}>\n  click me\n</div>
\n
\n
\n \n

This way the action will fire when clicking with the alt key pressed down.\nAlternatively, supply "any" to the allowedKeys option to accept any combination of modifier keys.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="any"}}>\n  click me with any key pressed\n</div>
\n
\n
\n \n

Specifying a Target

\n

A target option can be provided to the helper to change\nwhich object will receive the method call. This option must be a path\nto an object, accessible in the current context:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<div {{action "anActionName" target=someService}}>\n  click me\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n
import Controller from '@ember/controller';\nimport { service } from '@ember/service';\n\nexport default class extends Controller {\n  @service someService;\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "action", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/array.ts", + "line": 5, + "description": "

Use the {{array}} helper to create an array to pass as an option to your\ncomponents.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<MyComponent @people={{array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson}}\n/>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{my-component people=(array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson)\n}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Tom Dale', 'Yehuda Katz', this.get('myOtherPerson')]
\n
\n
\n \n

Where the 3rd item in the array is bound to updates of the myOtherPerson property.

\n", + "itemtype": "method", + "name": "array", + "params": [ + { + "name": "options", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "Array", + "type": "Array" + }, + "since": "3.8.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/component.ts", + "line": 5, + "description": "

The {{component}} helper lets you add instances of Component to a\ntemplate. See Component for\nadditional information on how a Component functions.\n{{component}}'s primary use is for cases where you want to dynamically\nchange which type of component is rendered as the state of your application\nchanges. This helper has three modes: inline, block, and nested.

\n

Inline Form

\n

Given the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/application.hbs
1\n
{{component this.infographicComponentName}}
\n
\n
\n \n

And the following application code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Controller from '@ember/controller';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

The live-updating-chart component will be appended when isMarketOpen is\ntrue, and the market-close-summary component will be appended when\nisMarketOpen is false. If the value changes while the app is running,\nthe component will be automatically swapped out accordingly.\nNote: You should not use this helper when you are consistently rendering the same\ncomponent. In that case, use standard component syntax, for example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LiveUpdatingChart />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{live-updating-chart}}
\n
\n
\n \n

Block Form

\n

Using the block form of this helper is similar to using the block form\nof a component. Given the following application template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
{{#component this.infographicComponentName}}\n  Last update: {{this.lastUpdateTimestamp}}\n{{/component}}
\n
\n
\n \n

The following controller code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Controller from '@ember/controller';\nimport { computed } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get lastUpdateTimestamp() {\n    return new Date();\n  }\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

And the following component template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
chart.hbs
1\n2\n
{{! chart }}\n{{yield}}
\n
\n
\n \n

The Last Update: {{this.lastUpdateTimestamp}} will be rendered in place of the {{yield}}.

\n

Nested Usage

\n

The component helper can be used to package a component path with initial attrs.\nThe included attrs can then be merged during the final invocation.\nFor example, given a person-form component with the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.hbs
1\n2\n3\n
{{yield (hash\n  nameInput=(component "my-input-component" value=@model.name placeholder="First Name")\n)}}
\n
\n
\n \n

When yielding the component via the hash helper, the component is invoked directly.\nSee the following snippet:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonForm as |form|>\n  <form.nameInput @placeholder="Username" />\n</PersonForm>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-form as |form|}}\n  {{form.nameInput placeholder="Username"}}\n{{/person-form}}
\n
\n
\n \n

Which outputs an input whose value is already bound to model.name and placeholder\nis "Username".

\n

When yielding the component without the hash helper use the component helper.\nFor example, below is a full-name component template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{yield (component "my-input-component" value=@model.name placeholder="Name")}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<FullName as |field|>\n  {{component field placeholder="Full name"}}\n</FullName>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#full-name as |field|}}\n  {{component field placeholder="Full name"}}\n{{/full-name}}
\n
\n
\n \n", + "itemtype": "method", + "name": "component", + "since": "1.11.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/concat.ts", + "line": 5, + "description": "

Concatenates the given arguments into a string.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{some-component name=(concat firstName " " lastName)}}\n\n{{! would pass name="<first name value> <last name value>" to the component}}
\n
\n
\n \n

or for angle bracket invocation, you actually don't need concat at all.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @name="{{firstName}} {{lastName}}" />
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "concat", + "since": "1.13.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 13, + "description": "

The {{#each}} helper loops over elements in a collection. It is an extension\nof the base Handlebars {{#each}} helper.

\n

The default behavior of {{#each}} is to yield its inner block once for every\nitem in an array passing the item as the first block parameter.

\n

Assuming the @developers argument contains this array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
[{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }];
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

The same rules apply to arrays of primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Yehuda', 'Tom', 'Paul']
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developerNames as |name|}}\n    <li>Hello, {{name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

During iteration, the index of each item in the array is provided as a second block\nparameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person index|}}\n    <li>Hello, {{person.name}}! You're number {{index}} in line</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

Specifying Keys

\n

In order to improve rendering speed, Ember will try to reuse the DOM elements\nwhere possible. Specifically, if the same item is present in the array both\nbefore and after the change, its DOM output will be reused.

\n

The key option is used to tell Ember how to determine if the items in the\narray being iterated over with {{#each}} has changed between renders. By\ndefault the item's object identity is used.

\n

This is usually sufficient, so in most cases, the key option is simply not\nneeded. However, in some rare cases, the objects' identities may change even\nthough they represent the same underlying data.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
people.map(person => {\n  return { ...person, type: 'developer' };\n});
\n
\n
\n \n

In this case, each time the people array is map-ed over, it will produce\nan new array with completely different objects between renders. In these cases,\nyou can help Ember determine how these objects related to each other with the\nkey option:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers key="name" as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

By doing so, Ember will use the value of the property specified (person.name\nin the example) to find a "match" from the previous render. That is, if Ember\nhas previously seen an object from the @developers array with a matching\nname, its DOM elements will be re-used.

\n

There are two special values for key:

\n
    \n
  • @index - The index of the item in the array.
  • \n
  • @identity - The item in the array itself.
  • \n
\n

{{else}} condition

\n

{{#each}} can have a matching {{else}}. The contents of this block will render\nif the collection is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<ul>\n  {{#each @developers as |person|}}\n    <li>{{person.name}} is available!</li>\n  {{else}}\n    <li>Sorry, nobody is available for this task.</li>\n  {{/each}}\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 124, + "description": "

The {{each-in}} helper loops over properties on an object.

\n

For example, given this component definition:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    "name": "Shelly Sails",\n    "age": 42\n  };\n}
\n
\n
\n \n

This template would display all properties on the developer\nobject in a list:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.hbs
1\n2\n3\n4\n5\n
<ul>\n  {{#each-in this.developer as |key value|}}\n    <li>{{key}}: {{value}}</li>\n  {{/each-in}}\n</ul>
\n
\n
\n \n

Outputting their name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<ul>\n  <li>name: Shelly Sails</li>\n  <li>age: 42</li>\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each-in", + "access": "public", + "tagname": "", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/fn.ts", + "line": 5, + "description": "

The fn helper allows you to ensure a function that you are passing off\nto another component, helper, or modifier has access to arguments that are\navailable in the template.

\n

For example, if you have an each helper looping over a number of items, you\nmay need to pass a function that expects to receive the item as an argument\nto a component invoked within the loop. Here's how you could use the fn\nhelper to pass both the function and its arguments together:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
listing.hbs
1\n2\n3\n
{{#each @items as |item|}}\n<DisplayItem @item=item @select={{fn this.handleSelected item}} />\n{{/each}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class ItemsList extends Component {\n  @action\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this case the display-item component will receive a normal function\nthat it can invoke. When it invokes the function, the handleSelected\nfunction will receive the item and any arguments passed, thanks to the\nfn helper.

\n

Let's take look at what that means in a couple circumstances:

\n
    \n
  • When invoked as this.args.select() the handleSelected function will\nreceive the item from the loop as its first and only argument.
  • \n
  • When invoked as this.args.select('foo') the handleSelected function\nwill receive the item from the loop as its first argument and the\nstring 'foo' as its second argument.
  • \n
\n

In the example above, we used @action to ensure that handleSelected is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class ItemsList extends Component {\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when handleSelected is invoked inside the display-item\ncomponent, it will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into fn!

\n

See also partial application.

\n", + "itemtype": "method", + "name": "fn", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/get.ts", + "line": 5, + "description": "

Dynamically look up a property on an object or an element in an array.\nThe second argument to {{get}} should have a string or number value,\nalthough it can be bound.

\n

For example, these two usages are equivalent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{this.developer.name}}\n{{get this.developer "name"}}
\n
\n
\n \n

If there were several facts about a person, the {{get}} helper can dynamically\npick one:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<DeveloperDetail @factName="language" />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.developer @factName}}
\n
\n
\n \n

For a more complex example, this template would allow the user to switch\nbetween showing the user's name and preferred coding language with a click:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n\n  @tracked currentFact = 'name'\n\n  @action\n  showFact(fact) {\n    this.currentFact = fact;\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
{{get this.developer this.currentFact}}\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

The {{get}} helper can also respect mutable values itself. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
<Input @value={{mut (get this.person this.currentFact)}} />\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

Would allow the user to swap what fact is being displayed, and also edit\nthat fact via a two-way mutable binding.

\n

The {{get}} helper can also be used for array element access via index.\nThis would display the value of the first element in the array this.names:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names 0}}
\n
\n
\n \n

Array element access also works with a dynamic second argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names @index}}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "get", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/hash.ts", + "line": 5, + "description": "

Use the {{hash}} helper to create a hash to pass as an option to your\ncomponents. This is specially useful for contextual components where you can\njust yield a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{yield (hash\n   name='Sarah'\n   title=office\n)}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ name: 'Sarah', title: this.get('office') }
\n
\n
\n \n

Where the title is bound to updates of the office property.

\n

Note that the hash is an empty object with no prototype chain, therefore\ncommon methods like toString are not available in the resulting hash.\nIf you need to use such a method, you can use the call or apply\napproach:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
function toString(obj) {\n  return Object.prototype.toString.apply(obj);\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "Hash", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 5, + "description": "

The if helper allows you to conditionally render one of two branches,\ndepending on the "truthiness" of a property.\nFor example the following values are all falsey: false, undefined, null, "", 0, NaN or an empty array.

\n

This helper has two forms, block and inline.

\n

Block form

\n

You can use the block form of if to conditionally render a section of the template.

\n

To use it, pass the conditional value to the if helper,\nusing the block form to wrap the section of template you want to conditionally render.\nLike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n
{{! will not render because greeting is undefined}}\n{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{/if}}
\n
\n
\n \n

You can also define what to show if the property is falsey by using\nthe else helper.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n
{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{else}}\n  No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

You are also able to combine else and if helpers to create more complex\nconditional logic.

\n

For the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if @isRaining}}\n Yes, grab an umbrella!\n{{else if @isCold}}\n Grab a coat, it's chilly!\n{{else}}\n No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

If you call it by saying isCold is true:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather @isCold={{true}} />
\n
\n
\n \n

Then Grab a coat, it's chilly! will be rendered.

\n

Inline form

\n

The inline if helper conditionally renders a single property or string.

\n

In this form, the if helper receives three arguments, the conditional value,\nthe value to render when truthy, and the value to render when falsey.

\n

For example, if useLongGreeting is truthy, the following:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{true}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{if @useLongGreeting "Hello" "Hi"}} Alex
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hello Alex
\n
\n
\n \n

One detail to keep in mind is that both branches of the if helper will be evaluated,\nso if you have {{if condition "foo" (expensive-operation "bar"),\nexpensive-operation will always calculate.

\n", + "itemtype": "method", + "name": "if", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 97, + "description": "

The unless helper is the inverse of the if helper. It displays if a value\nis falsey ("not true" or "is false"). Example values that will display with\nunless: false, undefined, null, "", 0, NaN or an empty array.

\n

Inline form

\n

The inline unless helper conditionally renders a single property or string.\nThis helper acts like a ternary operator. If the first property is falsy,\nthe second argument will be displayed, otherwise, the third argument will be\ndisplayed

\n

For example, if you pass a falsey useLongGreeting to the Greeting component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{false}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{unless @useLongGreeting "Hi" "Hello"}} Ben
\n
\n
\n \n

Then it will display:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hi Ben
\n
\n
\n \n

Block form

\n

Like the if helper, the unless helper also has a block form.

\n

The following will not render anything:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n2\n3\n
{{#unless @greeting}}\n  No greeting was found. Why not set one?\n{{/unless}}
\n
\n
\n \n

You can also use an else helper with the unless block. The\nelse will display if the value is truthy.

\n

If you have the following component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
in.hbs
1\n2\n3\n4\n5\n
{{#unless @userData}}\n  Please login.\n{{else}}\n  Welcome back!\n{{/unless}}
\n
\n
\n \n

Calling it with a truthy userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{hash username="Zoey"}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Welcome back!
\n
\n
\n \n

and calling it with a falsey userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{false}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Please login.
\n
\n
\n \n", + "itemtype": "method", + "name": "unless", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/log.ts", + "line": 5, + "description": "

log allows you to output the value of variables in the current rendering\ncontext. log also accepts primitive types such as strings or numbers.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{log "myVariable:" myVariable }}
\n
\n
\n \n", + "itemtype": "method", + "name": "log", + "params": [ + { + "name": "params", + "description": "", + "type": "Array" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/mut.ts", + "line": 9, + "description": "

The mut helper lets you clearly specify that a child Component can update the\n(mutable) value passed to it, which will change the value of the parent component.

\n

To specify that a parameter is mutable, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{fn (mut totalClicks)}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(mut totalClicks)}}
\n
\n
\n \n

The child Component can then modify the parent's value just by modifying its own\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

Note that for curly components ({{my-component}}) the bindings are already mutable,\nmaking the mut unnecessary.

\n

Additionally, the mut helper can be combined with the fn helper to\nmutate a value. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=totalClicks click-count-change=(fn (mut totalClicks))}}
\n
\n
\n \n

The child Component would invoke the function with the new click value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.get('click-count-change')(this.get('childClickCount') + 1);\n  }\n});
\n
\n
\n \n

The mut helper changes the totalClicks value to what was provided as the fn argument.

\n

The mut helper, when used with fn, will return a function that\nsets the value passed to mut to its first argument. As an example, we can create a\nbutton that increments a value passing the value directly to the fn:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{! inc helper is not provided by Ember }}\n<button onclick={{fn (mut count) (inc count)}}>\n  Increment count\n</button>
\n
\n
\n \n", + "itemtype": "method", + "name": "mut", + "params": [ + { + "name": "attr", + "description": "the \"two-way\" attribute that can be modified.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/page-title.ts", + "line": 5, + "description": "

page-title allows you to set the title of any page in your application and\nappend additional titles for each route. For complete documentation, see\nhttps://github.com/ember-cli/ember-page-title.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{page-title "My Page Title" }}
\n
\n
\n \n", + "itemtype": "method", + "name": "page-title", + "params": [ + { + "name": "param", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/readonly.ts", + "line": 9, + "description": "

The readonly helper let's you specify that a binding is one-way only,\ninstead of two-way.\nWhen you pass a readonly binding from an outer context (e.g. parent component),\nto to an inner context (e.g. child component), you are saying that changing that\nproperty in the inner context does not change the value in the outer context.

\n

To specify that a binding is read-only, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n
export default Component.extend({\n  totalClicks: 3\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} // -> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Now, when you update childClickCount:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n
export default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

The value updates in the child component, but not the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClickCount}} //-> 4
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Objects and Arrays

\n

When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string),\nonly the reference to the object is protected using the readonly helper.\nThis means that you can change properties of the object both on the parent component, as well as the child component.\nThe readonly binding behaves similar to the const keyword in JavaScript.

\n

Let's look at an example:

\n

First let's set up the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  clicks: null,\n\n  init() {\n    this._super(...arguments);\n    this.set('clicks', { total: 3 });\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n

Now, if you update the total property of childClicks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    this.get('clicks').incrementProperty('total');\n  }\n});
\n
\n
\n \n

You will see the following happen:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClicks.total}} //-> 4
\n
\n
\n \n", + "itemtype": "method", + "name": "readonly", + "params": [ + { + "name": "attr", + "description": "the read-only attribute.", + "type": "Object", + "optional": true + } + ], + "access": "private", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unbound.ts", + "line": 10, + "description": "

The {{unbound}} helper disconnects the one-way binding of a property,\nessentially freezing its value at the moment of rendering. For example,\nin this example the display of the variable name will not change even\nif it is set with a new value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{unbound this.name}}
\n
\n
\n \n

Like any helper, the unbound helper can accept a nested helper expression.\nThis allows for custom helpers to be rendered unbound:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{unbound (some-custom-helper)}}\n{{unbound (capitalize this.name)}}\n{{! You can use any helper, including unbound, in a nested expression }}\n{{capitalize (unbound this.name)}}
\n
\n
\n \n

The unbound helper only accepts a single argument, and it return an\nunbound value.

\n", + "itemtype": "method", + "name": "unbound", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts", + "line": 5, + "description": "

Use the {{unique-id}} helper to generate a unique ID string suitable for use as\nan ID attribute in the DOM.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id={{unique-id}} type="email" />
\n
\n
\n \n

Each 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#let (unique-id) as |emailId|}}\n  <label for={{emailId}}>Email address</label>\n  <input id={{emailId}} type="email" />\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "unique-id", + "since": "4.4.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/modifiers/on.ts", + "line": 5, + "description": "

The {{on}} modifier lets you easily add event listeners (it uses\nEventTarget.addEventListener\ninternally).

\n

For example, if you'd like to run a function on your component when a <button>\nin the components template is clicked you might do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' this.saveLike}}>Like this post!</button>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class LikePostComponent extends Component {\n  @action\n  saveLike() {\n    // someone likes your post!\n    // better send a request off to your server...\n  }\n}
\n
\n
\n \n

Arguments

\n

{{on}} accepts two positional arguments, and a few named arguments.

\n

The positional arguments are:

\n
    \n
  • event -- the name to use when calling addEventListener
  • \n
  • callback -- the function to be passed to addEventListener
  • \n
\n

The named arguments are:

\n
    \n
  • capture -- a true value indicates that events of this type will be dispatched\nto the registered listener before being dispatched to any EventTarget beneath it\nin the DOM tree.
  • \n
  • once -- indicates that the listener should be invoked at most once after being\nadded. If true, the listener would be automatically removed when invoked.
  • \n
  • passive -- if true, indicates that the function specified by listener will never\ncall preventDefault(). If a passive listener does call preventDefault(), the user\nagent will do nothing other than generate a console warning. See\nImproving scrolling performance with passive listeners\nto learn more.
  • \n
\n

The callback function passed to {{on}} will receive any arguments that are passed\nto the event handler. Most commonly this would be the event itself.

\n

If you would like to pass additional arguments to the function you should use\nthe {{fn}} helper.

\n

For example, in our example case above if you'd like to pass in the post that\nwas being liked when the button is clicked you could do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' (fn this.saveLike @post)}}>Like this post!</button>
\n
\n
\n \n

In this case, the saveLike function will receive two arguments: the click event\nand the value of @post.

\n

Function Context

\n

In the example above, we used @action to ensure that likePost is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class LikePostComponent extends Component {\n  saveLike() {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when the button is clicked saveLike will be invoked,\nit will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into on!

\n", + "itemtype": "method", + "name": "on", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/in-element.ts", + "line": 5, + "description": "

The in-element helper renders its block content outside of the regular flow,\ninto a DOM element given by its destinationElement positional argument.

\n

Common use cases - often referred to as "portals" or "wormholes" - are rendering\ndropdowns, modals or tooltips close to the root of the page to bypass CSS overflow\nrules, or to render content to parts of the page that are outside of the control\nof the Ember app itself (e.g. embedded into a static or server rendered HTML page).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#in-element this.destinationElement}}\n  <div>Some content</div>\n{{/in-element}}
\n
\n
\n \n

Arguments

\n

{{in-element}} requires a single positional argument:

\n
    \n
  • destinationElement -- the DOM element to render into. It must exist at the time\nof rendering.
  • \n
\n

It also supports an optional named argument:

\n
    \n
  • insertBefore -- by default the DOM element's content is replaced when used as\ndestinationElement. Passing null changes the behaviour to appended at the end\nof any existing content. Any other value than null is currently not supported.
  • \n
\n", + "itemtype": "method", + "name": "in-element", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/let.ts", + "line": 5, + "description": "

The let helper receives one or more positional arguments and yields\nthem out as block params.

\n

This allows the developer to introduce shorter names for certain computations\nin the template.

\n

This is especially useful if you are passing properties to a component\nthat receives a lot of options and you want to clean up the invocation.

\n

For the following example, the template receives a post object with\ncontent and title properties.

\n

We are going to call the my-post component, passing a title which is\nthe title of the post suffixed with the name of the blog, the content\nof the post, and a series of options defined in-place.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n    (concat post.title ' | The Ember.js Blog')\n    post.content\n    (hash\n      theme="high-contrast"\n      enableComments=true\n    )\n    as |title content options|\n}}\n  <MyPost @title={{title}} @content={{content}} @options={{options}} />\n{{/let}}
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n  (concat post.title ' | The Ember.js Blog')\n  post.content\n  (hash\n    theme="high-contrast"\n    enableComments=true\n  )\n  as |title content options|\n}}\n{{my-post title=title content=content options=options}}\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "let", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/mount.ts", + "line": 13, + "description": "

The {{mount}} helper lets you embed a routeless engine in a template.\nMounting an engine will cause an instance to be booted and its application\ntemplate to be rendered.

\n

For example, the following template mounts the ember-chat engine:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! application.hbs }}\n{{mount "ember-chat"}}
\n
\n
\n \n

Additionally, you can also pass in a model argument that will be\nset as the engines model. This can be an existing object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div>\n  {{mount 'admin' model=userSettings}}\n</div>
\n
\n
\n \n

Or an inline hash, and you can even pass components:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>\n  <h1>Application template!</h1>\n  {{mount 'admin' model=(hash\n      title='Secret Admin'\n      signInButton=(component 'sign-in-button')\n  )}}\n</div>
\n
\n
\n \n", + "itemtype": "method", + "name": "mount", + "params": [ + { + "name": "name", + "description": "Name of the engine to mount.", + "type": "String" + }, + { + "name": "model", + "description": "Object that will be set as\n the model of the engine.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/outlet.ts", + "line": 19, + "description": "

The {{outlet}} helper lets you specify where a child route will render in\nyour template. An important use of the {{outlet}} helper is in your\napplication's application.hbs file:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n7\n8\n
<MyHeader />\n\n<div class="my-dynamic-content">\n  <!-- this content will change based on the current route, which depends on the current URL -->\n  {{outlet}}\n</div>\n\n<MyFooter />
\n
\n
\n \n

See the routing guide for more\ninformation on how your route interacts with the {{outlet}} helper.\nNote: Your content will not render if there isn't an {{outlet}} for it.

\n", + "itemtype": "method", + "name": "outlet", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 91, + "description": "

{{yield}} denotes an area of a template that will be rendered inside\nof another template.

\n

Use with Component

\n

When designing components {{yield}} is used to denote where, inside the component's\ntemplate, an optional block passed to the component should render:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<LabeledTextfield @value={{@model.name}}>\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<label>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n

Additionally you can yield properties into the context for use by the consumer:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n
<LabeledTextfield @value={{@model.validation}} @validator={{this.firstNameValidator}} as |validationError|>\n  {{#if validationError}}\n    <p class="error">{{validationError}}</p>\n  {{/if}}\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield this.validationError}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<label>\n  <p class="error">First Name must be at least 3 characters long.</p>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n", + "itemtype": "method", + "name": "yield", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "return": { + "description": "HTML string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 152, + "description": "

{{(has-block)}} indicates if the component was invoked with a block.

\n

This component is invoked with a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component}}
\n
\n
\n \n

Using angle bracket invocation, this looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent>Hi Jen!</MyComponent> {{! with a block}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent/> {{! without a block}}
\n
\n
\n \n

This is useful when you want to create a component that can optionally take a block\nand then render a default template when it is not invoked with a block.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n
{{#if (has-block)}}\n  Welcome {{yield}}, we are happy you're here!\n{{else}}\n  Hey you! You're great!\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with a block", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 197, + "description": "

{{(has-block-params)}} indicates if the component was invoked with block params.

\n

This component is invoked with block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component as |favoriteFlavor|}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jenn!\n{{/my-component}}
\n
\n
\n \n

With angle bracket syntax, block params look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent as |favoriteFlavor|>\nHi Jen!\n</MyComponent>
\n
\n
\n \n

And without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent>\n  Hi Jen!\n</MyComponent>
\n
\n
\n \n

This is useful when you want to create a component that can render itself\ndifferently when it is not invoked with block params.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if (has-block-params)}}\n  Welcome {{yield this.favoriteFlavor}}, we're happy you're here and hope you\n  enjoy your favorite ice cream flavor.\n{{else}}\n  Welcome {{yield}}, we're happy you're here, but we're unsure what\n  flavor ice cream you would enjoy.\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block-params", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with block params", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 252, + "description": "

Execute the debugger statement in the current template's context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{debugger}}
\n
\n
\n \n

When using the debugger helper you will have access to a get function. This\nfunction retrieves values available in the context of the template.\nFor example, if you're wondering why a value {{foo}} isn't rendering as\nexpected within a template, you could place a {{debugger}} statement and,\nwhen the debugger; breakpoint is hit, you can attempt to retrieve this value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('foo')
\n
\n
\n \n

get is also aware of keywords. So in this situation

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#each this.items as |item|}}\n  {{debugger}}\n{{/each}}
\n
\n
\n \n

You'll be able to get values from the current item:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('item.name')
\n
\n
\n \n

You can also access the context of the view to make sure it is the object that\nyou expect:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> context
\n
\n
\n \n", + "itemtype": "method", + "name": "debugger", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.Test-0b11c0e92a.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.Test-0b11c0e92a.json new file mode 100644 index 000000000..29624c0ac --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.Test-0b11c0e92a.json @@ -0,0 +1,147 @@ +{ + "data": { + "id": "ember-4.5.1-Ember.Test", + "type": "class", + "attributes": { + "name": "Ember.Test", + "shortname": "Ember.Test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/ember-testing/lib/test.js", + "line": 11, + "description": "

This is a container for an assortment of testing related functionality:

\n
    \n
  • Choose your default test adapter (for your framework of choice).
  • \n
  • Register/Unregister additional test helpers.
  • \n
  • Setup callbacks to be fired when the test helpers are injected into\nyour application.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/ember-testing/lib/test/on_inject_helpers.js", + "line": 3, + "description": "

Used to register callbacks to be fired whenever App.injectTestHelpers\nis called.

\n

The callback will receive the current application as an argument.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import $ from 'jquery';\n\nEmber.Test.onInjectHelpers(function() {\n  $(document).ajaxSend(function() {\n    Test.pendingRequests++;\n  });\n\n  $(document).ajaxComplete(function() {\n    Test.pendingRequests--;\n  });\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "onInjectHelpers", + "params": [ + { + "name": "callback", + "description": "The function to be called.", + "type": "Function" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.js", + "line": 21, + "description": "

This returns a thenable tailored for testing. It catches failed\nonSuccess callbacks and invokes the Ember.Test.adapter.exception\ncallback in the last chained then.

\n

This method should be returned by async helpers such as wait.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "promise", + "params": [ + { + "name": "resolver", + "description": "The function used to resolve the promise.", + "type": "Function" + }, + { + "name": "label", + "description": "An optional string for identifying the promise.", + "type": "String" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.js", + "line": 39, + "description": "

Replacement for Ember.RSVP.resolve\nThe only difference is this uses\nan instance of Ember.Test.Promise

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "The", + "description": "value to resolve", + "type": "Mixed" + } + ], + "since": "1.2.0", + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/setup_for_testing.js", + "line": 8, + "description": "

Sets Ember up for testing. This is useful to perform\nbasic setup steps in order to unit test.

\n

Use App.setupForTesting to perform integration tests (full\napplication testing).

\n", + "itemtype": "method", + "name": "setupForTesting", + "since": "1.5.0", + "access": "private", + "tagname": "", + "class": "Ember.Test", + "module": "@ember/test", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/test.js", + "line": 24, + "description": "

Hash containing all known test helpers.

\n", + "itemtype": "property", + "name": "_helpers", + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/ember-testing/lib/test.js", + "line": 45, + "description": "

Used to allow ember-testing to communicate with a specific testing\nframework.

\n

You can manually set it before calling App.setupForTesting().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Ember.Test.adapter = MyCustomAdapter.create()
\n
\n
\n \n

If you do not set it, ember-testing will default to Ember.Test.QUnitAdapter.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "adapter", + "type": "{Class} The adapter to be used.", + "default": "Ember.Test.QUnitAdapter", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.ViewMixin-ca211ddd30.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.ViewMixin-ca211ddd30.json new file mode 100644 index 000000000..0a1366c54 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Ember.ViewMixin-ca211ddd30.json @@ -0,0 +1,322 @@ +{ + "data": { + "id": "ember-4.5.1-Ember.ViewMixin", + "type": "class", + "attributes": { + "name": "Ember.ViewMixin", + "shortname": "Ember.ViewMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 14, + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 92, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 120, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 140, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 180, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 245, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 330, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 404, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 438, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 299, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 307, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 320, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 344, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 357, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 365, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 34, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 165, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 266, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 377, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-EmberArray-080d97a2cd.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-EmberArray-080d97a2cd.json new file mode 100644 index 000000000..787eac3bc --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-EmberArray-080d97a2cd.json @@ -0,0 +1,836 @@ +{ + "data": { + "id": "ember-4.5.1-EmberArray", + "type": "class", + "attributes": { + "name": "EmberArray", + "shortname": "EmberArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "MutableArray" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 179, + "description": "

This mixin implements Observer-friendly Array-like behavior. It is not a\nconcrete implementation, but it can be used up by other classes that want\nto appear like arrays.

\n

For example, ArrayProxy is a concrete class that can be instantiated to\nimplement array-like behavior. This class uses the Array Mixin by way of\nthe MutableArray mixin, which allows observable changes to be made to the\nunderlying array.

\n

This mixin defines methods specifically for collections that provide\nindex-ordered access to their contents. When you are designing code that\nneeds to accept any kind of Array-like object, you should use these methods\ninstead of Array primitives because these will properly notify observers of\nchanges to the array.

\n

Although these methods are efficient, they do add a layer of indirection to\nyour application so it is a good idea to use them only when you need the\nflexibility of using both true JavaScript arrays and "virtual" arrays such\nas controllers and collections.

\n

You can use the methods defined in this module to access and modify array\ncontents in an observable-friendly way. You can also be notified whenever\nthe membership of an array changes by using .observes('myArray.[]').

\n

To support EmberArray in your own class, you must override two\nprimitives to use it: length() and objectAt().

\n", + "uses": [ + "Enumerable" + ], + "since": "Ember 0.9.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1117, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1155, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1167, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1183, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1216, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1260, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1279, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1301, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-EmberObject-96257f5288.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-EmberObject-96257f5288.json new file mode 100644 index 000000000..88f41f5ac --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-EmberObject-96257f5288.json @@ -0,0 +1,596 @@ +{ + "data": { + "id": "ember-4.5.1-EmberObject", + "type": "class", + "attributes": { + "name": "EmberObject", + "shortname": "EmberObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/object.ts", + "line": 13, + "description": "

EmberObject is the main base class for all Ember objects. It is a subclass\nof CoreObject with the Observable mixin applied. For details,\nsee the documentation for each of these.

\n", + "extends": "CoreObject", + "uses": [ + "Observable" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.5.1-ContainerDebugAdapter" + }, + { + "type": "class", + "id": "ember-4.5.1-DataAdapter" + }, + { + "type": "class", + "id": "ember-4.5.1-HashLocation" + }, + { + "type": "class", + "id": "ember-4.5.1-HistoryLocation" + }, + { + "type": "class", + "id": "ember-4.5.1-NoneLocation" + }, + { + "type": "class", + "id": "ember-4.5.1-Route" + }, + { + "type": "class", + "id": "ember-4.5.1-EmberRouter" + }, + { + "type": "class", + "id": "ember-4.5.1-ArrayProxy" + }, + { + "type": "class", + "id": "ember-4.5.1-Namespace" + }, + { + "type": "class", + "id": "ember-4.5.1-ObjectProxy" + }, + { + "type": "class", + "id": "ember-4.5.1-Ember.CoreView" + }, + { + "type": "class", + "id": "ember-4.5.1-Controller" + }, + { + "type": "class", + "id": "ember-4.5.1-EngineInstance" + }, + { + "type": "class", + "id": "ember-4.5.1-Service" + } + ] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-EmberRouter-13b1f6dce7.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-EmberRouter-13b1f6dce7.json new file mode 100644 index 000000000..51bc3992e --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-EmberRouter-13b1f6dce7.json @@ -0,0 +1,1192 @@ +{ + "data": { + "id": "ember-4.5.1-EmberRouter", + "type": "class", + "attributes": { + "name": "EmberRouter", + "shortname": "EmberRouter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 141, + "description": "

The EmberRouter class manages the application state and URLs. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 220, + "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

The first parameter is the name of the route which is used by default as the\npath name as well.

\n

The 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\nsegments.
  • \n
  • resetNamespace: false by default; when nesting routes, ember will\ncombine the route names to form the fully-qualified route name, which is\nused with {{link-to}} or manually transitioning to routes. Setting\nresetNamespace: true will cause the route not to inherit from its\nparent route's names. This is handy for preventing extremely long route names.\nKeep in mind that the actual URL path behavior is still retained.
  • \n
\n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
Router.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
\n
\n \n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 555, + "description": "

Initializes the current router instance and sets up the change handling\nevent listeners used by the instances location implementation.

\n

A property named initialURL will be used to determine the initial URL.\nIf no value is found / will be used.

\n", + "itemtype": "method", + "name": "startRouting", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 678, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 723, + "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", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 750, + "description": "

Determines if the supplied route is currently active.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 762, + "description": "

An alternative form of isActive that doesn't require\nmanual concatenation of the arguments into a single\narray.

\n", + "itemtype": "method", + "name": "isActiveIntent", + "params": [ + { + "name": "routeName", + "description": "" + }, + { + "name": "models", + "description": "" + }, + { + "name": "queryParams", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 784, + "description": "

Does this router instance have the given route.

\n", + "itemtype": "method", + "name": "hasRoute", + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 795, + "description": "

Resets the state of the router by clearing the current route\nhandlers and deactivating them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 943, + "description": "

Serializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Arrray" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 973, + "description": "

Serializes the value of a query parameter based on a type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "type", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 991, + "description": "

Deserializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1019, + "description": "

Deserializes the value of a query parameter based on a default type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "defaultType", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1040, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_pruneDefaultQueryParamValues", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1121, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareQueryParams", + "params": [ + { + "name": "targetRouteName", + "description": "", + "type": "String" + }, + { + "name": "models", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + }, + { + "name": "keepDefaultQueryParamValues", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1148, + "description": "

Returns the meta information for the query params of a given route. This\nwill be overridden to allow support for lazy routes.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getQPMeta", + "params": [ + { + "name": "routeInfo", + "description": "", + "type": "RouteInfo" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1162, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_queryParamsFor", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1224, + "description": "

Maps all query param keys to their fully scoped property name of the form\ncontrollerName:propName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_fullyScopeQueryParams", + "params": [ + { + "name": "leafRouteName", + "description": "", + "type": "String" + }, + { + "name": "contexts", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1262, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_hydrateUnsuppliedQueryParams", + "params": [ + { + "name": "state", + "description": "", + "type": "TransitionState" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1433, + "description": "

Handles updating the paths and notifying any listeners of the URL\nchange.

\n

Triggers the router level didTransition hook.

\n

For example, to notify google analytics when the route changes,\nyou could use this hook. (Note: requires also including GA scripts, etc.)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "didTransition", + "access": "private", + "tagname": "", + "since": "1.2.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1470, + "description": "

Handles notifying any listeners of an impending URL\nchange.

\n

Triggers the router level willTransition hook.

\n", + "itemtype": "method", + "name": "willTransition", + "access": "private", + "tagname": "", + "since": "1.11.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 95, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 121, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 142, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 165, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 180, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 151, + "description": "

Represents the URL of the root of the application, often '/'. This prefix is\n assumed on all routes defined on this router.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 162, + "description": "

The location property determines the type of URL's that your\n application will use.

\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 history by the locationType setting of /config/environment.js

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1483, + "description": "

Represents the current URL.

\n", + "itemtype": "property", + "name": "url", + "type": "{String}", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Engine-c1d4009df8.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Engine-c1d4009df8.json new file mode 100644 index 000000000..a7061efe7 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Engine-c1d4009df8.json @@ -0,0 +1,499 @@ +{ + "data": { + "id": "ember-4.5.1-Engine", + "type": "class", + "attributes": { + "name": "Engine", + "shortname": "Engine", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/index.ts", + "line": 39, + "description": "

The Engine class contains core functionality for both applications and\nengines.

\n

Each engine manages a registry that's used for dependency injection and\nexposed through RegistryProxy.

\n

Engines also manage initializers and instance initializers.

\n

Engines can spawn EngineInstance instances via buildInstance().

\n", + "extends": "Ember.Namespace", + "uses": [ + "RegistryProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/engine/index.ts", + "line": 61, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 208, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 284, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 345, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 358, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 370, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 383, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 391, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 399, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 413, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 447, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Enginer" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 51, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/index.ts", + "line": 324, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 337, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Engine", + "module": "@ember/engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.Namespace", + "type": "missing" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.5.1-Application" + } + ] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-EngineInstance-ef956a9db6.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-EngineInstance-ef956a9db6.json new file mode 100644 index 000000000..c5672dfc8 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-EngineInstance-ef956a9db6.json @@ -0,0 +1,1003 @@ +{ + "data": { + "id": "ember-4.5.1-EngineInstance", + "type": "class", + "attributes": { + "name": "EngineInstance", + "shortname": "EngineInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/instance.ts", + "line": 26, + "description": "

The EngineInstance encapsulates all of the stateful aspects of a\nrunning Engine.

\n", + "access": "public", + "tagname": "", + "extends": "EmberObject", + "uses": [ + "RegistryProxyMixin", + "ContainerProxyMixin" + ], + "methods": [ + { + "file": "packages/@ember/engine/instance.ts", + "line": 39, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 86, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 152, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 169, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 199, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 51, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 38, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 64, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 125, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/instance.ts", + "line": 47, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 30, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.5.1-ApplicationInstance" + } + ] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Evented-af1beb073e.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Evented-af1beb073e.json new file mode 100644 index 000000000..678c65ff9 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Evented-af1beb073e.json @@ -0,0 +1,190 @@ +{ + "data": { + "id": "ember-4.5.1-Evented", + "type": "class", + "attributes": { + "name": "Evented", + "shortname": "Evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Route", + "EmberRouter", + "Ember.CoreView" + ], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 13, + "description": "

This mixin allows for Ember objects to subscribe to and emit events.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/utils/person.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport Evented from '@ember/object/evented';\n\nexport default EmberObject.extend(Evented, {\n  greet() {\n    // ...\n    this.trigger('greet');\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
var person = Person.create();\n\nperson.on('greet', function() {\n  console.log('Our person has greeted');\n});\n\nperson.greet();\n\n// outputs: 'Our person has greeted'
\n
\n
\n \n

You can also chain multiple event subscriptions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
person.on('greet', function() {\n  console.log('Our person has greeted');\n}).one('greet', function() {\n  console.log('Offer one-time special');\n}).off('event', this, forgetThis);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 95, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 121, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 142, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 165, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 180, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-HashLocation-8d023e3ec3.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-HashLocation-8d023e3ec3.json new file mode 100644 index 000000000..70a4e9e41 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-HashLocation-8d023e3ec3.json @@ -0,0 +1,641 @@ +{ + "data": { + "id": "ember-4.5.1-HashLocation", + "type": "class", + "attributes": { + "name": "HashLocation", + "shortname": "HashLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 11, + "description": "

HashLocation implements the location API using the browser's\nhash. At present, it relies on a hashchange event existing in the\nbrowser.

\n

Using HashLocation results in URLs with a # (hash sign) separating the\nserver side URL portion of the URL from the portion that is used by Ember.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'hash'\n});
\n
\n
\n \n

This will result in a posts.new url of /#/posts/new.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 51, + "access": "private", + "tagname": "Returns normalized location.hash", + "since": "1.5.1", + "itemtype": "method", + "name": "getHash", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 63, + "description": "

Returns the normalized URL, constructed from location.hash.

\n

e.g. #/foo => /foo as well as #/foo#bar => /foo#bar.

\n

By convention, hashed paths must begin with a forward slash, otherwise they\nare not treated as a path so we can distinguish intent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 93, + "description": "

Set the location.hash and remembers what was set. This prevents\nonUpdateURL callbacks from triggering when the hash was set by\nHashLocation.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 107, + "description": "

Uses location.replace to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 122, + "description": "

Register a callback to be invoked when the hash changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 147, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 162, + "description": "

Cleans up the HashLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Helper-95a955deda.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Helper-95a955deda.json new file mode 100644 index 000000000..76fd07ef1 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Helper-95a955deda.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.5.1-Helper", + "type": "class", + "attributes": { + "name": "Helper", + "shortname": "Helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 45, + "description": "

Ember Helpers are functions that can compute values, and are used in templates.\nFor example, this code calls a helper named format-currency:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Cost @cents={{230}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/cost.hbs
1\n
<div>{{format-currency @cents currency="$"}}</div>
\n
\n
\n \n

Additionally a helper can be called as a nested helper.\nIn this example, we show the formatted currency value if the showMoney\nnamed argument is truthy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{if @showMoney (format-currency @cents currency="$")}}
\n
\n
\n \n

Helpers defined using a class must provide a compute function. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n6\n7\n
import Helper from '@ember/component/helper';\n\nexport default class extends Helper {\n  compute([cents], { currency }) {\n    return `${currency}${cents * 0.01}`;\n  }\n}
\n
\n
\n \n

Each time the input to a helper changes, the compute function will be\ncalled again.

\n

As instances, these helpers also have access to the container and will accept\ninjected dependencies.

\n

Additionally, class helpers can call recompute to force a new computation.

\n", + "extends": "CoreObject", + "access": "public", + "tagname": "", + "since": "1.13.0", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 91, + "description": "

Override this function when writing a class-based helper.

\n", + "itemtype": "method", + "name": "compute", + "params": [ + { + "name": "params", + "description": "The positional arguments to the helper", + "type": "Array" + }, + { + "name": "hash", + "description": "The named arguments to the helper", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 115, + "description": "

On a class-based helper, it may be useful to force a recomputation of that\nhelpers value. This is akin to rerender on a component.

\n

For example, this component will rerender when the currentUser on a\nsession service changes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
email.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Helper from '@ember/component/helper'\nimport { service } from '@ember/service'\nimport { observer } from '@ember/object'\n\nexport default Helper.extend({\n  session: service(),\n\n  onNewUser: observer('session.currentUser', function() {\n    this.recompute();\n  }),\n\n  compute() {\n    return this.get('session.currentUser.email');\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "recompute", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-HistoryLocation-7d7b9ea8e6.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-HistoryLocation-7d7b9ea8e6.json new file mode 100644 index 000000000..1f056e618 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-HistoryLocation-7d7b9ea8e6.json @@ -0,0 +1,707 @@ +{ + "data": { + "id": "ember-4.5.1-HistoryLocation", + "type": "class", + "attributes": { + "name": "HistoryLocation", + "shortname": "HistoryLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 21, + "description": "

HistoryLocation implements the location API using the browser's\nhistory.pushState API.

\n

Using HistoryLocation results in URLs that are indistinguishable from a\nstandard URL. This relies upon the browser's history API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'history'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new.

\n

Keep in mind that your server must serve the Ember app at all the routes you\ndefine.

\n

Using HistoryLocation will also result in location states being recorded by\nthe browser history API with the following schema:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
window.history.state -> { path: '/', uuid: '3552e730-b4a6-46bd-b8bf-d8c3c1a97e0a' }
\n
\n
\n \n

This allows each in-app location state to be tracked uniquely across history\nstate changes via the uuid field.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 79, + "access": "private", + "tagname": "Returns normalized location.hash", + "itemtype": "method", + "name": "getHash", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 105, + "description": "

Used to set state on first call to setURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initState", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 126, + "description": "

Returns the current location.pathname without rootURL or baseURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 153, + "description": "

Uses history.pushState to update the url without a page reload.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 169, + "description": "

Uses history.replaceState to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 186, + "description": "

Pushes a new state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "pushState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 202, + "description": "

Replaces the current state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 218, + "description": "

Register a callback to be invoked whenever the browser\nhistory changes, including using forward and back buttons.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 243, + "description": "

Used when using {{action}} helper. The url is always appended to the rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "formatted url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 267, + "description": "

Cleans up the HistoryLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 71, + "description": "

Will be pre-pended to path upon state change

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Location-d2a65373af.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Location-d2a65373af.json new file mode 100644 index 000000000..fa7891d85 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Location-d2a65373af.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.5.1-Location", + "type": "class", + "attributes": { + "name": "Location", + "shortname": "Location", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/api.ts", + "line": 21, + "description": "

Location returns an instance of the correct implementation of\nthe location API.

\n

Implementations

\n

You can pass an implementation name (hash, history, none, auto) to force a\nparticular implementation to be used in your application.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n

Location API

\n

Each location implementation must provide the following methods:

\n
    \n
  • implementation: returns the string name used to reference the implementation.
  • \n
  • getURL: returns the current URL.
  • \n
  • setURL(path): sets the current URL.
  • \n
  • replaceURL(path): replace the current URL (optional).
  • \n
  • onUpdateURL(callback): triggers the callback when the URL changes.
  • \n
  • formatURL(url): formats url to be placed into href attribute.
  • \n
  • detect() (optional): instructs the location to do any feature detection\n necessary. If the location needs to redirect to a different URL, it\n can cancel routing by setting the cancelRouterSetup property on itself\n to false.
  • \n
\n

Calling setURL or replaceURL will not trigger onUpdateURL callbacks.

\n

Custom implementation

\n

Ember scans app/locations/* for extending the Location API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import HistoryLocation from '@ember/routing/history-location';\n\nexport default class MyHistory {\n  implementation = 'my-custom-history';\n\n  constructor() {\n    this._history = HistoryLocation.create(...arguments);\n  }\n\n  create() {\n    return new this(...arguments);\n  }\n\n  pushState(path) {\n     this._history.pushState(path);\n  }\n}
\n
\n
\n \n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/api.ts", + "line": 82, + "description": "

This is deprecated in favor of using the container to lookup the location\nimplementation as desired.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
// Given a location registered as follows:\ncontainer.register('location:history-test', HistoryTestLocation);\n\n// You could create a new instance via:\ncontainer.lookup('location:history-test');
\n
\n
\n \n", + "itemtype": "method", + "name": "create", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "an instance of an implementation of the `location` API", + "type": "Object" + }, + "deprecated": true, + "deprecationMessage": "Use the container to lookup the location implementation that you\n need.", + "access": "private", + "tagname": "", + "class": "Location", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Mixin-40f0008faf.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Mixin-40f0008faf.json new file mode 100644 index 000000000..fa79ff0c2 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Mixin-40f0008faf.json @@ -0,0 +1,75 @@ +{ + "data": { + "id": "ember-4.5.1-Mixin", + "type": "class", + "attributes": { + "name": "Mixin", + "shortname": "Mixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 445, + "description": "

The Mixin class allows you to create mixins, whose properties can be\nadded to other classes. For instance,

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nconst EditableMixin = Mixin.create({\n  edit() {\n    console.log('starting to edit');\n    this.set('isEditing', true);\n  },\n  isEditing: false\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import EmberObject from '@ember/object';\nimport EditableMixin from '../mixins/editable';\n\n// Mix mixins into classes by passing them as the first arguments to\n// `.extend.`\nconst Comment = EmberObject.extend(EditableMixin, {\n  post: null\n});\n\nlet comment = Comment.create({\n  post: somePost\n});\n\ncomment.edit(); // outputs 'starting to edit'
\n
\n
\n \n

Note that Mixins are created with Mixin.create, not\nMixin.extend.

\n

Note that mixins extend a constructor's prototype so arrays and object literals\ndefined as properties will be shared amongst objects that implement the mixin.\nIf you want to define a property in a mixin that is not shared, you can define\nit either as a computed property or have it be created on initialization of the object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
// filters array will be shared amongst any object implementing mixin\nimport Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\nconst FilterableMixin = Mixin.create({\n  filters: A()\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\nimport { computed } from '@ember/object';\n\n// filters will be a separate array for every object implementing the mixin\nconst FilterableMixin = Mixin.create({\n  filters: computed(function() {\n    return A();\n  })\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\n// filters will be created as a separate array during the object's initialization\nconst Filterable = Mixin.create({\n  filters: null,\n\n  init() {\n    this._super(...arguments);\n    this.set("filters", A());\n  }\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 431, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Mixin", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.5.1-Ember.TargetActionSupport" + } + ] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-MutableArray-fb7ca681f9.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-MutableArray-fb7ca681f9.json new file mode 100644 index 000000000..25d091179 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-MutableArray-fb7ca681f9.json @@ -0,0 +1,1240 @@ +{ + "data": { + "id": "ember-4.5.1-MutableArray", + "type": "class", + "attributes": { + "name": "MutableArray", + "shortname": "MutableArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "ArrayProxy" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1327, + "description": "

This mixin defines the API for modifying array-like objects. These methods\ncan be applied only to a collection that keeps its items in an ordered set.\nIt builds upon the Array mixin and adds methods to modify the array.\nOne concrete implementations of this class include ArrayProxy.

\n

It is important to use the methods in this class to modify arrays so that\nchanges are observable. This allows the binding system in Ember to function\ncorrectly.

\n

Note that an Array can change even if it does not implement this mixin.\nFor example, one might implement a SparseArray that cannot be directly\nmodified, but if its underlying enumerable changes, it will change also.

\n", + "uses": [ + "MutableEnumerable", + "EmberArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1349, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1368, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1394, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1416, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1441, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1461, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1481, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1507, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1532, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1552, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1573, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1592, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1619, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1647, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1664, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1690, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 228, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 253, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 337, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 377, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 419, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 473, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 533, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 556, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 579, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 623, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 644, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 717, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 764, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 788, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 815, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 862, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 894, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 936, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 978, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1022, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1050, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1117, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1155, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1167, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1183, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1216, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1260, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1279, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 1301, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 218, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 272, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 300, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.js", + "line": 325, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Namespace-7e30bbee01.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Namespace-7e30bbee01.json new file mode 100644 index 000000000..b5bf36ff0 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Namespace-7e30bbee01.json @@ -0,0 +1,536 @@ +{ + "data": { + "id": "ember-4.5.1-Namespace", + "type": "class", + "attributes": { + "name": "Namespace", + "shortname": "Namespace", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/namespace.ts", + "line": 20, + "description": "

A Namespace is an object usually used to contain other objects or methods\nsuch as an application or framework. Create a namespace anytime you want\nto define one of these new containers.

\n

Example Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
MyFramework = Ember.Namespace.create({\n  VERSION: '1.0.0'\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-NoneLocation-7568c6a5d7.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-NoneLocation-7568c6a5d7.json new file mode 100644 index 000000000..b2d8e7208 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-NoneLocation-7568c6a5d7.json @@ -0,0 +1,639 @@ +{ + "data": { + "id": "ember-4.5.1-NoneLocation", + "type": "class", + "attributes": { + "name": "NoneLocation", + "shortname": "NoneLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 10, + "description": "

NoneLocation does not interact with the browser. It is useful for\ntesting, or when you need to manage state with your Router, but temporarily\ndon't want it to muck with the URL (for example when you embed your\napplication in a larger page).

\n

Using NoneLocation causes Ember to not store the applications URL state\nin the actual URL. This is generally used for testing purposes, and is one\nof the changes made when calling App.setupForTesting().

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 55, + "description": "

Returns the current path without rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "path", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 72, + "description": "

Set the path and remembers what was set. Using this method\nto change the path will not invoke the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 84, + "description": "

Register a callback to be invoked when the path changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 97, + "description": "

Sets the path and calls the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "handleURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 109, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 31, + "description": "

Will be pre-pended to path.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-ObjectProxy-8ef9e39d93.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-ObjectProxy-8ef9e39d93.json new file mode 100644 index 000000000..f838245fb --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-ObjectProxy-8ef9e39d93.json @@ -0,0 +1,571 @@ +{ + "data": { + "id": "ember-4.5.1-ObjectProxy", + "type": "class", + "attributes": { + "name": "ObjectProxy", + "shortname": "ObjectProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/object_proxy.ts", + "line": 4, + "description": "

ObjectProxy forwards all properties not defined by the proxy itself\nto a proxied content object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nlet exampleObject = EmberObject.create({\n  name: 'Foo'\n});\n\nlet exampleProxy = ObjectProxy.create({\n  content: exampleObject\n});\n\n// Access and change existing properties\nexampleProxy.get('name');          // 'Foo'\nexampleProxy.set('name', 'Bar');\nexampleObject.get('name');         // 'Bar'\n\n// Create new 'description' property on `exampleObject`\nexampleProxy.set('description', 'Foo is a whizboo baz');\nexampleObject.get('description');  // 'Foo is a whizboo baz'
\n
\n
\n \n

While content is unset, setting a property to be delegated will throw an\nError.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import ObjectProxy from '@ember/object/proxy';\n\nlet exampleProxy = ObjectProxy.create({\n  content: null,\n  flag: null\n});\nexampleProxy.set('flag', true);\nexampleProxy.get('flag');         // true\nexampleProxy.get('foo');          // undefined\nexampleProxy.set('foo', 'data');  // throws Error
\n
\n
\n \n

Delegated properties can be bound to and will change when content is updated.

\n

Computed properties on the proxy itself can depend on delegated properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { computed } from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nProxyWithComputedProperty = ObjectProxy.extend({\n  fullName: computed('firstName', 'lastName', function() {\n    var firstName = this.get('firstName'),\n        lastName = this.get('lastName');\n    if (firstName && lastName) {\n      return firstName + ' ' + lastName;\n    }\n    return firstName || lastName;\n  })\n});\n\nlet exampleProxy = ProxyWithComputedProperty.create();\n\nexampleProxy.get('fullName');  // undefined\nexampleProxy.set('content', {\n  firstName: 'Tom', lastName: 'Dale'\n}); // triggers property change for fullName on proxy\n\nexampleProxy.get('fullName');  // 'Tom Dale'
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "Ember.ProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 71, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 93, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Observable-5d0d22e2d6.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Observable-5d0d22e2d6.json new file mode 100644 index 000000000..75dd5ae57 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Observable-5d0d22e2d6.json @@ -0,0 +1,388 @@ +{ + "data": { + "id": "ember-4.5.1-Observable", + "type": "class", + "attributes": { + "name": "Observable", + "shortname": "Observable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "EmberObject" + ], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 25, + "description": "

Overview

\n

This mixin provides properties and property observing functionality, core\nfeatures of the Ember object model.

\n

Properties and observers allow one object to observe changes to a\nproperty on another object. This is one of the fundamental ways that\nmodels, controllers and views communicate with each other in an Ember\napplication.

\n

Any object that has this mixin applied can be used in observer\noperations. That includes EmberObject and most objects you will\ninteract with as you write your Ember application.

\n

Note that you will not generally apply this mixin to classes yourself,\nbut you will use the features provided by this module frequently, so it\nis important to understand how to use it.

\n

Using get() and set()

\n

Because of Ember's support for bindings and observers, you will always\naccess properties using the get method, and set properties using the\nset method. This allows the observing objects to be notified and\ncomputed properties to be handled properly.

\n

More documentation about get and set are below.

\n

Observing Property Changes

\n

You typically observe property changes simply by using the observer\nfunction in classes that you write.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { observer } from '@ember/object';\nimport EmberObject from '@ember/object';\n\nEmberObject.extend({\n  valueObserver: observer('value', function(sender, key, value, rev) {\n    // Executes whenever the "value" property changes\n    // See the addObserver method for more information about the callback arguments\n  })\n});
\n
\n
\n \n

Although this is the most common way to add an observer, this capability\nis actually built into the EmberObject class on top of two methods\ndefined in this mixin: addObserver and removeObserver. You can use\nthese two methods to add and remove observers yourself if you need to\ndo so at runtime.

\n

To add an observer for a property, call:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
object.addObserver('propertyKey', targetObject, targetAction)
\n
\n
\n \n

This will call the targetAction method on the targetObject whenever\nthe value of the propertyKey changes.

\n

Note that if propertyKey is a computed property, the observer will be\ncalled when any of the property dependencies are changed, even if the\nresulting value of the computed property is unchanged. This is necessary\nbecause computed properties are not computed until get is called.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Promise-87bcfe0847.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Promise-87bcfe0847.json new file mode 100644 index 000000000..1aed03c4a --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Promise-87bcfe0847.json @@ -0,0 +1,246 @@ +{ + "data": { + "id": "ember-4.5.1-Promise", + "type": "class", + "attributes": { + "name": "Promise", + "shortname": "Promise", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 26, + "description": "

Promise objects represent the eventual result of an asynchronous operation. The\nprimary way of interacting with a promise is through its then method, which\nregisters callbacks to receive either a promise’s eventual value or the reason\nwhy the promise cannot be fulfilled.

\n

Terminology

\n
    \n
  • promise is an object or function with a then method whose behavior conforms to this specification.
  • \n
  • thenable is an object or function that defines a then method.
  • \n
  • value is any legal JavaScript value (including undefined, a thenable, or a promise).
  • \n
  • exception is a value that is thrown using the throw statement.
  • \n
  • reason is a value that indicates why a promise was rejected.
  • \n
  • settled the final resting state of a promise, fulfilled or rejected.
  • \n
\n

A promise can be in one of three states: pending, fulfilled, or rejected.

\n

Promises that are fulfilled have a fulfillment value and are in the fulfilled\nstate. Promises that are rejected have a rejection reason and are in the\nrejected state. A fulfillment value is never a thenable.

\n

Promises can also be said to resolve a value. If this value is also a\npromise, then the original promise's settled state will match the value's\nsettled state. So a promise that resolves a promise that rejects will\nitself reject, and a promise that resolves a promise that fulfills will\nitself fulfill.

\n

Basic Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
let promise = new Promise(function(resolve, reject) {\n  // on success\n  resolve(value);\n\n  // on failure\n  reject(reason);\n});\n\npromise.then(function(value) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Advanced Usage:

\n

Promises shine when abstracting away asynchronous interactions such as\nXMLHttpRequests.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
function getJSON(url) {\n  return new Promise(function(resolve, reject){\n    let xhr = new XMLHttpRequest();\n\n    xhr.open('GET', url);\n    xhr.onreadystatechange = handler;\n    xhr.responseType = 'json';\n    xhr.setRequestHeader('Accept', 'application/json');\n    xhr.send();\n\n    function handler() {\n      if (this.readyState === this.DONE) {\n        if (this.status === 200) {\n          resolve(this.response);\n        } else {\n          reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n        }\n      }\n    };\n  });\n}\n\ngetJSON('/posts.json').then(function(json) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Unlike callbacks, promises are great composable primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Promise.all([\n  getJSON('/posts'),\n  getJSON('/comments')\n]).then(function(values){\n  values[0] // => postsJSON\n  values[1] // => commentsJSON\n\n  return values;\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "params": [ + { + "name": "resolver", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "is_constructor": 1, + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/promise/all.js", + "line": 3, + "description": "

Promise.all accepts an array of promises, and returns a new promise which\nis fulfilled with an array of fulfillment values for the passed promises, or\nrejected with the reason of the first passed promise to be rejected. It casts all\nelements of the passed iterable to promises as it runs this algorithm.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Promise, { resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // The array here would be [ 1, 2, 3 ];\n});
\n
\n
\n \n

If any of the promises given to RSVP.all are rejected, the first promise\nthat is rejected will be given as an argument to the returned promises's\nrejection handler. For example:

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Promise, { resolve, reject } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error("2"));\nlet promise3 = reject(new Error("3"));\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(error) {\n  // error.message === "2"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "all", + "params": [ + { + "name": "entries", + "description": "array of promises", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all `promises` have been\nfulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "static": 1, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/race.js", + "line": 9, + "description": "

Promise.race returns a new promise which is settled in the same way as the\nfirst passed promise to settle.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 2');\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // result === 'promise 2' because it was resolved before promise1\n  // was resolved.\n});
\n
\n
\n \n

Promise.race is deterministic in that only the state of the first\nsettled promise matters. For example, even if other promises given to the\npromises array argument are resolved, but the first settled promise has\nbecome rejected before the other promises became fulfilled, the returned\npromise will become rejected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    reject(new Error('promise 2'));\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // Code here never runs\n}, function(reason){\n  // reason.message === 'promise 2' because promise 2 became rejected before\n  // promise 1 became fulfilled\n});
\n
\n
\n \n

An example real-world use case is implementing timeouts:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import Promise from 'rsvp';\n\nPromise.race([ajax('foo.json'), timeout(5000)])
\n
\n
\n \n", + "itemtype": "method", + "name": "race", + "static": 1, + "params": [ + { + "name": "entries", + "description": "array of promises to observe", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for describing the promise returned.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise which settles in the same way as the first passed\npromise to settle.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/reject.js", + "line": 6, + "description": "

Promise.reject returns a promise rejected with the passed reason.\nIt is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  reject(new Error('WHOOPS'));\n});\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = Promise.reject(new Error('WHOOPS'));\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/resolve.js", + "line": 6, + "description": "

Promise.resolve returns a promise that will become resolved with the\npassed value. It is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  resolve(1);\n});\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Promise from 'rsvp';\n\nlet promise = RSVP.Promise.resolve(1);\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "resolve", + "static": 1, + "params": [ + { + "name": "object", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 155, + "description": "

catch is simply sugar for then(undefined, onRejection) which makes it the same\nas the catch block of a try/catch statement.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
function findAuthor(){\n  throw new Error('couldn\\'t find that author');\n}\n\n// synchronous\ntry {\n  findAuthor();\n} catch(reason) {\n  // something went wrong\n}\n\n// async with promises\nfindAuthor().catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 187, + "description": "

finally will be invoked regardless of the promise's fate just as native\ntry/catch/finally behaves

\n

Synchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
findAuthor() {\n  if (Math.random() > 0.5) {\n    throw new Error();\n  }\n  return new Author();\n}\n\ntry {\n  return findAuthor(); // succeed or fail\n} catch(error) {\n  return findOtherAuthor();\n} finally {\n  // always runs\n  // doesn't affect the return value\n}
\n
\n
\n \n

Asynchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findAuthor().catch(function(reason){\n  return findOtherAuthor();\n}).finally(function(){\n  // author was either found, or not\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 248, + "description": "

The primary way of interacting with a promise is through its then method,\nwhich registers callbacks to receive either a promise's eventual value or the\nreason why the promise cannot be fulfilled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function(user){\n  // user is available\n}, function(reason){\n  // user is unavailable, and you are given the reason why\n});
\n
\n
\n \n

Chaining

\n

The return value of then is itself a promise. This second, 'downstream'\npromise is resolved with the return value of the first promise's fulfillment\nor rejection handler, or rejected if the handler throws an exception.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
findUser().then(function (user) {\n  return user.name;\n}, function (reason) {\n  return 'default name';\n}).then(function (userName) {\n  // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n  // will be `'default name'`\n});\n\nfindUser().then(function (user) {\n  throw new Error('Found user, but still unhappy');\n}, function (reason) {\n  throw new Error('`findUser` rejected and we\\'re unhappy');\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n  // If `findUser` rejected, `reason` will be '`findUser` rejected and we\\'re unhappy'.\n});
\n
\n
\n \n

If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
findUser().then(function (user) {\n  throw new PedagogicalException('Upstream error');\n}).then(function (value) {\n  // never reached\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // The `PedgagocialException` is propagated all the way down to here\n});
\n
\n
\n \n

Assimilation

\n

Sometimes the value you want to propagate to a downstream promise can only be\nretrieved asynchronously. This can be achieved by returning a promise in the\nfulfillment or rejection handler. The downstream promise will then be pending\nuntil the returned promise is settled. This is called assimilation.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // The user's comments are now available\n});
\n
\n
\n \n

If the assimliated promise rejects, then the downstream promise will also reject.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // If `findCommentsByAuthor` fulfills, we'll have the value here\n}, function (reason) {\n  // If `findCommentsByAuthor` rejects, we'll have the reason here\n});
\n
\n
\n \n

Simple Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let result;\n\ntry {\n  result = findResult();\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findResult(function(result, err){\n  if (err) {\n    // failure\n  } else {\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findResult().then(function(result){\n  // success\n}, function(reason){\n  // failure\n});
\n
\n
\n \n

Advanced Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let author, books;\n\ntry {\n  author = findAuthor();\n  books  = findBooksByAuthor(author);\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
function foundBooks(books) {\n\n}\n\nfunction failure(reason) {\n\n}\n\nfindAuthor(function(author, err){\n  if (err) {\n    failure(err);\n    // failure\n  } else {\n    try {\n      findBoooksByAuthor(author, function(books, err) {\n        if (err) {\n          failure(err);\n        } else {\n          try {\n            foundBooks(books);\n          } catch(reason) {\n            failure(reason);\n          }\n        }\n      });\n    } catch(error) {\n      failure(err);\n    }\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findAuthor().\n  then(findBooksByAuthor).\n  then(function(books){\n    // found books\n}).catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "onFulfillment", + "description": "", + "type": "Function" + }, + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-PromiseProxyMixin-48fc4ca2cd.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-PromiseProxyMixin-48fc4ca2cd.json new file mode 100644 index 000000000..a43468d6d --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-PromiseProxyMixin-48fc4ca2cd.json @@ -0,0 +1,186 @@ +{ + "data": { + "id": "ember-4.5.1-PromiseProxyMixin", + "type": "class", + "attributes": { + "name": "PromiseProxyMixin", + "shortname": "PromiseProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 46, + "description": "

A low level mixin making ObjectProxy promise-aware.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { resolve } from 'rsvp';\nimport $ from 'jquery';\nimport ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nlet ObjectPromiseProxy = ObjectProxy.extend(PromiseProxyMixin);\n\nlet proxy = ObjectPromiseProxy.create({\n  promise: resolve($.getJSON('/some/remote/data.json'))\n});\n\nproxy.then(function(json){\n   // the json\n}, function(reason) {\n   // the reason why you have no json\n});
\n
\n
\n \n

the proxy has bindable attributes which\ntrack the promises life cycle

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> true\nproxy.get('isSettled')  //=> false\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> false
\n
\n
\n \n

When the $.getJSON completes, and the promise is fulfilled\nwith json, the life cycle attributes will update accordingly.\nNote that $.getJSON doesn't return an ECMA specified promise,\nit is useful to wrap this with an RSVP.resolve so that it behaves\nas a spec compliant promise.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> false\nproxy.get('isSettled')   //=> true\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> true
\n
\n
\n \n

As the proxy is an ObjectProxy, and the json now its content,\nall the json properties will be available directly from the proxy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// Assuming the following json:\n{\n  firstName: 'Stefan',\n  lastName: 'Penner'\n}\n\n// both properties will accessible on the proxy\nproxy.get('firstName') //=> 'Stefan'\nproxy.get('lastName')  //=> 'Penner'
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 204, + "description": "

An alias to the proxied promise's then.

\n

See RSVP.Promise.then.

\n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 216, + "description": "

An alias to the proxied promise's catch.

\n

See RSVP.Promise.catch.

\n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 229, + "description": "

An alias to the proxied promise's finally.

\n

See RSVP.Promise.finally.

\n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 125, + "description": "

If the proxied promise is rejected this will contain the reason\nprovided.

\n", + "itemtype": "property", + "name": "reason", + "default": "null", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 135, + "description": "

Once the proxied promise has settled this will become false.

\n", + "itemtype": "property", + "name": "isPending", + "default": "true", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 146, + "description": "

Once the proxied promise has settled this will become true.

\n", + "itemtype": "property", + "name": "isSettled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 157, + "description": "

Will become true if the proxied promise is rejected.

\n", + "itemtype": "property", + "name": "isRejected", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 166, + "description": "

Will become true if the proxied promise is fulfilled.

\n", + "itemtype": "property", + "name": "isFulfilled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 175, + "description": "

The promise whose fulfillment value is being proxied by this object.

\n

This property must be specified upon creation, and should not be\nchanged once created.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nObjectProxy.extend(PromiseProxyMixin).create({\n  promise: <thenable>\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "promise", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Registry-adb8831919.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Registry-adb8831919.json new file mode 100644 index 000000000..fced6dffb --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Registry-adb8831919.json @@ -0,0 +1,407 @@ +{ + "data": { + "id": "ember-4.5.1-Registry", + "type": "class", + "attributes": { + "name": "Registry", + "shortname": "Registry", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 56, + "description": "

A registry used to store factory and option information keyed\nby type.

\n

A Registry stores the factory and option information needed by a\nContainer to instantiate and cache objects.

\n

The API for Registry is still in flux and should not be considered stable.

\n", + "access": "private", + "tagname": "", + "since": "1.11.0", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 145, + "description": "

Creates a container based on this registry.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "container", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "created container", + "type": "Container" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 157, + "description": "

Registers a factory for later injection.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let registry = new Registry();\n\nregistry.register('model:user', Person, {singleton: false });\nregistry.register('fruit:favorite', Orange);\nregistry.register('communication:main', Email, {singleton: false});
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "factory", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 194, + "description": "

Unregister a fullName

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.register('model:user', User);\n\nregistry.resolve('model:user').create() instanceof User //=> true\n\nregistry.unregister('model:user')\nregistry.resolve('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 222, + "description": "

Given a fullName return the corresponding factory.

\n

By default resolve will retrieve the factory from\nthe registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let registry = new Registry();\nregistry.register('api:twitter', Twitter);\n\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n

Optionally the registry can be provided with a custom resolver.\nIf provided, resolve will first provide the custom resolver\nthe opportunity to resolve the fullName, otherwise it will fallback\nto the registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.resolver = function(fullName) {\n   // lookup via the module system of choice\n };\n\n// the twitter factory is added to the module system\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 263, + "description": "

A hook that can be used to describe how the resolver will\nattempt to find the factory.

\n

For example, the default Ember .describe returns the full\nclass name (including namespace) where Ember's resolver expects\nto find the fullName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "describe", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "described fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 286, + "description": "

A hook to enable custom fullName normalization behavior

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalizeFullName", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 304, + "description": "

Normalize a fullName based on the application's conventions

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalize", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 319, + "itemtype": "method", + "name": "makeToString", + "access": "private", + "tagname": "", + "params": [ + { + "name": "factory", + "description": "", + "type": "Any" + }, + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "toString function", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 337, + "description": "

Given a fullName check if the container is aware of its factory\nor singleton instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "the fullname of the request source (used for local lookups)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 356, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let registry = new Registry();\nlet container = registry.container();\n\n// if all of type `connection` must not be singletons\nregistry.optionsForType('connection', { singleton: false });\n\nregistry.register('connection:twitter', TwitterConnection);\nregistry.register('connection:facebook', FacebookConnection);\n\nlet twitter = container.lookup('connection:twitter');\nlet twitter2 = container.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = container.lookup('connection:facebook');\nlet facebook2 = container.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "optionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 397, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "options", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 470, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "knownForType", + "params": [ + { + "name": "type", + "description": "the type to iterate over", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 95, + "description": "

A backup registry for resolving registrations when no matches can be found.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "fallback", + "type": "Registry", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 103, + "description": "

An object that has a resolve method that resolves a name.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "resolver", + "type": "Resolver", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 111, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registrations", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 117, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_normalizeCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 124, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_resolveCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 131, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_options", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 138, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_typeOptions", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-RegistryProxyMixin-85abba2c39.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-RegistryProxyMixin-85abba2c39.json new file mode 100644 index 000000000..c82b0161d --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-RegistryProxyMixin-85abba2c39.json @@ -0,0 +1,285 @@ +{ + "data": { + "id": "ember-4.5.1-RegistryProxyMixin", + "type": "class", + "attributes": { + "name": "RegistryProxyMixin", + "shortname": "RegistryProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Engine", + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 37, + "description": "

RegistryProxyMixin is used to provide public access to specific\nregistry functionality.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 51, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "RegistryProxyMixin", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Route-25d41993d8.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Route-25d41993d8.json new file mode 100644 index 000000000..0721619ef --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Route-25d41993d8.json @@ -0,0 +1,1706 @@ +{ + "data": { + "id": "ember-4.5.1-Route", + "type": "class", + "attributes": { + "name": "Route", + "shortname": "Route", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 85, + "description": "

The Route class is used to define individual routes. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented", + "ActionHandler" + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 311, + "description": "

A hook you can implement to convert the route's model into parameters\nfor the URL.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model({ post_id }) {\n    // the server returns `{ id: 12 }`\n    return fetch(`/posts/${post_id}`;\n  }\n\n  serialize(model) {\n    // this will make the URL `/posts/12`\n    return { post_id: model.id };\n  }\n}
\n
\n
\n \n

The default serialize method will insert the model's id into the\nroute's dynamic segment (in this case, :post_id) if the segment contains '_id'.\nIf the route has multiple dynamic segments or does not contain '_id', serialize\nwill return getProperties(model, params)

\n

This method is called when transitionTo is called with a context\nin order to populate the URL.

\n", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "model", + "description": "the routes model", + "type": "Object" + }, + { + "name": "params", + "description": "an Array of parameter names for the current\n route (in the example, `['post_id']`.", + "type": "Array" + } + ], + "return": { + "description": "the serialized parameters", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 548, + "description": "

Sets the name for this route, including a fully resolved name for routes\ninside engines.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_setRouteName", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 563, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_stashNames", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 606, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_updatingQPChanged", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 614, + "description": "

Returns a hash containing the parameters of an ancestor route.

\n

You may notice that this.paramsFor sometimes works when referring to a\nchild route, but this behavior should not be relied upon as only ancestor\nroutes are certain to be loaded in time.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('member', { path: ':name' }, function() {\n    this.route('interest', { path: ':interest' });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class MemberRoute extends Route {\n  queryParams = {\n    memberQp: { refreshModel: true }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member/interest.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default class MemberInterestRoute extends Route {\n  queryParams = {\n    interestQp: { refreshModel: true }\n  }\n\n  model() {\n    return this.paramsFor('member');\n  }\n}
\n
\n
\n \n

If we visit /turing/maths?memberQp=member&interestQp=interest the model for\nthe member.interest route is a hash with:

\n
    \n
  • name: turing
  • \n
  • memberQp: member
  • \n
\n", + "itemtype": "method", + "name": "paramsFor", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "return": { + "description": "hash containing the parameters of the route `name`", + "type": "Object" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 695, + "description": "

Serializes the query parameter key

\n", + "itemtype": "method", + "name": "serializeQueryParamKey", + "params": [ + { + "name": "controllerPropertyName", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 706, + "description": "

Serializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 722, + "description": "

Deserializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 754, + "description": "

A hook you can use to reset controller values either when the model\nchanges or the route is exiting.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/articles.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class ArticlesRoute extends Route {\n  resetController(controller, isExiting, transition) {\n    if (isExiting && transition.targetName !== 'error') {\n      controller.set('page', 1);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "resetController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "isExiting", + "description": "", + "type": "Boolean" + }, + { + "name": "transition", + "description": "", + "type": "Object" + } + ], + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 781, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "exit", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 792, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_internalReset", + "since": "3.6.0", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 806, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "enter", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 857, + "description": "

This hook is executed when the router completely exits this route. It is\nnot executed when the model for the route changes.

\n", + "itemtype": "method", + "name": "deactivate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 868, + "description": "

This hook is executed when the router enters the route. It is not executed\nwhen the model for the route changes.

\n", + "itemtype": "method", + "name": "activate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 879, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogPosts');\nthis.transitionTo('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('blogPost', { path:':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogComment', aPost, aComment);\nthis.transitionTo('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
this.transitionTo('/');\nthis.transitionTo('/blog/post/1/comment/13');\nthis.transitionTo('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
this.transitionTo('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\nthis.transitionTo({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceWith.

\n

Simple Transition Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n  this.route('fourOhFour', { path: '*:' });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToSecret(context) {\n    if (authorized()) {\n      this.transitionTo('secret', context);\n    } else {\n      this.transitionTo('fourOhFour');\n    }\n  }\n}
\n
\n
\n \n

Transition to a nested route

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('articles', { path: '/articles' }, function() {\n    this.route('new');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToNewArticle() {\n    this.transitionTo('articles.new');\n  }\n}
\n
\n
\n \n

Multiple Models Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n\n  this.route('breakfast', { path: ':breakfastId' }, function() {\n    this.route('cereal', { path: ':cerealId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToChocolateCereal() {\n    let cereal = { cerealId: 'ChocolateYumminess' };\n    let breakfast = { breakfastId: 'CerealAndMilk' };\n\n    this.transitionTo('breakfast.cereal', breakfast, cereal);\n  }\n}
\n
\n
\n \n

Nested Route with Query String Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('fruits', function() {\n    this.route('apples');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToApples() {\n    this.transitionTo('fruits.apples', { queryParams: { color: 'red' } });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL.", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1077, + "description": "

Perform a synchronous transition into another route without attempting\nto resolve promises, update the URL, or abort any currently active\nasynchronous transitions (i.e. regular transitions caused by\ntransitionTo or URL changes).

\n

This method is handy for performing intermediate transitions on the\nway to a final destination route, and is called internally by the\ndefault implementations of the error and loading handlers.

\n", + "itemtype": "method", + "name": "intermediateTransitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) to be used while transitioning\nto the route.", + "type": "...Object" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1099, + "description": "

Refresh the model on this route and any child routes, firing the\nbeforeModel, model, and afterModel hooks in a similar fashion\nto how routes are entered when transitioning in from other route.\nThe current route params (e.g. article_id) will be passed in\nto the respective model hooks, and if a different model is returned,\nsetupController and associated route hooks will re-fire as well.

\n

An example usage of this method is re-querying the server for the\nlatest information using the same parameters as when the route\nwas first entered.

\n

Note that this will cause model hooks to fire even on routes\nthat were provided a model object when the route was initially\nentered.

\n", + "itemtype": "method", + "name": "refresh", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1125, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionTo in all other respects. See\n'transitionTo' for additional information regarding multiple models.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/secret.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class SecretRoute Route {\n  afterModel() {\n    if (!authorized()){\n      this.replaceWith('index');\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1173, + "description": "

This hook is the entry point for router.js

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1248, + "description": "

This hook is the first of the route entry validation hooks\ncalled when an attempt is made to transition into a route\nor one of its children. It is called before model and\nafterModel, and is appropriate for cases when:

\n
    \n
  1. A decision can be made to redirect elsewhere without\nneeding to resolve the model first.
  2. \n
  3. Any async operations need to occur first before the\nmodel is attempted to be resolved.
  4. \n
\n

This hook is provided the current transition attempt\nas a parameter, which can be used to .abort() the transition,\nsave it for a later .retry(), or retrieve values set\non it from a previous hook. You can also just call\nthis.transitionTo to another route to implicitly\nabort the transition.

\n

You can return a promise from this hook to pause the\ntransition until the promise resolves (or rejects). This could\nbe useful, for instance, for retrieving async code from\nthe server that is required to enter a route.

\n", + "itemtype": "method", + "name": "beforeModel", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1283, + "description": "

This hook is called after this route's model has resolved.\nIt follows identical async/promise semantics to beforeModel\nbut is provided the route's resolved model in addition to\nthe transition, and is therefore suited to performing\nlogic that can only take place after the model has already\nresolved.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n  afterModel(posts, transition) {\n    if (posts.get('length') === 1) {\n      this.transitionTo('post.show', posts.get('firstObject'));\n    }\n  }\n}
\n
\n
\n \n

Refer to documentation for beforeModel for a description\nof transition-pausing semantics when a promise is returned\nfrom this hook.

\n", + "itemtype": "method", + "name": "afterModel", + "params": [ + { + "name": "resolvedModel", + "description": "the value returned from `model`,\n or its resolved value if it was a promise", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1321, + "description": "

A hook you can implement to optionally redirect to another route.

\n

Calling this.transitionTo from inside of the redirect hook will\nabort the current transition (into the route that has implemented redirect).

\n

redirect and afterModel behave very similarly and are\ncalled almost at the same time, but they have an important\ndistinction when calling this.transitionTo to a child route\nof the current route. From afterModel, this new transition\ninvalidates the current transition, causing beforeModel,\nmodel, and afterModel hooks to be called again. But the\nsame transition started from redirect does not invalidate\nthe current transition. In other words, by the time the redirect\nhook has been called, both the resolved model and the attempted\nentry into this route are considered fully validated.

\n", + "itemtype": "method", + "name": "redirect", + "params": [ + { + "name": "model", + "description": "the model for this route", + "type": "Object" + }, + { + "name": "transition", + "description": "the transition object associated with the current transition", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1346, + "description": "

Called when the context is changed by router.js.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "contextDidChange", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1356, + "description": "

A hook you can implement to convert the URL into the model for\nthis route.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

The model for the post route is store.findRecord('post', params.post_id).

\n

By default, if your route has a dynamic segment ending in _id:

\n
    \n
  • The model class is determined from the segment (post_id's\nclass is App.Post)
  • \n
  • The find method is called on the model class with the value of\nthe dynamic segment.
  • \n
\n

Note that for routes with dynamic segments, this hook is not always\nexecuted. If the route is entered through a transition (e.g. when\nusing the link-to Handlebars helper or the transitionTo method\nof routes), and a model context is already provided this hook\nis not called.

\n

A model context does not include a primitive string or number,\nwhich does cause the model hook to be called.

\n

Routes without dynamic segments will always execute the model hook.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
// no dynamic segment, model hook always called\nthis.transitionTo('posts');\n\n// model passed in, so model hook not called\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost);\n\n// integer passed in, model hook is called\nthis.transitionTo('post', 1);\n\n// model id passed in, model hook is called\n// useful for forcing the hook to execute\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost.id);
\n
\n
\n \n

This hook follows the asynchronous/promise semantics\ndescribed in the documentation for beforeModel. In particular,\nif a promise returned from model fails, the error will be\nhandled by the error hook on Route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model(params) {\n    return this.store.findRecord('post', params.post_id);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "model", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route. If\n a promise is returned, the transition will pause until\n the promise resolves, and the resolved value of the promise\n will be used as the model for this route.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1471, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "deserialize", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route.\n\nRouter.js hook.", + "type": "Any | Promise" + }, + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1484, + "itemtype": "method", + "name": "findModel", + "params": [ + { + "name": "type", + "description": "the model type", + "type": "String" + }, + { + "name": "value", + "description": "the value passed to find", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1495, + "description": "

A hook you can use to setup the controller for the current route.

\n

This method is called with the controller for the current route and the\nmodel supplied by the model hook.

\n

By default, the setupController hook sets the model property of\nthe controller to the specified model when it is not undefined.

\n

If you implement the setupController hook in your Route, it will\nprevent this default behavior. If you want to preserve that behavior\nwhen implementing your setupController function, make sure to call\nsuper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/photos.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PhotosRoute extends Route {\n  model() {\n    return this.store.findAll('photo');\n  }\n\n  setupController(controller, model) {\n    super.setupController(controller, model);\n\n    this.controllerFor('application').set('showingPhotos', true);\n  }\n}
\n
\n
\n \n

The provided controller will be one resolved based on the name\nof this route.

\n

If no explicit controller is defined, Ember will automatically create one.

\n

As an example, consider the router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

If you have defined a file for the post controller,\nthe framework will use it.\nIf it is not defined, a basic Controller instance would be used.

\n", + "example": [ + " Behavior of a basic Controller\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, model) {\n controller.set('model', model);\n }\n});\n```" + ], + "itemtype": "method", + "name": "setupController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "model", + "description": "", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition", + "optional": true + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1571, + "description": "

Returns the controller of the current route, or a parent (or any ancestor)\nroute in a route hierarchy.

\n

The controller instance must already have been created, either through entering the\nassociated route or using generateController.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.controllerFor('posts').set('currentPost', post);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "controllerFor", + "params": [ + { + "name": "name", + "description": "the name of the route or controller", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Controller | undefined" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1625, + "description": "

Generates a controller for a route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class Post extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.generateController('posts');\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "generateController", + "params": [ + { + "name": "name", + "description": "the name of the controller", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1653, + "description": "

Returns the resolved model of a parent (or any ancestor) route\nin a route hierarchy. During a transition, all routes\nmust resolve a model object, and if a route\nneeds access to a parent route's model in order to\nresolve a model (or just reuse the model from a parent),\nit can call this.modelFor(theNameOfParentRoute) to\nretrieve it. If the ancestor route's model was a promise,\nits resolved result is returned.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' }, function() {\n    this.route('comments');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post/comments.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostCommentsRoute extends Route {\n  model() {\n    let post = this.modelFor('post');\n\n    return post.comments;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "modelFor", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "the model object", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1725, + "description": "

this[RENDER] is used to render a template into a region of another template\n(indicated by an {{outlet}}).

\n", + "itemtype": "method", + "name": "this[RENDER]", + "params": [ + { + "name": "name", + "description": "the name of the template to render", + "type": "String" + }, + { + "name": "options", + "description": "the options", + "type": "Object", + "optional": true, + "props": [ + { + "name": "into", + "description": "the template to render into,\n referenced by name. Defaults to the parent template", + "type": "String", + "optional": true + }, + { + "name": "outlet", + "description": "the outlet inside `options.into` to render into.\n Defaults to 'main'", + "type": "String", + "optional": true + }, + { + "name": "controller", + "description": "the controller to use for this template,\n referenced by name or as a controller instance. Defaults to the Route's paired controller", + "type": "String|Object", + "optional": true + }, + { + "name": "model", + "description": "the model object to set on `options.controller`.\n Defaults to the return value of the Route's model hook", + "type": "Object", + "optional": true + } + ] + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1752, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "teardownViews", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1765, + "description": "

Allows you to produce custom metadata for the route.\nThe return value of this method will be attached to\nits corresponding RouteInfoWithAttributes object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostsIndexRoute extends Route {\n  buildRouteInfoMetadata() {\n    return { title: 'Posts Page' }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service router\n\n  constructor() {\n    super(...arguments);\n\n    this.router.on('routeDidChange', transition => {\n      document.title = transition.to.metadata.title;\n      // would update document's title to "Posts Page"\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "buildRouteInfoMetadata", + "return": { + "description": "any" + }, + "since": "3.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2021, + "description": "

Sends an action to the router, which will delegate it to the currently\nactive route hierarchy per the bubbling rules explained under actions.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  track(arg) {\n    console.log(arg, 'was clicked');\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  trackIfDebug(arg) {\n    if (debug) {\n      this.send('track', arg);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "name", + "description": "the name of the action to trigger", + "type": "String" + }, + { + "name": "args", + "description": "", + "type": "...*" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2437, + "description": "

This action is called when one or more query params have changed. Bubbles.

\n", + "itemtype": "method", + "name": "queryParamsDidChange", + "params": [ + { + "name": "changed", + "description": "Keys are names of query params that have changed.", + "type": "Object" + }, + { + "name": "totalPresent", + "description": "Keys are names of query params that are currently set.", + "type": "Object" + }, + { + "name": "removed", + "description": "Keys are names of query params that have been removed.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 95, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 121, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 142, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 165, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 180, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 97, + "description": "

The willTransition action 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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ContactFormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData')) {\n      this.controller.displayNavigationConfirm();\n      transition.abort();\n    }\n  }\n}
\n
\n
\n \n

You can also redirect elsewhere by calling\nthis.transitionTo('elsewhere') from within willTransition.\nNote that willTransition will not be fired for the\nredirecting transitionTo, since willTransition doesn't\nfire when there is already a transition underway. If you want\nsubsequent willTransition actions to fire for the redirecting\ntransition, you must first explicitly call\ntransition.abort().

\n

To allow the willTransition event to continue bubbling to the parent\nroute, use return true;. When the willTransition method has a\nreturn value of true then the parent route's willTransition method\nwill be fired, enabling "bubbling" behavior for the event.

\n", + "itemtype": "event", + "name": "willTransition", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 142, + "description": "

The didTransition action is fired after a transition has\nsuccessfully been completed. This occurs after the normal model\nhooks (beforeModel, model, afterModel, setupController)\nhave resolved. The didTransition action has no arguments,\nhowever, it can be useful for tracking page views or resetting\nstate on the controller.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/login.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class LoginRoute extends Route {\n  @action\n  didTransition() {\n    this.controller.get('errors.base').clear();\n    return true; // Bubble the didTransition event\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "didTransition", + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 169, + "description": "

The loading action is fired on the route when a route's model\nhook returns a promise that is not already resolved. The current\nTransition object is the first parameter and the route that\ntriggered the loading event is the second parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  loading(transition, route) {\n    let controller = this.controllerFor('foo');\n\n    // The controller may not be instantiated when initially loading\n    if (controller) {\n      controller.currentlyLoading = true;\n\n      transition.finally(function() {\n        controller.currentlyLoading = false;\n      });\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "loading", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + }, + { + "name": "route", + "description": "The route that triggered the loading event", + "type": "Route" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 204, + "description": "

When attempting to transition into a route, any of the hooks\nmay return a promise that rejects, at which point an error\naction will be fired on the partially-entered routes, allowing\nfor per-route error handling logic, or shared error handling\nlogic defined on a parent route.

\n

Here is an example of an error handler that will be invoked\nfor rejected promises from the various hooks on the route,\nas well as any unhandled errors from child routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/admin.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { reject } from 'rsvp';\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class AdminRoute extends Route {\n  beforeModel() {\n    return reject('bad things!');\n  }\n\n  @action\n  error(error, transition) {\n    // Assuming we got here due to the error in `beforeModel`,\n    // we can expect that error === "bad things!",\n    // but a promise model rejecting would also\n    // call this hook, as would any errors encountered\n    // in `afterModel`.\n\n    // The `error` hook is also provided the failed\n    // `transition`, which can be stored and later\n    // `.retry()`d if desired.\n\n    this.transitionTo('login');\n  }\n}
\n
\n
\n \n

error actions that bubble up all the way to ApplicationRoute\nwill fire a default error handler that logs the error. You can\nspecify your own global default error handler by overriding the\nerror handler on ApplicationRoute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  error(error, transition) {\n    this.controllerFor('banner').displayError(error.message);\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "error", + "params": [ + { + "name": "error", + "description": "", + "type": "Error" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 817, + "description": "

This event is triggered when the router enters the route. It is\nnot executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  collectAnalytics: on('activate', function(){\n    collectAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "activate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 837, + "description": "

This event is triggered when the router completely exits this\nroute. It is not executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  trackPageLeaveAnalytics: on('deactivate', function(){\n    trackPageLeaveAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "deactivate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 379, + "description": "

Configuration hash for this route's queryParams. The possible\nconfiguration options and their defaults are as follows\n(assuming a query param whose controller property is page):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
queryParams = {\n  page: {\n    // By default, controller query param properties don't\n    // cause a full transition when they are changed, but\n    // rather only cause the URL to update. Setting\n    // `refreshModel` to true will cause an "in-place"\n    // transition to occur, whereby the model hooks for\n    // this route (and any child routes) will re-fire, allowing\n    // you to reload models (e.g., from the server) using the\n    // updated query param values.\n    refreshModel: false,\n\n    // By default, changes to controller query param properties\n    // cause the URL to update via `pushState`, which means an\n    // item will be added to the browser's history, allowing\n    // you to use the back button to restore the app to the\n    // previous state before the query param property was changed.\n    // Setting `replace` to true will use `replaceState` (or its\n    // hash location equivalent), which causes no browser history\n    // item to be added. This options name and default value are\n    // the same as the `link-to` helper's `replace` option.\n    replace: false,\n\n    // By default, the query param URL key is the same name as\n    // the controller property name. Use `as` to specify a\n    // different URL key.\n    as: 'page'\n  }\n};
\n
\n
\n \n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 432, + "description": "

The name of the template to use by default when rendering this route's\ntemplate.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/list.js
1\n2\n3\n4\n5\n
import Route from '@ember/routing/route';\n\nexport default class PostsListRoute extends Route {\n  templateName = 'posts/list';\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n
import PostsListRoute from '../posts/list';\n\nexport default class PostsIndexRoute extends PostsListRoute {};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/archived.js
1\n2\n3\n
import PostsListRoute from '../posts/list';\n\nexport default class PostsArchivedRoute extends PostsListRoute {};
\n
\n
\n \n", + "itemtype": "property", + "name": "templateName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 465, + "description": "

The name of the controller to associate with this route.

\n

By default, Ember will lookup a route's controller that matches the name\nof the route (i.e. posts.new). However,\nif you would like to define a specific controller to use, you can do so\nusing this property.

\n

This is useful in many ways, as the controller specified will be:

\n
    \n
  • passed to the setupController method.
  • \n
  • used as the controller for the template being rendered by the route.
  • \n
  • returned from a call to controllerFor for the route.
  • \n
\n", + "itemtype": "property", + "name": "controllerName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 488, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 519, + "description": "

The name of the route, dot-delimited.

\n

For example, a route found at app/routes/posts/post.js will have\na routeName of posts.post.

\n", + "itemtype": "property", + "name": "routeName", + "type": "String", + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 533, + "description": "

The name of the route, dot-delimited, including the engine prefix\nif applicable.

\n

For example, a route found at addon/routes/posts/post.js within an\nengine named admin will have a fullRouteName of admin.posts.post.

\n", + "itemtype": "property", + "name": "fullRouteName", + "type": "String", + "since": "2.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 597, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_activeQPChanged", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 738, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_optionsForQueryParam", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1816, + "description": "

Store property provides a hook for data persistence libraries to inject themselves.

\n

By default, this store property provides the exact same functionality previously\nin the model hook.

\n

Currently, the required interface is:

\n

store.find(modelName, findArguments)

\n", + "itemtype": "property", + "name": "store", + "type": "{Object}", + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1882, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_qp", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2406, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-RouteInfo-66db2e3fc5.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-RouteInfo-66db2e3fc5.json new file mode 100644 index 000000000..e13586cda --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-RouteInfo-66db2e3fc5.json @@ -0,0 +1,171 @@ +{ + "data": { + "id": "ember-4.5.1-RouteInfo", + "type": "class", + "attributes": { + "name": "RouteInfo", + "shortname": "RouteInfo", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 124, + "description": "

A RouteInfo is an object that contains metadata\nabout a specific route within a Transition. It is\nread-only and internally immutable. It is also not\nobservable, because a Transition instance is never\nchanged after creation.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 198, + "description": "

Allows you to traverse through the linked list\nof RouteInfos from the topmost to leafmost.\nReturns the first RouteInfo in the linked list\nfor which the callback returns true.

\n

This method is similar to the find() method\n defined in ECMAScript 2015.

\n

The callback method you provide should have the\n following signature (all parameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in\n the results, false otherwise.

\n

Note that in addition to a callback, you can also\n pass an optional target object that will be set as\n this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 135, + "description": "

The dot-separated, fully-qualified name of the\nroute, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 142, + "description": "

The final segment of the fully-qualified name of\nthe route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 149, + "description": "

The values of the route's parameters. These are the\nsame params that are received as arguments to the\nroute's model hook. Contains only the parameters\nvalid for this route, if any (params for parent or\nchild routes are not merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 159, + "description": "

The ordered list of the names of the params\nrequired for this route. It will contain the same\nstrings as Object.keys(params), but here the order\nis significant. This allows users to correctly pass\nparams into routes programmatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 169, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 175, + "description": "

Will contain the result Route#buildRouteInfoMetadata\nfor the corresponding Route.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 182, + "description": "

A reference to the parent route's RouteInfo.\nThis can be used to traverse upward to the topmost\nRouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 190, + "description": "

A reference to the child route's RouteInfo.\nThis can be used to traverse downward to the\nleafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-RouteInfoWithAttributes-6e894f2c86.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-RouteInfoWithAttributes-6e894f2c86.json new file mode 100644 index 000000000..ac0cd33d6 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-RouteInfoWithAttributes-6e894f2c86.json @@ -0,0 +1,183 @@ +{ + "data": { + "id": "ember-4.5.1-RouteInfoWithAttributes", + "type": "class", + "attributes": { + "name": "RouteInfoWithAttributes", + "shortname": "RouteInfoWithAttributes", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 7, + "description": "

A RouteInfoWithAttributes is an object that contains\nmetadata, including the resolved value from the routes\nmodel hook. Like RouteInfo, a RouteInfoWithAttributes\nrepresents a specific route within a Transition.\nIt is read-only and internally immutable. It is also not\nobservable, because a Transition instance is never\nchanged after creation.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 90, + "description": "

Allows you to traverse through the linked list\nof RouteInfos from the topmost to leafmost.\nReturns the first RouteInfo in the linked list\nfor which the callback returns true.

\n

This method is similar to the find() method\n defined in ECMAScript 2015.

\n

The callback method you provide should have the\n following signature (all parameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in\n the results, false otherwise.

\n

Note that in addition to a callback, you can also\n pass an optional target object that will be set as\n this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 20, + "description": "

The dot-separated, fully-qualified name of the\nroute, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 27, + "description": "

The final segment of the fully-qualified name of\nthe route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 34, + "description": "

The values of the route's parameters. These are the\nsame params that are received as arguments to the\nroute's model hook. Contains only the parameters\nvalid for this route, if any (params for parent or\nchild routes are not merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 44, + "description": "

The ordered list of the names of the params\nrequired for this route. It will contain the same\nstrings as Object.keys(params), but here the order\nis significant. This allows users to correctly pass\nparams into routes programmatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 54, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 60, + "description": "

This is the resolved return value from the\nroute's model hook.

\n", + "itemtype": "property", + "name": "attributes", + "type": "Object|Array|String|undefined", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 67, + "description": "

Will contain the result Route#buildRouteInfoMetadata\nfor the corresponding Route.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 74, + "description": "

A reference to the parent route's RouteInfo.\nThis can be used to traverse upward to the topmost\nRouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 82, + "description": "

A reference to the child route's RouteInfo.\nThis can be used to traverse downward to the\nleafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-RouterService-09fd542dcb.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-RouterService-09fd542dcb.json new file mode 100644 index 000000000..b7eb66b9c --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-RouterService-09fd542dcb.json @@ -0,0 +1,882 @@ +{ + "data": { + "id": "ember-4.5.1-RouterService", + "type": "class", + "attributes": { + "name": "RouterService", + "shortname": "RouterService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 23, + "description": "

The Router service is the public API that provides access to the router.

\n

The immediate benefit of the Router service is that you can inject it into components,\ngiving them a friendly way to initiate transitions and ask questions about the current\nglobal router state.

\n

In this example, the Router service is injected into a component to initiate a transition\nto a dedicated route:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class ExampleComponent extends Component {\n  @service router;\n\n  @action\n  next() {\n    this.router.transitionTo('other.route');\n  }\n}
\n
\n
\n \n

Like any service, it can also be injected into helpers, routes, etc.

\n", + "access": "public", + "tagname": "", + "extends": "Service", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 81, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n

Calling transitionTo from the Router service will cause default query parameter values to be included in the URL.\nThis behavior is different from calling transitionTo on a route or transitionToRoute on a controller.\nSee the Router Service RFC for more info.

\n

In the following example we use the Router service to navigate to a route with a\nspecific model from a Component in the first action, and in the second we trigger\na query-params only transition.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n  @service router;\n\n  @action\n  goToComments(post) {\n    this.router.transitionTo('comments', post);\n  }\n\n  @action\n  fetchMoreComments(latestComment) {\n    this.router.transitionTo({\n      queryParams: { commentsAfter: latestComment }\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 140, + "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

Calling 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 for more info.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class extends Route {\n  beforeModel() {\n    if (!authorized()){\n      this.replaceWith('unauthorized');\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL of the desired destination", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route i.e. an object of params to pass to the destination route", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 179, + "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

In this example, the URL for the author.books route for a given author\nis copied to the clipboard.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

Just like with transitionTo and replaceWith, urlFor can also handle\nquery parameters.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "urlFor", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) for the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the string representing the generated URL", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 252, + "description": "

Returns true if routeName/models/queryParams is the active route, where models and queryParams are optional.\nSee model and\nqueryParams for more information about these arguments.

\n

In the following example, isActive will return true if the current route is /posts.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

Where 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.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used when determining the active route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "true if the provided routeName/models/queryParams are active", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 356, + "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

See RouteInfo for more info.

\n

In the following example recognize is used to verify if a path belongs to our\napplication before transitioning to it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "recognize", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo | null" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 397, + "description": "

Takes a string URL and returns a promise that resolves to a\nRouteInfoWithAttributes 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.

\n", + "itemtype": "method", + "name": "recognizeAndLoad", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 419, + "description": "

You can register a listener for events emitted by this service with .on():

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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
\n \n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 446, + "description": "

You can unregister a listener for events emitted by this service with .off():

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 552, + "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.

\n", + "itemtype": "method", + "name": "refresh", + "params": [ + { + "name": "routeName", + "description": "the route to refresh (along with all child routes)", + "type": "String", + "optional": true + } + ], + "return": { + "description": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 478, + "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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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
\n \n

The 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.

\n", + "itemtype": "event", + "name": "routeWillChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 512, + "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

A good example is sending some analytics when the route has transitioned:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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 \n

routeDidChange will be called after any Route's\ndidTransition\naction has been fired.\nThe updates of properties\ncurrentURL,\ncurrentRouteName\nand\ncurrentRoute\nare completed at the time routeDidChange is called.

\n", + "itemtype": "event", + "name": "routeDidChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 582, + "description": "

Name of the current route.

\n

This property represents the logical name of the route,\n which is dot separated.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentRouteName", + "type": "{String | null}", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 612, + "description": "

Current URL for the application.

\n

This property represents the URL path for this route.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentURL", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 641, + "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

See Location for more information.

\n

To 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\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
\n \n

The following location types are available by default:\nauto, hash, history, none.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 681, + "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

If you change the rootURL in your environment configuration\nlike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\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
\n \n

This property will return /my-root.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 711, + "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

See RouteInfo for more info.

\n

This 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

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/header.js
1\n2\n3\n4\n5\n6\n7\n8\n9\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
\n
\n \n", + "itemtype": "property", + "name": "currentRoute", + "type": "RouteInfo", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-Service", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-Service-a1221cc952.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-Service-a1221cc952.json new file mode 100644 index 000000000..953d3f389 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-Service-a1221cc952.json @@ -0,0 +1,541 @@ +{ + "data": { + "id": "ember-4.5.1-Service", + "type": "class", + "attributes": { + "name": "Service", + "shortname": "Service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "file": "packages/@ember/service/index.ts", + "line": 90, + "extends": "EmberObject", + "since": "1.10.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 320, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 539, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 566, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 574, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 354, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 428, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 503, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 521, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.5.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.5.1-RouterService" + } + ] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-String-e2c97c5217.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-String-e2c97c5217.json new file mode 100644 index 000000000..0251280a2 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-String-e2c97c5217.json @@ -0,0 +1,200 @@ +{ + "data": { + "id": "ember-4.5.1-String", + "type": "class", + "attributes": { + "name": "String", + "shortname": "String", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/string", + "namespace": "", + "file": "packages/@ember/string/index.ts", + "line": 74, + "description": "

Defines string helper methods including string formatting and localization.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/string/index.ts", + "line": 81, + "description": "

Splits a string into separate units separated by spaces, eliminating any\nempty strings in the process.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { w } from '@ember/string';\n\nw("alpha beta gamma").forEach(function(key) {\n  console.log(key);\n});\n\n// > alpha\n// > beta\n// > gamma
\n
\n
\n \n", + "itemtype": "method", + "name": "w", + "params": [ + { + "name": "str", + "description": "The string to split", + "type": "String" + } + ], + "return": { + "description": "array containing the split strings", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 106, + "description": "

Converts a camelized string into all lower case separated by underscores.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { decamelize } from '@ember/string';\n\ndecamelize('innerHTML');          // 'inner_html'\ndecamelize('action_name');        // 'action_name'\ndecamelize('css-class-name');     // 'css-class-name'\ndecamelize('my favorite items');  // 'my favorite items'
\n
\n
\n \n", + "itemtype": "method", + "name": "decamelize", + "params": [ + { + "name": "str", + "description": "The string to decamelize.", + "type": "String" + } + ], + "return": { + "description": "the decamelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 127, + "description": "

Replaces underscores, spaces, or camelCase with dashes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { dasherize } from '@ember/string';\n\ndasherize('innerHTML');                // 'inner-html'\ndasherize('action_name');              // 'action-name'\ndasherize('css-class-name');           // 'css-class-name'\ndasherize('my favorite items');        // 'my-favorite-items'\ndasherize('privateDocs/ownerInvoice';  // 'private-docs/owner-invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "dasherize", + "params": [ + { + "name": "str", + "description": "The string to dasherize.", + "type": "String" + } + ], + "return": { + "description": "the dasherized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 149, + "description": "

Returns the lowerCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { camelize } from '@ember/string';\n\ncamelize('innerHTML');                   // 'innerHTML'\ncamelize('action_name');                 // 'actionName'\ncamelize('css-class-name');              // 'cssClassName'\ncamelize('my favorite items');           // 'myFavoriteItems'\ncamelize('My Favorite Items');           // 'myFavoriteItems'\ncamelize('private-docs/owner-invoice');  // 'privateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "camelize", + "params": [ + { + "name": "str", + "description": "The string to camelize.", + "type": "String" + } + ], + "return": { + "description": "the camelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 172, + "description": "

Returns the UpperCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { classify } from '@ember/string';\n\nclassify('innerHTML');                   // 'InnerHTML'\nclassify('action_name');                 // 'ActionName'\nclassify('css-class-name');              // 'CssClassName'\nclassify('my favorite items');           // 'MyFavoriteItems'\nclassify('private-docs/owner-invoice');  // 'PrivateDocs/OwnerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "classify", + "params": [ + { + "name": "str", + "description": "the string to classify", + "type": "String" + } + ], + "return": { + "description": "the classified string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 194, + "description": "

More general than decamelize. Returns the lower_case_and_underscored\nform of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { underscore } from '@ember/string';\n\nunderscore('innerHTML');                 // 'inner_html'\nunderscore('action_name');               // 'action_name'\nunderscore('css-class-name');            // 'css_class_name'\nunderscore('my favorite items');         // 'my_favorite_items'\nunderscore('privateDocs/ownerInvoice');  // 'private_docs/owner_invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "underscore", + "params": [ + { + "name": "str", + "description": "The string to underscore.", + "type": "String" + } + ], + "return": { + "description": "the underscored string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 217, + "description": "

Returns the Capitalized form of a string

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capitalize } from '@ember/string';\n\ncapitalize('innerHTML')                 // 'InnerHTML'\ncapitalize('action_name')               // 'Action_name'\ncapitalize('css-class-name')            // 'Css-class-name'\ncapitalize('my favorite items')         // 'My favorite items'\ncapitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "capitalize", + "params": [ + { + "name": "str", + "description": "The string to capitalize.", + "type": "String" + } + ], + "return": { + "description": "The capitalized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/string", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/classes/ember-4.5.1-rsvp-eeeff056e1.json b/json-docs/ember/4.5.1/classes/ember-4.5.1-rsvp-eeeff056e1.json new file mode 100644 index 000000000..a21430130 --- /dev/null +++ b/json-docs/ember/4.5.1/classes/ember-4.5.1-rsvp-eeeff056e1.json @@ -0,0 +1,445 @@ +{ + "data": { + "id": "ember-4.5.1-rsvp", + "type": "class", + "attributes": { + "name": "rsvp", + "shortname": "rsvp", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/all-settled.js", + "line": 20, + "description": "

RSVP.allSettled is similar to RSVP.all, but instead of implementing\na fail-fast method, it waits until all the promises have returned and\nshows you all the results. This is useful if you want to handle multiple\npromises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled. The return promise is fulfilled with an array of the states of\nthe promises passed into the promises array argument.

\n

Each state object will either indicate fulfillment or rejection, and\nprovide the corresponding value or reason. The states will take one of\nthe following formats:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{ state: 'fulfilled', value: value }\n  or\n{ state: 'rejected', reason: reason }
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
let promise1 = RSVP.Promise.resolve(1);\nlet promise2 = RSVP.Promise.reject(new Error('2'));\nlet promise3 = RSVP.Promise.reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nRSVP.allSettled(promises).then(function(array){\n  // array == [\n  //   { state: 'fulfilled', value: 1 },\n  //   { state: 'rejected', reason: Error },\n  //   { state: 'rejected', reason: Error }\n  // ]\n  // Note that for the second item, reason.message will be '2', and for the\n  // third item, reason.message will be '3'.\n}, function(error) {\n  // Not run. (This block would only be called if allSettled had failed,\n  // for instance if passed an incorrect argument type.)\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "allSettled", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "entries", + "description": "", + "type": "Array" + }, + { + "name": "label", + "description": "- optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with an array of the settled\nstates of the constituent promises.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/all.js", + "line": 3, + "description": "

This is a convenient alias for Promise.all.

\n", + "itemtype": "method", + "name": "all", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/defer.js", + "line": 3, + "description": "

defer returns an object similar to jQuery's $.Deferred.\ndefer should be used when porting over code reliant on $.Deferred's\ninterface. New code should use the Promise constructor instead.

\n

The object returned from defer is a plain object with three properties:

\n
    \n
  • promise - an Promise.
  • \n
  • reject - a function that causes the promise property on this object to\nbecome rejected
  • \n
  • resolve - a function that causes the promise property on this object to\nbecome fulfilled.
  • \n
\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let deferred = defer();\n\ndeferred.resolve("Success!");\n\ndeferred.promise.then(function(value){\n  // value here is "Success!"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "defer", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 19, + "description": "

EventTarget.mixin extends an object with EventTarget methods. For\nExample:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import EventTarget from 'rsvp';\n\nlet object = {};\n\nEventTarget.mixin(object);\n\nobject.on('finished', function(event) {\n  // handle event\n});\n\nobject.trigger('finished', { detail: value });
\n
\n
\n \n

EventTarget.mixin also works with prototypes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EventTarget from 'rsvp';\n\nlet Person = function() {};\nEventTarget.mixin(Person.prototype);\n\nlet yehuda = new Person();\nlet tom = new Person();\n\nyehuda.on('poke', function(event) {\n  console.log('Yehuda says OW');\n});\n\ntom.on('poke', function(event) {\n  console.log('Tom says OW');\n});\n\nyehuda.trigger('poke');\ntom.trigger('poke');
\n
\n
\n \n", + "itemtype": "method", + "name": "mixin", + "access": "private", + "tagname": "", + "params": [ + { + "name": "object", + "description": "object to extend with EventTarget methods", + "type": "Object" + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 107, + "description": "

You can use off to stop firing a particular callback for an event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function doStuff() { // do stuff! }\nobject.on('stuff', doStuff);\n\nobject.trigger('stuff'); // doStuff will be called\n\n// Unregister ONLY the doStuff callback\nobject.off('stuff', doStuff);\nobject.trigger('stuff'); // doStuff will NOT be called
\n
\n
\n \n

If you don't pass a callback argument to off, ALL callbacks for the\nevent will not be executed when the event fires. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let callback1 = function(){};\nlet callback2 = function(){};\n\nobject.on('stuff', callback1);\nobject.on('stuff', callback2);\n\nobject.trigger('stuff'); // callback1 and callback2 will be executed.\n\nobject.off('stuff');\nobject.trigger('stuff'); // callback1 and callback2 will not be executed!
\n
\n
\n \n", + "itemtype": "method", + "name": "off", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "event to stop listening to", + "type": "String" + }, + { + "name": "callback", + "description": "optional argument. If given, only the function\ngiven will be removed from the event's callback queue. If no `callback`\nargument is given, all callbacks will be removed from the event's callback\nqueue.", + "type": "Function", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 162, + "description": "

Use trigger to fire custom events. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
object.on('foo', function(){\n  console.log('foo event happened!');\n});\nobject.trigger('foo');\n// 'foo event happened!' logged to the console
\n
\n
\n \n

You can also pass a value as a second argument to trigger that will be\npassed as an argument to all event listeners for the event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
object.on('foo', function(value){\n  console.log(value.name);\n});\n\nobject.trigger('foo', { name: 'bar' });\n// 'bar' logged to the console
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "name of the event to be triggered", + "type": "String" + }, + { + "name": "options", + "description": "optional value to be passed to any event handlers for\nthe given `eventName`", + "type": "*", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/filter.js", + "line": 42, + "description": "

filter is similar to JavaScript's native filter method.\nfilterFn is eagerly called meaning that as soon as any promise\n resolves its value will be passed to filterFn. filter returns\n a promise that will become fulfilled with the result of running\n filterFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { filter, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\n\nlet promises = [promise1, promise2, promise3];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(result){\n  // result is [ 2, 3 ]\n});
\n
\n
\n \n

If any of the promises given to filter are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { filter, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

filter will also wait for any promises returned from filterFn.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter, resolve } from 'rsvp';\n\nlet alice = { name: 'alice' };\nlet bob   = { name: 'bob' };\nlet users = [ alice, bob ];\n\nlet promises = users.map(function(user){\n  return resolve(user);\n});\n\nlet filterFn = function(user){\n  // Here, Alice has permissions to create a blog post, but Bob does not.\n  return getPrivilegesForUser(user).then(function(privs){\n    return privs.can_create_blog_post === true;\n  });\n};\nfilter(promises, filterFn).then(function(users){\n  // true, because the server told us only Alice can create a blog post.\n  users.length === 1;\n  // false, because Alice is the only user present in `users`\n  users[0] === bob;\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "filterFn", + "description": "- function to be called on each resolved value to\n filter the final results.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string describing the promise. Useful for\n tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash-settled.js", + "line": 16, + "description": "

hashSettled is similar to allSettled, but takes an object\ninstead of an array for its promises argument.

\n

Unlike all or hash, which implement a fail-fast method,\nbut like allSettled, hashSettled waits until all the\nconstituent promises have returned and then shows you all the results\nwith their states and values/reasons. This is useful if you want to\nhandle multiple promises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled, or rejected if the passed parameters are invalid.

\n

The returned promise is fulfilled with a hash that has the same key names as\nthe promises object argument. If any of the values in the object are not\npromises, they will be copied over to the fulfilled object and marked with state\n'fulfilled'.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: { state: 'fulfilled', value: 1 },\n  //   yourPromise: { state: 'fulfilled', value: 2 },\n  //   theirPromise: { state: 'fulfilled', value: 3 },\n  //   notAPromise: { state: 'fulfilled', value: 4 }\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the state will\nbe set to 'rejected' and the reason for rejection provided.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, reject, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejection')),\n  anotherRejectedPromise: reject(new Error('more rejection')),\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise:              { state: 'fulfilled', value: 1 },\n  //   rejectedPromise:        { state: 'rejected', reason: Error },\n  //   anotherRejectedPromise: { state: 'rejected', reason: Error },\n  // }\n  // Note that for rejectedPromise, reason.message == 'rejection',\n  // and for anotherRejectedPromise, reason.message == 'more rejection'.\n});
\n
\n
\n \n

An important note: hashSettled is intended for plain JavaScript objects that\nare just a set of keys and values. hashSettled will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import Promise, { hashSettled, resolve } from 'rsvp';\n\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: Promise.resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhashSettled(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: { state: 'fulfilled', value: 'Example' }\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hashSettled", + "access": "public", + "tagname": "", + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when when all properties of `promises`\nhave been settled.", + "type": "Promise" + }, + "static": 1, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash.js", + "line": 4, + "description": "

hash is similar to all, but takes an object instead of an array\nfor its promises argument.

\n

Returns a promise that is fulfilled when all the given promises have been\nfulfilled, or rejected if any of them become rejected. The returned promise\nis fulfilled with a hash that has the same key names as the promises object\nargument. If any of the values in the object are not promises, they will\nsimply be copied over to the fulfilled object.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhash(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: 1,\n  //   yourPromise: 2,\n  //   theirPromise: 3,\n  //   notAPromise: 4\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the first promise\nthat is rejected will be given as the reason to the rejection handler.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejectedPromise')),\n  anotherRejectedPromise: reject(new Error('anotherRejectedPromise')),\n};\n\nhash(promises).then(function(hash){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === 'rejectedPromise'\n});
\n
\n
\n \n

An important note: hash is intended for plain JavaScript objects that\nare just a set of keys and values. hash will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { hash, resolve } from 'rsvp';\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhash(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: 'Example'\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all properties of `promises`\nhave been fulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/map.js", + "line": 39, + "description": "

map is similar to JavaScript's native map method. mapFn is eagerly called\n meaning that as soon as any promise resolves its value will be passed to mapFn.\n map returns a promise that will become fulfilled with the result of running\n mapFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(result){\n  // result is [ 2, 3, 4 ]\n});
\n
\n
\n \n

If any of the promises given to map are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { map, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

map will also wait if a promise is returned from mapFn. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first because they contain a url to those comments.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map } from 'rsvp';\n\nlet mapFn = function(blogPost){\n  // getComments does some ajax and returns an Promise that is fulfilled\n  // with some comments data\n  return getComments(blogPost.comments_url);\n};\n\n// getBlogPosts does some ajax and returns an Promise that is fulfilled\n// with some blog post data\nmap(getBlogPosts(), mapFn).then(function(comments){\n  // comments is the result of asking the server for the comments\n  // of all blog posts returned from getBlogPosts()\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "mapFn", + "description": "function to be called on each fulfilled promise.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\n Useful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/node.js", + "line": 44, + "description": "

denodeify takes a 'node-style' function and returns a function that\nwill return an Promise. You can use denodeify in Node.js or the\nbrowser when you'd prefer to use promises over using callbacks. For example,\ndenodeify transforms the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) return handleError(err);\n  handleData(data);\n});
\n
\n
\n \n

into:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\n\nreadFile('myfile.txt').then(handleData, handleError);
\n
\n
\n \n

If the node function has multiple success parameters, then denodeify\njust returns the first one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let request = denodeify(require('request'));\n\nrequest('http://example.com').then(function(res) {\n  // ...\n});
\n
\n
\n \n

However, if you need all success parameters, setting denodeify's\nsecond parameter to true causes it to return all success parameters\nas an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), true);\n\nrequest('http://example.com').then(function(result) {\n  // result[0] -> res\n  // result[1] -> body\n});
\n
\n
\n \n

Or if you pass it an array with names it returns the parameters as a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), ['res', 'body']);\n\nrequest('http://example.com').then(function(result) {\n  // result.res\n  // result.body\n});
\n
\n
\n \n

Sometimes you need to retain the this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let app = require('express')();\nlet render = denodeify(app.render.bind(app));
\n
\n
\n \n

The denodified function inherits from the original function. It works in all\nenvironments, except IE 10 and below. Consequently all properties of the original\nfunction are available to you. However, any properties you change on the\ndenodeified function won't be changed on the original function. Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request')),\n    cookieJar = request.jar(); // <- Inheritance is used here\n\nrequest('http://example.com', {jar: cookieJar}).then(function(res) {\n  // cookieJar.cookies holds now the cookies returned by example.com\n});
\n
\n
\n \n

Using denodeify makes it easier to compose asynchronous operations instead\nof using callbacks. For example, instead of:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) { ... } // Handle error\n  fs.writeFile('myfile2.txt', data, function(err){\n    if (err) { ... } // Handle error\n    console.log('done')\n  });\n});
\n
\n
\n \n

you can chain the operations together using then from the returned promise:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\nlet writeFile = denodeify(fs.writeFile);\n\nreadFile('myfile.txt').then(function(data){\n  return writeFile('myfile2.txt', data);\n}).then(function(){\n  console.log('done')\n}).catch(function(error){\n  // Handle error\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "denodeify", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "nodeFunc", + "description": "a 'node-style' function that takes a callback as\nits last argument. The callback expects an error to be passed as its first\nargument (if an error occurred, otherwise null), and the value from the\noperation as its second argument ('function(err, value){ }').", + "type": "Function" + }, + { + "name": "options", + "description": "An optional paramter that if set\nto `true` causes the promise to fulfill with the callback's success arguments\nas an array. This is useful if the node function has multiple success\nparamters. If you set this paramter to an array with names, the promise will\nfulfill with a hash with these names as keys and the success parameters as\nvalues.", + "type": "Boolean|Array", + "optional": true + } + ], + "return": { + "description": "a function that wraps `nodeFunc` to return a `Promise`", + "type": "Function" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/race.js", + "line": 3, + "description": "

This is a convenient alias for Promise.race.

\n", + "itemtype": "method", + "name": "race", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/reject.js", + "line": 3, + "description": "

This is a convenient alias for Promise.reject.

\n", + "itemtype": "method", + "name": "reject", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/resolve.js", + "line": 3, + "description": "

This is a convenient alias for Promise.resolve.

\n", + "itemtype": "method", + "name": "resolve", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "value", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/rethrow.js", + "line": 1, + "description": "

rethrow will rethrow an error on the next turn of the JavaScript event\nloop in order to aid debugging.

\n

Promises A+ specifies that any exceptions that occur with a promise must be\ncaught by the promises implementation and bubbled to the last handler. For\nthis reason, it is recommended that you always specify a second rejection\nhandler function to then. However, rethrow will throw the exception\noutside of the promise, so it bubbles up to your console if in the browser,\nor domain/cause uncaught exception in Node. rethrow will also throw the\nerror again so the error can be handled by the promise per the spec.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { rethrow } from 'rsvp';\n\nfunction throws(){\n  throw new Error('Whoops!');\n}\n\nlet promise = new Promise(function(resolve, reject){\n  throws();\n});\n\npromise.catch(rethrow).then(function(){\n  // Code here doesn't run because the promise became rejected due to an\n  // error!\n}, function (err){\n  // handle the error here\n});
\n
\n
\n \n

The 'Whoops' error will be thrown on the next turn of the event loop\nand you can watch for it in your console. You can also handle it using a\nrejection handler given to .then or .catch on the returned promise.

\n", + "itemtype": "method", + "name": "rethrow", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "reason the promise became rejected.", + "type": "Error" + } + ], + "throws": { + "description": "Error" + }, + "class": "rsvp", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/modules/ember-4.5.1-@ember/component-386767ada6.json b/json-docs/ember/4.5.1/modules/ember-4.5.1-@ember/component-386767ada6.json new file mode 100644 index 000000000..464895600 --- /dev/null +++ b/json-docs/ember/4.5.1/modules/ember-4.5.1-@ember/component-386767ada6.json @@ -0,0 +1,89 @@ +{ + "data": { + "id": "ember-4.5.1-@ember/component", + "type": "module", + "attributes": { + "name": "@ember/component", + "submodules": {}, + "elements": {}, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/component": 1, + "Ember.Templates.components": 1, + "@ember/component/helper": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 45, + "description": "

Glimmer is a templating engine used by Ember.js that is compatible with a subset of the Handlebars syntax.

\n

Showing a property

\n

Templates manage the flow of an application's UI, and display state (through\nthe DOM) to a user. For example, given a component with the property "name",\nthat component's template can use the name in several ways:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  name: 'Jill'\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
{{this.name}}\n<div>{{this.name}}</div>\n<span data-name={{this.name}}></span>
\n
\n
\n \n

Any time the "name" property on the component changes, the DOM will be\nupdated.

\n

Properties can be chained as well:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{@aUserModel.name}}\n<div>{{@listOfUsers.firstObject.name}}</div>
\n
\n
\n \n

Using Ember helpers

\n

When content is passed in mustaches {{}}, Ember will first try to find a helper\nor component with that name. For example, the if helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
{{if this.name "I have a name" "I have no name"}}\n<span data-has-name={{if this.name true}}></span>
\n
\n
\n \n

The returned value is placed where the {{}} is called. The above style is\ncalled "inline". A second style of helper usage is called "block". For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#if this.name}}\n  I have a name\n{{else}}\n  I have no name\n{{/if}}
\n
\n
\n \n

The block form of helpers allows you to control how the UI is created based\non the values of properties.\nA third form of helper is called "nested". For example here the concat\nhelper will add " Doe" to a displayed name if the person has no last name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<span data-name={{concat this.firstName (\n  if this.lastName (concat " " this.lastName) "Doe"\n)}}></span>
\n
\n
\n \n

Ember's built-in helpers are described under the Ember.Templates.helpers\nnamespace. Documentation on creating custom helpers can be found under\nhelper (or\nunder Helper if a helper requires access to\ndependency injection).

\n

Invoking a Component

\n

Ember components represent state to the UI of an application. Further\nreading on components can be found under Component.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "Component", + "Helper" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 267, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "allstaticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 267, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "version": "4.5.1" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/modules/ember-4.5.1-@glimmer/component-14a7e6b095.json b/json-docs/ember/4.5.1/modules/ember-4.5.1-@glimmer/component-14a7e6b095.json new file mode 100644 index 000000000..28620e61f --- /dev/null +++ b/json-docs/ember/4.5.1/modules/ember-4.5.1-@glimmer/component-14a7e6b095.json @@ -0,0 +1,36 @@ +{ + "data": { + "id": "ember-4.5.1-@glimmer/component", + "type": "module", + "attributes": { + "name": "@glimmer/component", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts", + "line": 1, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault components for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Template-only and Glimmer components. If you\nare looking for the API documentation for Classic components, it is\navailable here. The source code for\nGlimmer components can be found in @glimmer/component.

\n

Defining a Template-only Component

\n

The simplest way to create a component is to create a template file in\napp/templates/components. For example, if you name a template\napp/templates/components/person-profile.hbs:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
<h1>{{@person.name}}</h1>\n<img src={{@person.avatar}}>\n<p class='signature'>{{@person.signature}}</p>
\n
\n
\n \n

You will be able to use <PersonProfile /> to invoke this component elsewhere\nin your application:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<PersonProfile @person={{this.currentUser}} />
\n
\n
\n \n

Note that component names are capitalized here in order to distinguish them\nfrom regular HTML elements, but they are dasherized in the file system.

\n

While the angle bracket invocation form is generally preferred, it is also\npossible to invoke the same component with the {{person-profile}} syntax:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person-profile person=this.currentUser}}
\n
\n
\n \n

Note that with this syntax, you use dashes in the component name and\narguments are passed without the @ sign.

\n

In both cases, Ember will render the content of the component template we\ncreated above. The end result will be something like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\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 \n

File System Nesting

\n

Components can be nested inside sub-folders for logical groupping. For\nexample, if we placed our template in\napp/templates/components/person/short-profile.hbs, we can invoke it as\n<Person::ShortProfile />:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Person::ShortProfile @person={{this.currentUser}} />
\n
\n
\n \n

Or equivalently, {{person/short-profile}}:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person/short-profile person=this.currentUser}}
\n
\n
\n \n

Using Blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield}}
\n
\n
\n \n

We could then invoke it like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}}>\n  <p>Admin mode</p>\n</PersonProfile>
\n
\n
\n \n

or with curly syntax like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-profile person=this.currentUser}}\n  <p>Admin mode</p>\n{{/person-profile}}
\n
\n
\n \n

And 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

Blocks are executed in their original context, meaning they have access to the\nscope and any in-scope variables where they were defined.

\n

Passing parameters to blocks

\n

You can also pass positional parameters to {{yield}}, which are then made\navailable in the block:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

We can then use this value in the block like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}} as |signature|>\n  {{signature}}\n</PersonProfile>
\n
\n
\n \n

Passing multiple blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield to="title"}}</h1>\n{{yield}}
\n
\n
\n \n

This component could then be invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title>{{this.currentUser.name}}</:title>\n  <:default>{{this.currentUser.signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

When 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

Passing parameters to named blocks

\n

You can also pass parameters to named blocks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield @person.name to="title"}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

These parameters can then be used like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title as |name|>{{name}}</:title>\n  <:default as |signature|>{{signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

Checking to see if a block exists

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\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
\n \n

With this template, we can then optionally pass in one block, both blocks, or\nnone at all:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\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 \n

Checking to see if a block has parameters

\n

We can also check if a block receives parameters using the (has-block-params)\nkeyword, and conditionally yield different values if so.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
{{#if (has-block-params)}}\n  {{yield @person.signature}}\n{{else}}\n  {{yield}}\n{{/if}}
\n
\n
\n \n

Customizing Components With JavaScript

\n

To 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\nPersonProfile component which we defined above, we would create\napp/components/person-profile.js and export our class as the default, like\nso:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n \n

You 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\ndisplayName property of our PersonProfile component instance in the\ntemplate like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

constructor

\n

params: owner object and args object

\n

Constructs 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import 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
\n \n

Service injections and arguments are available in the constructor.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import 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 \n

willDestroy

\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import 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 \n

args

\n

The args property of Glimmer components is an object that contains the\narguments that are passed to the component. For instance, the\nfollowing component usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @fadeIn={{true}} />
\n
\n
\n \n

Would result in the following args object to be passed to the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ fadeIn: true }
\n
\n
\n \n

args can be accessed at any point in the component lifecycle, including\nconstructor and willDestroy. They are also automatically marked as tracked\nproperties, and they can be depended on as computed property dependencies:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import 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 \n

isDestroying

\n

A boolean flag to tell if the component is in the process of destroying. This is set to\ntrue before willDestroy is called.

\n

isDestroyed

\n

A boolean to tell if the component has been fully destroyed. This is set to true\nafter willDestroy is called.

\n", + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "4.5.1" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/namespaces/ember-4.5.1-AutoLocation-c465553b45.json b/json-docs/ember/4.5.1/namespaces/ember-4.5.1-AutoLocation-c465553b45.json new file mode 100644 index 000000000..75b9c6a47 --- /dev/null +++ b/json-docs/ember/4.5.1/namespaces/ember-4.5.1-AutoLocation-c465553b45.json @@ -0,0 +1,129 @@ +{ + "data": { + "id": "ember-4.5.1-AutoLocation", + "type": "namespace", + "attributes": { + "name": "AutoLocation", + "shortname": "AutoLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 22, + "description": "

AutoLocation will select the best location option based off browser\nsupport with the priority order: history, hash, none.

\n

Clean pushState paths accessed by hashchange-only browsers will be redirected\nto the hash-equivalent and vice versa so future transitions are consistent.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n

Browsers that support the history API will use HistoryLocation, those that\ndo not, but still support the hashchange event will use HashLocation, and\nin the rare case neither is supported will use NoneLocation.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'auto'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new for modern browsers that\nsupport the history api or /#/posts/new for older ones, like Internet\nExplorer 9 and below.

\n

When a user visits a link to your application, they will be automatically\nupgraded or downgraded to the appropriate Location class, with the URL\ntransformed accordingly, if needed.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n", + "static": 1, + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 354, + "access": "private", + "tagname": "Returns the current path as it should appear for HashLocation supported\nbrowsers. This may very well differ from the real current path.", + "itemtype": "method", + "name": "_getHashPath", + "class": "AutoLocation", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 80, + "access": "private", + "tagname": "Will be pre-pended to path upon state change.", + "since": "1.5.1", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 92, + "access": "private", + "tagname": "The browser's `location` object. This is typically equivalent to\n`window.location`, but may be overridden for testing.", + "itemtype": "property", + "name": "location", + "default": "environment.location", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 104, + "access": "private", + "tagname": "The browser's `history` object. This is typically equivalent to\n`window.history`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "history", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 117, + "access": "private", + "tagname": "The user agent's global variable. In browsers, this will be `window`.", + "since": "1.11", + "itemtype": "property", + "name": "global", + "default": "window", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 129, + "access": "private", + "tagname": "The browser's `userAgent`. This is typically equivalent to\n`navigator.userAgent`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "userAgent", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 142, + "access": "private", + "tagname": "This property is used by the router to know whether to cancel the routing\nsetup process, which is needed while we redirect the browser.", + "since": "1.5.1", + "itemtype": "property", + "name": "cancelRouterSetup", + "default": "false", + "class": "AutoLocation", + "module": "@ember/routing" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.5.1/namespaces/ember-4.5.1-Instrumentation-b12655591e.json b/json-docs/ember/4.5.1/namespaces/ember-4.5.1-Instrumentation-b12655591e.json new file mode 100644 index 000000000..73ccc1bcc --- /dev/null +++ b/json-docs/ember/4.5.1/namespaces/ember-4.5.1-Instrumentation-b12655591e.json @@ -0,0 +1,46 @@ +{ + "data": { + "id": "ember-4.5.1-Instrumentation", + "type": "namespace", + "attributes": { + "name": "Instrumentation", + "shortname": "Instrumentation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/instrumentation", + "namespace": "", + "file": "packages/@ember/instrumentation/index.ts", + "line": 40, + "description": "

The purpose of the Ember Instrumentation module is\nto provide efficient, general-purpose instrumentation\nfor Ember.

\n

Subscribe to a listener by using subscribe:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { subscribe } from '@ember/instrumentation';\n\nsubscribe("render", {\n  before(name, timestamp, payload) {\n\n  },\n\n  after(name, timestamp, payload) {\n\n  }\n});
\n
\n
\n \n

If you return a value from the before callback, that same\nvalue will be passed as a fourth parameter to the after\ncallback.

\n

Instrument a block of code by using instrument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { instrument } from '@ember/instrumentation';\n\ninstrument("render.handlebars", payload, function() {\n  // rendering logic\n}, binding);
\n
\n
\n \n

Event names passed to instrument are namespaced\nby periods, from more general to more specific. Subscribers\ncan listen for events by whatever level of granularity they\nare interested in.

\n

In the above example, the event is render.handlebars,\nand the subscriber listened for all events beginning with\nrender. It would receive callbacks for events named\nrender, render.handlebars, render.container, or\neven render.handlebars.layout.

\n", + "static": 1, + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.5.1-@ember/instrumentation", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.5.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/application-adcf29ad59.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/application-adcf29ad59.json new file mode 100644 index 000000000..2cef6e35e --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/application-adcf29ad59.json @@ -0,0 +1,138 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/application", + "type": "class", + "attributes": { + "name": "@ember/application", + "shortname": "@ember/application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 31, + "description": "

Framework objects in an Ember application (components, services, routes, etc.)\nare created via a factory and dependency injection system. Each of these\nobjects is the responsibility of an "owner", which handled its\ninstantiation and manages its lifetime.

\n

getOwner fetches the owner object responsible for an instance. This can\nbe used to lookup or resolve other class instances, or register new factories\ninto the owner.

\n

For example, this component dynamically looks up a service based on the\naudioType passed as an argument:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
audio.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getOwner } from '@ember/application';\n\n// Usage:\n//\n//   <PlayAudio @audioType={{@model.audioType}} @audioFile={{@model.file}}/>\n//\nexport default class extends Component {\n  get audioService() {\n    let owner = getOwner(this);\n    return owner.lookup(`service:${this.args.audioType}`);\n  }\n\n  @action\n  onPlay() {\n    let player = this.audioService;\n    player.play(this.args.audioFile);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "getOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object with an owner.", + "type": "Object" + } + ], + "return": { + "description": "An owner object.", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 79, + "description": "

setOwner forces a new owner on a given object instance. This is primarily\nuseful in some testing cases.

\n", + "itemtype": "method", + "name": "setOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object instance.", + "type": "Object" + }, + { + "name": "object", + "description": "The new owner object of the object instance.", + "type": "Object" + } + ], + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 14, + "description": "

Detects when a specific package of Ember (e.g. 'Application')\nhas fully loaded and is available for extension.

\n

The provided callback will be called with the name passed\nresolved from a string into the object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { onLoad } from '@ember/application';\n\nonLoad('Ember.Application' function(hbars) {\n  hbars.registerHelper(...);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "onLoad", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "callback", + "description": "callback to be called", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 47, + "description": "

Called when an Ember.js package (e.g Application) has finished\nloading. Triggers any callbacks registered for this event.

\n", + "itemtype": "method", + "name": "runLoadHooks", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "object", + "description": "object to pass to callbacks", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/component/helper-9bdfc6b428.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/component/helper-9bdfc6b428.json new file mode 100644 index 000000000..43b67e116 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/component/helper-9bdfc6b428.json @@ -0,0 +1,61 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/component/helper", + "type": "class", + "attributes": { + "name": "@ember/component/helper", + "shortname": "@ember/component/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 269, + "description": "

In many cases it is not necessary to use the full Helper class.\nThe helper method create pure-function helpers without instances.\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n
import { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n  return `${currency}${cents * 0.01}`;\n});
\n
\n
\n \n", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/controller-d8b8c7537b.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/controller-d8b8c7537b.json new file mode 100644 index 000000000..2d139b09b --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/controller-d8b8c7537b.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/controller", + "type": "class", + "attributes": { + "name": "@ember/controller", + "shortname": "@ember/controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 20, + "description": "

Creates a property that lazily looks up another controller in the container.\nCan only be used when defining another controller.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default class PostController extends Controller {\n  @controller posts;\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default Controller.extend({\n  posts: controller()\n});
\n
\n
\n \n

This example will create a posts property on the post controller that\nlooks up the posts controller in the container, making it easy to reference\nother controllers.

\n", + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the controller to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/controller", + "module": "@ember/controller" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/debug-ddc51c6fd5.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/debug-ddc51c6fd5.json new file mode 100644 index 000000000..836a03f9b --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/debug-ddc51c6fd5.json @@ -0,0 +1,310 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/debug", + "type": "class", + "attributes": { + "name": "@ember/debug", + "shortname": "@ember/debug", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 918, + "description": "

Allows checking if a given property on an object is a computed property. For the most part,\nthis doesn't matter (you would normally just access the property directly and use its value),\nbut for some tooling specific scenarios (e.g. the ember-inspector) it is important to\ndifferentiate if a property is a computed property or a "normal" property.

\n

This will work on either a class's prototype or an instance itself.

\n", + "static": 1, + "itemtype": "method", + "name": "isComputed", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/object" + }, + { + "file": "packages/@ember/debug/lib/capture-render-tree.ts", + "line": 9, + "description": "

Ember Inspector calls this function to capture the current render tree.

\n

In production mode, this requires turning on ENV._DEBUG_RENDER_TREE\nbefore loading Ember.

\n", + "access": "private", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "captureRenderTree", + "params": [ + { + "name": "app", + "description": "An `ApplicationInstance`.", + "type": "ApplicationInstance" + } + ], + "since": "3.14.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 37, + "description": "

Allows for runtime registration of handler functions that override the default deprecation behavior.\nDeprecations are invoked by calls to @ember/debug/deprecate.\nThe following example demonstrates its usage by registering a handler that throws an error if the\nmessage contains the word "should", otherwise defers to the default handler.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { registerDeprecationHandler } from '@ember/debug';\n\nregisterDeprecationHandler((message, options, next) => {\n  if (message.indexOf('should') !== -1) {\n    throw new Error(`Deprecation message with should: ${message}`);\n  } else {\n    // defer to whatever handler was registered before this one\n    next(message, options);\n  }\n});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the deprecation call.
  • \n
  • options - An object passed in with the deprecation call containing additional information including:
  • \n
      \n
    • id - An id of the deprecation in the form of package-name.specific-deprecation.
    • \n
    • until - The Ember version number the feature and deprecation will be removed in.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerDeprecationHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle deprecation calls.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 182, + "description": "

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only).

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n", + "itemtype": "method", + "name": "deprecate", + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "test", + "description": "A boolean. If falsy, the deprecation will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "", + "type": "Object", + "props": [ + { + "name": "id", + "description": "A unique id for this deprecation. The id can be\n used by Ember debugging tools to change the behavior (raise, log or silence)\n for that specific deprecation. The id should be namespaced by dots, e.g.\n \"view.helper.select\".", + "type": "String" + }, + { + "name": "until", + "description": "The version of Ember when this deprecation\n warning will be removed.", + "type": "String" + }, + { + "name": "for", + "description": "A namespace for the deprecation, usually the package name", + "type": "String" + }, + { + "name": "since", + "description": "Describes when the deprecation became available and enabled.", + "type": "Object" + }, + { + "name": "url", + "description": "An optional url to the transition guide on the\n emberjs.com website.", + "type": "String", + "optional": true + } + ] + } + ], + "static": 1, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 24, + "description": "

Allows for runtime registration of handler functions that override the default warning behavior.\nWarnings are invoked by calls made to @ember/debug/warn.\nThe following example demonstrates its usage by registering a handler that does nothing overriding Ember's\ndefault warning behavior.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { registerWarnHandler } from '@ember/debug';\n\n// next is not called, so no warnings get the default behavior\nregisterWarnHandler(() => {});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the warn call.
  • \n
  • options - An object passed in with the warn call containing additional information including:
  • \n
      \n
    • id - An id of the warning in the form of package-name.specific-warning.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWarnHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle warnings.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 71, + "description": "

Display a warning with the provided message.

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { warn } from '@ember/debug';\nimport tomsterCount from './tomster-counter'; // a module in my project\n\n// Log a warning if we have more than 3 tomsters\nwarn('Too many tomsters!', tomsterCount <= 3, {\n  id: 'ember-debug.too-many-tomsters'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "warn", + "static": 1, + "params": [ + { + "name": "message", + "description": "A warning to display.", + "type": "String" + }, + { + "name": "test", + "description": "An optional boolean. If falsy, the warning\n will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "An object that can be used to pass a unique\n `id` for this warning. The `id` can be used by Ember debugging tools\n to change the behavior (raise, log, or silence) for that specific warning.\n The `id` should be namespaced by dots, e.g. \"ember-debug.feature-flag-with-features-stripped\"", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 136, + "description": "

Verify that a certain expectation is met, or throw a exception otherwise.

\n

This is useful for communicating assumptions in the code to other human\nreaders as well as catching bugs that accidentally violates these\nexpectations.

\n

Assertions are removed from production builds, so they can be freely added\nfor documentation and debugging purposes without worries of incuring any\nperformance penalty. However, because of that, they should not be used for\nchecks that could reasonably fail during normal usage. Furthermore, care\nshould be taken to avoid accidentally relying on side-effects produced from\nevaluating the condition itself, since the code will not run in production.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assert } from '@ember/debug';\n\n// Test for truthiness\nassert('Must pass a string', typeof str === 'string');\n\n// Fail unconditionally\nassert('This code path should never be run');
\n
\n
\n \n", + "itemtype": "method", + "name": "assert", + "static": 1, + "params": [ + { + "name": "description", + "description": "Describes the expectation. This will become the\n text of the Error thrown if the assertion fails.", + "type": "String" + }, + { + "name": "condition", + "description": "Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.", + "type": "Any" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 176, + "description": "

Display a debug notice.

\n

Calls to this function are not invoked in production builds.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { debug } from '@ember/debug';\n\ndebug('I\\'m a debug notice!');
\n
\n
\n \n", + "itemtype": "method", + "name": "debug", + "static": 1, + "params": [ + { + "name": "message", + "description": "A debug message to display.", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 203, + "description": "

Display an info notice.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n", + "itemtype": "method", + "name": "info", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 222, + "description": "

Alias an old, deprecated method with its new counterpart.

\n

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only) when the assigned method is called.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { deprecateFunc } from '@ember/debug';\n\nEmber.oldMethod = deprecateFunc('Please use the new, updated method', options, Ember.newMethod);
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecateFunc", + "static": 1, + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "options", + "description": "The options object for `deprecate`.", + "type": "Object", + "optional": true + }, + { + "name": "func", + "description": "The new function called to replace its deprecated counterpart.", + "type": "Function" + } + ], + "return": { + "description": "A new function that wraps the original function with a deprecation warning", + "type": "Function" + }, + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 267, + "description": "

Run a function meant for debugging.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport { runInDebug } from '@ember/debug';\n\nrunInDebug(() => {\n  Component.reopen({\n    didInsertElement() {\n      console.log("I'm happy");\n    }\n  });\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "runInDebug", + "static": 1, + "params": [ + { + "name": "func", + "description": "The function to be executed.", + "type": "Function" + } + ], + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/destroyable-e80b59dfa3.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/destroyable-e80b59dfa3.json new file mode 100644 index 000000000..73cc743c0 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/destroyable-e80b59dfa3.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/destroyable", + "type": "class", + "attributes": { + "name": "@ember/destroyable", + "shortname": "@ember/destroyable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/destroyable", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/destroyable/index.ts", + "line": 31, + "description": "

This function is used to associate a destroyable object with a parent. When the parent\nis destroyed, all registered children will also be destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
class CustomSelect extends Component {\n  constructor(...args) {\n    super(...args);\n\n    // obj is now a child of the component. When the component is destroyed,\n    // obj will also be destroyed, and have all of its destructors triggered.\n    this.obj = associateDestroyableChild(this, {});\n  }\n}
\n
\n
\n \n

Returns the associated child for convenience.

\n", + "itemtype": "method", + "name": "associateDestroyableChild", + "params": [ + { + "name": "parent", + "description": "the destroyable to entangle the child destroyables lifetime with", + "type": "Object|Function" + }, + { + "name": "child", + "description": "the destroyable to be entangled with the parents lifetime", + "type": "Object|Function" + } + ], + "return": { + "description": "the child argument", + "type": "Object|Function" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 58, + "description": "

Receives a destroyable, and returns true if the destroyable has begun destroying. Otherwise returns\nfalse.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let obj = {};\nisDestroying(obj); // false\ndestroy(obj);\nisDestroying(obj); // true\n// ...sometime later, after scheduled destruction\nisDestroyed(obj); // true\nisDestroying(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroying", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 80, + "description": "

Receives a destroyable, and returns true if the destroyable has finished destroying. Otherwise\nreturns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let obj = {};\n\nisDestroyed(obj); // false\ndestroy(obj);\n\n// ...sometime later, after scheduled destruction\n\nisDestroyed(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroyed", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 103, + "description": "

Initiates the destruction of a destroyable object. It runs all associated destructors, and then\ndestroys all children recursively.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let obj = {};\n\nregisterDestructor(obj, () => console.log('destroyed!'));\n\ndestroy(obj); // this will schedule the destructor to be called\n\n// ...some time later, during scheduled destruction\n\n// destroyed!
\n
\n
\n \n

Destruction via destroy() follows these steps:

\n

1, Mark the destroyable such that isDestroying(destroyable) returns true\n2, Call destroy() on each of the destroyable's associated children\n3, Schedule calling the destroyable's destructors\n4, Schedule setting destroyable such that isDestroyed(destroyable) returns true

\n

This results in the entire tree of destroyables being first marked as destroying,\nthen having all of their destructors called, and finally all being marked as isDestroyed.\nThere won't be any in between states where some items are marked as isDestroying while\ndestroying, while others are not.

\n", + "itemtype": "method", + "name": "destroy", + "params": [ + { + "name": "destroyable", + "description": "the object to destroy", + "type": "Object|Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 138, + "description": "

This function asserts that all objects which have associated destructors or associated children\nhave been destroyed at the time it is called. It is meant to be a low level hook that testing\nframeworks can use to hook into and validate that all destroyables have in fact been destroyed.

\n

This function requires that enableDestroyableTracking was called previously, and is only\navailable in non-production builds.

\n", + "itemtype": "method", + "name": "assertDestroyablesDestroyed", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 152, + "description": "

This function instructs the destroyable system to keep track of all destroyables (their\nchildren, destructors, etc). This enables a future usage of assertDestroyablesDestroyed\nto be used to ensure that all destroyable tasks (registered destructors and associated children)\nhave completed when assertDestroyablesDestroyed is called.

\n", + "itemtype": "method", + "name": "enableDestroyableTracking", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 164, + "description": "

Receives a destroyable object and a destructor function, and associates the\nfunction with it. When the destroyable is destroyed with destroy, or when its\nparent is destroyed, the destructor function will be called.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, () => this.resize.unregister(this));\n  }\n}
\n
\n
\n \n

Multiple destructors can be associated with a given destroyable, and they can be\nassociated over time, allowing libraries to dynamically add destructors as needed.\nregisterDestructor also returns the associated destructor function, for convenience.

\n

The destructor function is passed a single argument, which is the destroyable itself.\nThis allows the function to be reused multiple times for many destroyables, rather\nthan creating a closure function per destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nfunction unregisterResize(instance) {\n  instance.resize.unregister(instance);\n}\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, unregisterResize);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "registerDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to register the destructor function with", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to run when the destroyable object is destroyed", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 229, + "description": "

Receives a destroyable and a destructor function, and de-associates the destructor\nfrom the destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor, unregisterDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service modals;\n\n  constructor(...args) {\n    super(...args);\n\n    this.modals.add(this);\n\n    this.modalDestructor = registerDestructor(this, () => this.modals.remove(this));\n  }\n\n  @action pinModal() {\n    unregisterDestructor(this, this.modalDestructor);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "unregisterDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to unregister the destructor function from", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to remove from the destroyable", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/destroyable", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/helper-ef0c2be820.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/helper-ef0c2be820.json new file mode 100644 index 000000000..0010234be --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/helper-ef0c2be820.json @@ -0,0 +1,128 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/helper", + "type": "class", + "attributes": { + "name": "@ember/helper", + "shortname": "@ember/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/helper", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/helper/index.ts", + "line": 5, + "description": "

capabilities returns a capabilities configuration which can be used to modify\nthe behavior of the manager. Manager capabilities must be provided using the\ncapabilities function, as the underlying implementation can change over time.

\n

The first argument to capabilities is a version string, which is the version of\nEmber that the capabilities were defined in. Ember can add new versions at any\ntime, and these may have entirely different behaviors, but it will not remove\nold versions until the next major version.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
capabilities('3.23');
\n
\n
\n \n

The second argument is an object of capabilities and boolean values indicating\nwhether they are enabled or disabled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
capabilities('3.23', {\n  hasValue: true,\n  hasDestructor: true,\n});
\n
\n
\n \n

If no value is specified, then the default value will be used.

\n

3.23 capabilities

\n

hasDestroyable

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a destroyable to include in the destructor\nhierarchy. If enabled, the getDestroyable hook will be called, and its result\nwill be associated with the destroyable parent block.

\n

hasValue

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a value which can be used externally. The helper's\ngetValue hook will be run whenever the value of the helper is accessed if this\ncapability is enabled.

\n", + "itemtype": "method", + "name": "capabilities", + "static": 1, + "params": [ + { + "name": "managerApiVersion", + "description": "The version of capabilities that are being used", + "type": "String" + }, + { + "name": "options", + "description": "The capabilities values" + } + ], + "return": { + "description": "The capabilities object instance", + "type": "Capabilities" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 58, + "description": "

Sets the helper manager for an object or function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
setHelperManager((owner) => new ClassHelperManager(owner), Helper)
\n
\n
\n \n

When a value is used as a helper in a template, the helper manager is looked up\non the object by walking up its prototype chain and finding the first helper\nmanager. This manager then receives the value and can create and manage an\ninstance of a helper from it. This provides a layer of indirection that allows\nusers to design high-level helper APIs, without Ember needing to worry about the\ndetails. High-level APIs can be experimented with and iterated on while the\ncore of Ember helpers remains stable, and new APIs can be introduced gradually\nover time to existing code bases.

\n

setHelperManager receives two arguments:

\n
    \n
  1. A factory function, which receives the owner and returns an instance of a\n helper manager.
  2. \n
  3. A helper definition, which is the object or function to associate the factory function with.
  4. \n
\n

The first time the object is looked up, the factory function will be called to\ncreate the helper manager. It will be cached, and in subsequent lookups the\ncached helper manager will be used instead.

\n

Only one helper manager is guaranteed to exist per owner and per usage of\nsetHelperManager, so many helpers will end up using the same instance of the\nhelper manager. As such, you should only store state that is related to the\nmanager itself. If you want to store state specific to a particular helper\ndefinition, you should assign a unique helper manager to that helper. In\ngeneral, most managers should either be stateless, or only have the owner they\nwere created with as state.

\n

Helper managers must fulfill the following interface (This example uses\nTypeScript interfaces\nfor precision, you do not need to write helper managers using TypeScript):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
interface HelperManager<HelperStateBucket> {\n  capabilities: HelperCapabilities;\n\n  createHelper(definition: HelperDefinition, args: TemplateArgs): HelperStateBucket;\n\n  getValue?(bucket: HelperStateBucket): unknown;\n\n  runEffect?(bucket: HelperStateBucket): void;\n\n  getDestroyable?(bucket: HelperStateBucket): object;\n}
\n
\n
\n \n

The capabilities property must be provided using the capabilities() function\nimported from the same module as setHelperManager:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capabilities } from '@ember/helper';\n\nclass MyHelperManager {\n  capabilities = capabilities('3.21.0', { hasValue: true });\n\n  // ...snip...\n}
\n
\n
\n \n

Below is a description of each of the methods on the interface and their\nfunctions.

\n

createHelper

\n

createHelper is a required hook on the HelperManager interface. The hook is\npassed the definition of the helper that is currently being created, and is\nexpected to return a state bucket. This state bucket is what represents the\ncurrent state of the helper, and will be passed to the other lifecycle hooks at\nappropriate times. It is not necessarily related to the definition of the\nhelper itself - for instance, you could return an object containing an\ninstance of the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
class MyManager {\n  createHelper(Definition, args) {\n    return {\n      instance: new Definition(args);\n    };\n  }\n}
\n
\n
\n \n

This allows the manager to store metadata that it doesn't want to expose to the\nuser.

\n

This hook is not autotracked - changes to tracked values used within this hook\nwill not result in a call to any of the other lifecycle hooks. This is because\nit is unclear what should happen if it invalidates, and rather than make a\ndecision at this point, the initial API is aiming to allow as much expressivity\nas possible. This could change in the future with changes to capabilities and\ntheir behaviors.

\n

If users do want to autotrack some values used during construction, they can\neither create the instance of the helper in runEffect or getValue, or they\ncan use the cache API to autotrack the createHelper hook themselves. This\nprovides maximum flexibility and expressiveness to manager authors.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called as discovered during DOM construction
  • \n
  • called in definition order in the template
  • \n
\n

getValue

\n

getValue is an optional hook that should return the value of the helper. This\nis the value that is returned from the helper and passed into the template.

\n

This hook is called when the value is requested from the helper (e.g. when the\ntemplate is rendering and the helper value is needed). The hook is autotracked,\nand will rerun whenever any tracked values used inside of it are updated.\nOtherwise it does not rerun.

\n
\n

Note: This means that arguments which are not consumed within the hook will\nnot trigger updates.

\n
\n

This hook is only called for helpers with the hasValue capability enabled.\nThis hook has the following timing semantics:

\n

Always

\n
    \n
  • called the first time the helper value is requested
  • \n
  • called after autotracked state has changed
  • \n
\n

Never

\n
    \n
  • called if the hasValue capability is disabled
  • \n
\n

runEffect

\n

runEffect is an optional hook that should run the effect that the helper is\napplying, setting it up or updating it.

\n

This hook is scheduled to be called some time after render and prior to paint.\nThere is not a guaranteed, 1-to-1 relationship between a render pass and this\nhook firing. For instance, multiple render passes could occur, and the hook may\nonly trigger once. It may also never trigger if it was dirtied in one render\npass and then destroyed in the next.

\n

The hook is autotracked, and will rerun whenever any tracked values used inside\nof it are updated. Otherwise it does not rerun.

\n

The hook is also run during a time period where state mutations are disabled\nin Ember. Any tracked state mutation will throw an error during this time,\nincluding changes to tracked properties, changes made using Ember.set, updates\nto computed properties, etc. This is meant to prevent infinite rerenders and\nother antipatterns.

\n

This hook is only called for helpers with the hasScheduledEffect capability\nenabled. This hook is also not called in SSR currently, though this could be\nadded as a capability in the future. It has the following timing semantics:

\n

Always

\n
    \n
  • called after the helper was first created, if the helper has not been\ndestroyed since creation
  • \n
  • called after autotracked state has changed, if the helper has not been\ndestroyed during render
  • \n
\n

Never

\n
    \n
  • called if the hasScheduledEffect capability is disabled
  • \n
  • called in SSR
  • \n
\n

getDestroyable

\n

getDestroyable is an optional hook that users can use to register a\ndestroyable object for the helper. This destroyable will be registered to the\ncontaining block or template parent, and will be destroyed when it is destroyed.\nSee the Destroyables RFC\nfor more details.

\n

getDestroyable is only called if the hasDestroyable capability is enabled.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called immediately after the createHelper hook is called
  • \n
\n

Never

\n
    \n
  • called if the hasDestroyable capability is disabled
  • \n
\n", + "itemtype": "method", + "name": "setHelperManager", + "static": 1, + "params": [ + { + "name": "factory", + "description": "A factory function which receives an optional owner, and returns a helper manager", + "type": "Function" + }, + { + "name": "definition", + "description": "The definition to associate the manager factory with", + "type": "Object" + } + ], + "return": { + "description": "The definition passed into setHelperManager", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 251, + "description": "

The invokeHelper function can be used to create a helper instance in\nJavaScript.

\n

To access a helper's value you have to use getValue from\n@glimmer/tracking/primitives/cache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
// app/components/data-loader.js\nimport Component from '@glimmer/component';\nimport { getValue } from '@glimmer/tracking/primitives/cache';\nimport Helper from '@ember/component/helper';\nimport { invokeHelper } from '@ember/helper';\n\nclass PlusOne extends Helper {\n  compute([number]) {\n    return number + 1;\n  }\n}\n\nexport default class PlusOneComponent extends Component {\n  plusOne = invokeHelper(this, PlusOne, () => {\n    return {\n      positional: [this.args.number],\n    };\n  });\n\n  get value() {\n    return getValue(this.plusOne);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{this.value}}
\n
\n
\n \n

It receives three arguments:

\n
    \n
  • context: The parent context of the helper. When the parent is torn down and\nremoved, the helper will be as well.
  • \n
  • definition: The definition of the helper.
  • \n
  • computeArgs: An optional function that produces the arguments to the helper.\nThe function receives the parent context as an argument, and must return an\nobject with a positional property that is an array and/or a named\nproperty that is an object.
  • \n
\n

And it returns a Cache instance that contains the most recent value of the\nhelper. You can access the helper using getValue() like any other cache. The\ncache is also destroyable, and using the destroy() function on it will cause\nthe helper to be torn down.

\n

Note that using getValue() on helpers that have scheduled effects will not\ntrigger the effect early. Effects will continue to run at their scheduled time.

\n", + "itemtype": "method", + "name": "invokeHelper", + "static": 1, + "params": [ + { + "name": "context", + "description": "The parent context of the helper", + "type": "Object" + }, + { + "name": "definition", + "description": "The helper definition", + "type": "Object" + }, + { + "name": "computeArgs", + "description": "An optional function that produces args", + "type": "Function" + } + ], + "return": { + "description": "" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/helper", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/object-fdba9255ac.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/object-fdba9255ac.json new file mode 100644 index 000000000..7827cbed4 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/object-fdba9255ac.json @@ -0,0 +1,521 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/object", + "type": "class", + "attributes": { + "name": "@ember/object", + "shortname": "@ember/object", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 730, + "description": "

This helper returns a new property descriptor that wraps the passed\ncomputed property function. You can use this helper to define properties with\nnative decorator syntax, mixins, or via defineProperty().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', function() {\n    return `${this.get('firstName')} ${this.get('lastName')}`;\n  })\n});\n\nlet client = Person.create();\n\nclient.get('fullName'); // 'Betty Jones'\n\nclient.set('lastName', 'Fuller');\nclient.get('fullName'); // 'Betty Fuller'
\n
\n
\n \n

You can also provide a setter, either directly on the class using native class\nsyntax, or by passing a hash with get and set functions.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(/\\s+/);\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n\n    return value;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', {\n    get(key) {\n      return `${this.get('firstName')} ${this.get('lastName')}`;\n    },\n    set(key, value) {\n      let [firstName, lastName] = value.split(/\\s+/);\n      this.setProperties({ firstName, lastName });\n      return value;\n    }\n  })\n});\n\nlet client = Person.create();\nclient.get('firstName'); // 'Betty'\n\nclient.set('fullName', 'Carroll Fuller');\nclient.get('firstName'); // 'Carroll'
\n
\n
\n \n

When passed as an argument, the set function should accept two parameters,\nkey and value. The value returned from set will be the new value of the\nproperty.

\n

Note: This is the preferred way to define computed properties when writing third-party\nlibraries that depend on or use Ember, since there is no guarantee that the user\nwill have prototype Extensions enabled.

\n", + "itemtype": "method", + "name": "computed", + "static": 1, + "params": [ + { + "name": "dependentKeys*", + "description": "Optional dependent keys that trigger this computed property.", + "type": "String", + "optional": true + }, + { + "name": "func", + "description": "The computed property function.", + "type": "Function" + } + ], + "return": { + "description": "property decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/get_properties.ts", + "line": 6, + "description": "

To get multiple properties at once, call getProperties\nwith an object followed by a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, 'firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, ['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + }, + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 772, + "description": "

Specify a method that observes property changes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nimport { observer } from '@ember/object';\n\nexport default EmberObject.extend({\n  valueObserver: observer('value', function() {\n    // Executes whenever the "value" property changes\n  })\n});
\n
\n
\n \n

Also available as Function.prototype.observes if prototype extensions are\nenabled.

\n", + "itemtype": "method", + "name": "observer", + "params": [ + { + "name": "propertyNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "func" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/properties.ts", + "line": 13, + "description": "

NOTE: This is a low-level method used by other parts of the API. You almost\nnever want to call this method directly. Instead you should use\nmixin() to define new properties.

\n

Defines a property on an object. This method works much like the ES5\nObject.defineProperty() method except that it can also accept computed\nproperties and other special descriptors.

\n

Normally this method takes only three parameters. However if you pass an\ninstance of Descriptor as the third param then you can pass an\noptional value as the fourth parameter. This is often more efficient than\ncreating new descriptor hashes for each property.

\n

Examples

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { defineProperty, computed } from '@ember/object';\n\n// ES5 compatible mode\ndefineProperty(contact, 'firstName', {\n  writable: true,\n  configurable: false,\n  enumerable: true,\n  value: 'Charles'\n});\n\n// define a simple property\ndefineProperty(contact, 'lastName', undefined, 'Jolley');\n\n// define a computed property\ndefineProperty(contact, 'fullName', computed('firstName', 'lastName', function() {\n  return this.firstName+' '+this.lastName;\n}));
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "defineProperty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "the object to define this property on. This may be a prototype.", + "type": "Object" + }, + { + "name": "keyName", + "description": "the name of the property", + "type": "String" + }, + { + "name": "desc", + "description": "an instance of `Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.", + "type": "Descriptor", + "optional": true + }, + { + "name": "data", + "description": "something other than a descriptor, that will\n become the explicit value of this property.", + "type": "*", + "optional": true + } + ], + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 32, + "description": "

This function is called just after an object property has changed.\nIt will notify any observers and clear caches among other things.

\n

Normally you will not need to call this method directly but if for some\nreason you can't directly watch a property you can invoke this method\nmanually.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "obj", + "description": "The object with the property that will change", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key (or path) that will change.", + "type": "String" + }, + { + "name": "_meta", + "description": "The objects meta.", + "type": "Meta", + "optional": true + }, + { + "name": "value", + "description": "The new value to set for the property", + "type": "Unknown", + "optional": true + } + ], + "return": { + "description": "", + "type": "Void" + }, + "since": "3.1.0", + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 83, + "itemtype": "method", + "name": "beginPropertyChanges", + "chainable": 1, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 93, + "itemtype": "method", + "name": "endPropertyChanges", + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 105, + "description": "

Make a series of property changes together in an\nexception-safe way.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
Ember.changeProperties(function() {\n  obj1.set('foo', mayBlowUpWhenSet);\n  obj2.set('bar', baz);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "changeProperties", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_get.ts", + "line": 50, + "description": "

Gets the value of a property on an object. If the property is computed,\nthe function will be invoked. If the property is not defined but the\nobject implements the unknownProperty method then that will be invoked.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { get } from '@ember/object';\nget(obj, "name");
\n
\n
\n \n

If you plan to run on IE8 and older browsers then you should use this\nmethod anytime you want to retrieve a property on an object that you don't\nknow for sure is private. (Properties beginning with an underscore '_'\nare considered private.)

\n

On all newer browsers, you only need to use this method to retrieve\nproperties if the property might not be defined on the object and you want\nto respect the unknownProperty handler. Otherwise you can ignore this\nmethod.

\n

Note that if the object itself is undefined, this method will throw\nan error.

\n", + "itemtype": "method", + "name": "get", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to retrieve from.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to retrieve", + "type": "String" + } + ], + "return": { + "description": "the property value or `null`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 18, + "description": "

Sets the value of a property on an object, respecting computed properties\nand notifying observers and other listeners of the change.\nIf the specified property is not defined on the object and the object\nimplements the setUnknownProperty method, then instead of setting the\nvalue of the property on the object, its setUnknownProperty handler\nwill be invoked with the two parameters keyName and value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { set } from '@ember/object';\nset(obj, "name", value);
\n
\n
\n \n", + "itemtype": "method", + "name": "set", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "return": { + "description": "the passed value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 124, + "description": "

Error-tolerant form of set. Will not blow up if any part of the\nchain is undefined, null, or destroyed.

\n

This is primarily used when syncing bindings, which may try to update after\nan object has been destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { trySet } from '@ember/object';\n\nlet obj = { name: "Zoey" };\ntrySet(obj, "contacts.twitter", "@emberjs");
\n
\n
\n \n", + "itemtype": "method", + "name": "trySet", + "static": 1, + "params": [ + { + "name": "root", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "path", + "description": "The property path to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/set_properties.ts", + "line": 6, + "description": "

Set a list of properties on an object. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nlet anObject = EmberObject.create();\n\nanObject.setProperties({\n  firstName: 'Stanley',\n  lastName: 'Stuart',\n  age: 21\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "properties", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "properties" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 618, + "description": "

Creates a new subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(thing);\n   }\n});
\n
\n
\n \n

This defines a new subclass of EmberObject: Person. It contains one method: say().

\n

You can also create a subclass from any existing class by calling its extend() method.\nFor example, you might want to create a subclass of Ember's built-in Component class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nconst PersonComponent = Component.extend({\n  tagName: 'li',\n  classNameBindings: ['isAdministrator']\n});
\n
\n
\n \n

When defining a subclass, you can override methods but still access the\nimplementation of your parent class by calling the special _super() method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    let name = this.get('name');\n    alert(`${name} says: ${thing}`);\n  }\n});\n\nconst Soldier = Person.extend({\n  say(thing) {\n    this._super(`${thing}, sir!`);\n  },\n  march(numberOfHours) {\n    alert(`${this.get('name')} marches for ${numberOfHours} hours.`);\n  }\n});\n\nlet yehuda = Soldier.create({\n  name: 'Yehuda Katz'\n});\n\nyehuda.say('Yes');  // alerts "Yehuda Katz says: Yes, sir!"
\n
\n
\n \n

The create() on line #17 creates an instance of the Soldier class.\nThe extend() on line #8 creates a subclass of Person. Any instance\nof the Person class will not have the march() method.

\n

You can also pass Mixin classes to add additional properties to the subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import EmberObject from '@ember/object';\nimport Mixin from '@ember/object/mixin';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(`${this.get('name')} says: ${thing}`);\n  }\n});\n\nconst SingingMixin = Mixin.create({\n  sing(thing) {\n    alert(`${this.get('name')} sings: la la la ${thing}`);\n  }\n});\n\nconst BroadwayStar = Person.extend(SingingMixin, {\n  dance() {\n    alert(`${this.get('name')} dances: tap tap tap tap `);\n  }\n});
\n
\n
\n \n

The BroadwayStar class contains three methods: say(), sing(), and dance().

\n", + "itemtype": "method", + "name": "extend", + "static": 1, + "params": [ + { + "name": "mixins", + "description": "One or more Mixin classes", + "type": "Mixin", + "optional": true, + "multiple": true + }, + { + "name": "arguments", + "description": "Object containing values to use within the new class", + "type": "Object", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 722, + "description": "

Creates an instance of a class. Accepts either no arguments, or an object\ncontaining values to initialize the newly instantiated object with.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  helloWorld() {\n    alert(`Hi, my name is ${this.get('name')}`);\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\n\ntom.helloWorld(); // alerts "Hi, my name is Tom Dale".
\n
\n
\n \n

create will call the init function if defined during\nAnyObject.extend

\n

If no arguments are passed to create, it will not set values to the new\ninstance during initialization:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let noName = Person.create();\nnoName.helloWorld(); // alerts undefined
\n
\n
\n \n

NOTE: For performance reasons, you cannot declare methods or computed\nproperties during create. You should instead declare methods and computed\nproperties when using extend.

\n", + "itemtype": "method", + "name": "create", + "static": 1, + "params": [ + { + "name": "arguments", + "description": "", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 787, + "description": "

Augments a constructor's prototype with additional\nproperties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\no = MyObject.create();\no.get('name'); // 'an object'\n\nMyObject.reopen({\n  say(msg) {\n    console.log(msg);\n  }\n});\n\no2 = MyObject.create();\no2.say('hello'); // logs "hello"\n\no.say('goodbye'); // logs "goodbye"
\n
\n
\n \n

To add functions and properties to the constructor itself,\nsee reopenClass

\n", + "itemtype": "method", + "name": "reopen", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 841, + "description": "

Augments a constructor's own properties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\nMyObject.reopenClass({\n  canBuild: false\n});\n\nMyObject.canBuild; // false\no = MyObject.create();
\n
\n
\n \n

In other words, this creates static properties and functions for the class.\nThese are only available on the class and not on any instance of that class.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  name: '',\n  sayHello() {\n    alert(`Hello. My name is ${this.get('name')}`);\n  }\n});\n\nPerson.reopenClass({\n  species: 'Homo sapiens',\n\n  createPerson(name) {\n    return Person.create({ name });\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\nlet yehuda = Person.createPerson('Yehuda Katz');\n\ntom.sayHello(); // "Hello. My name is Tom Dale"\nyehuda.sayHello(); // "Hello. My name is Yehuda Katz"\nalert(Person.species); // "Homo sapiens"
\n
\n
\n \n

Note that species and createPerson are not valid on the tom and yehuda\nvariables. They are only valid on Person.

\n

To add functions and properties to instances of\na constructor by extending the constructor's prototype\nsee reopen

\n", + "itemtype": "method", + "name": "reopenClass", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 924, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For\nexample, computed property functions may close over variables that are then\nno longer available for introspection.

\n

You can pass a hash of these values to a computed property like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { computed } from '@ember/object';\n\nperson: computed(function() {\n  let personId = this.get('personId');\n  return Person.create({ id: personId });\n}).meta({ type: Person })
\n
\n
\n \n

Once you've done this, you can retrieve the values saved to the computed\nproperty from your class like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyClass.metaForProperty('person');
\n
\n
\n \n

This will return the original hash that was passed to meta().

\n", + "static": 1, + "itemtype": "method", + "name": "metaForProperty", + "params": [ + { + "name": "key", + "description": "property name", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 967, + "description": "

Iterate over each computed property for the class, passing its name\nand any associated metadata (see metaForProperty) to the callback.

\n", + "static": 1, + "itemtype": "method", + "name": "eachComputedProperty", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "binding", + "description": "", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 1059, + "description": "

Provides lookup-time type validation for injected properties.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_onLookup", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 1080, + "description": "

Returns a hash of property names and container names that injected\nproperties will lookup on the container lazily.

\n", + "itemtype": "method", + "name": "_lazyInjections", + "return": { + "description": "Hash of all lazy injected property keys to container names", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/index.ts", + "line": 19, + "description": "

Decorator that turns the target function into an Action which can be accessed\ndirectly by reference.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action this.toggleShowing}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

Decorated actions also interop with the string style template actions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action "toggleShowing"}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

It also binds the function directly to the instance, so it can be used in any\ncontext and will correctly refer to the class it came from:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert this.toggleShowing}}\n  {{on "click" this.toggleShowing}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

This can also be used in JavaScript code directly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  constructor() {\n    super(...arguments);\n\n    // this.toggleShowing is still bound correctly when added to\n    // the event listener\n    document.addEventListener('click', this.toggleShowing);\n  }\n\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n

This is considered best practice, since it means that methods will be bound\ncorrectly no matter where they are used. By contrast, the {{action}} helper\nand modifier can also be used to bind context, but it will be required for\nevery usage of the method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert (action this.toggleShowing)}}\n  {{on "click" (action this.toggleShowing)}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

They also do not have equivalents in JavaScript directly, so they cannot be\nused for other situations where binding would be useful.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "action", + "static": 1, + "params": [ + { + "name": "callback", + "description": "The function to turn into an action,\n when used in classic classes", + "type": "Function|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/object/compat-2053686aea.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/object/compat-2053686aea.json new file mode 100644 index 000000000..02f886df4 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/object/compat-2053686aea.json @@ -0,0 +1,64 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/object/compat", + "type": "class", + "attributes": { + "name": "@ember/object/compat", + "shortname": "@ember/object/compat", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/object/compat.ts", + "line": 40, + "description": "

@dependentKeyCompat is decorator that can be used on native getters that\nuse tracked properties. It exposes the getter to Ember's classic computed\nproperty and observer systems, so they can watch it for changes. It can be\nused in both native and classic classes.

\n

Native Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { computed, set } from '@ember/object';\n\nclass Person {\n  @tracked firstName;\n  @tracked lastName;\n\n  @dependentKeyCompat\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nclass Profile {\n  constructor(person) {\n    set(this, 'person', person);\n  }\n\n  @computed('person.fullName')\n  get helloMessage() {\n    return `Hello, ${this.person.fullName}!`;\n  }\n}
\n
\n
\n \n

Classic Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport EmberObject, { computed, observer, set } from '@ember/object';\n\nconst Person = EmberObject.extend({\n  firstName: tracked(),\n  lastName: tracked(),\n\n  fullName: dependentKeyCompat(function() {\n    return `${this.firstName} ${this.lastName}`;\n  }),\n});\n\nconst Profile = EmberObject.extend({\n  person: null,\n\n  helloMessage: computed('person.fullName', function() {\n    return `Hello, ${this.person.fullName}!`;\n  }),\n\n  onNameUpdated: observer('person.fullName', function() {\n    console.log('person name updated!');\n  }),\n});
\n
\n
\n \n

dependentKeyCompat() can receive a getter function or an object containing\nget/set methods when used in classic classes, like computed properties.

\n

In general, only properties which you expect to be watched by older,\nuntracked clases should be marked as dependency compatible. The decorator is\nmeant as an interop layer for parts of Ember's older classic APIs, and should\nnot be applied to every possible getter/setter in classes. The number of\ndependency compatible getters should be minimized wherever possible. New\napplication code should not need to use @dependentKeyCompat, since it is\nonly for interoperation with older code.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "dependentKeyCompat", + "static": 1, + "params": [ + { + "name": "desc", + "description": "A property descriptor containing\n the getter and setter (when used in\n classic classes)", + "type": "PropertyDescriptor|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object/compat", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/object/computed-16bbecd6bb.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/object/computed-16bbecd6bb.json new file mode 100644 index 000000000..cd1ce7f2c --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/object/computed-16bbecd6bb.json @@ -0,0 +1,903 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/object/computed", + "type": "class", + "attributes": { + "name": "@ember/object/computed", + "shortname": "@ember/object/computed", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/expand_properties.ts", + "line": 9, + "description": "

Expands pattern, invoking callback for each expansion.

\n

The only pattern supported is brace-expansion, anything else will be passed\nonce to callback directly.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { expandProperties } from '@ember/object/computed';\n\nfunction echo(arg){ console.log(arg); }\n\nexpandProperties('foo.bar', echo);              //=> 'foo.bar'\nexpandProperties('{foo,bar}', echo);            //=> 'foo', 'bar'\nexpandProperties('foo.{bar,baz}', echo);        //=> 'foo.bar', 'foo.baz'\nexpandProperties('{foo,bar}.baz', echo);        //=> 'foo.baz', 'bar.baz'\nexpandProperties('foo.{bar,baz}.[]', echo)      //=> 'foo.bar.[]', 'foo.baz.[]'\nexpandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs'\nexpandProperties('{foo}.bar.{baz}')             //=> 'foo.bar.baz'
\n
\n
\n \n", + "itemtype": "method", + "name": "expandProperties", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "pattern", + "description": "The property pattern to expand.", + "type": "String" + }, + { + "name": "callback", + "description": "The callback to invoke. It is invoked once per\nexpansion, and is passed the expansion.", + "type": "Function" + } + ], + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 67, + "description": "

A computed property macro that returns true if the value of the dependent\nproperty is null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { empty } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  @empty('todos') isDone;\n}\n\nlet todoList = new ToDoList(\n  ['Unit Test', 'Documentation', 'Release']\n);\n\ntodoList.isDone; // false\nset(todoList, 'todos', []);\ntodoList.isDone; // true
\n
\n
\n \n", + "since": "1.6.0", + "itemtype": "method", + "name": "empty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if the value\nof the dependent property is null, an empty string, empty array, or empty\nfunction and false if the underlying value is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 116, + "description": "

A computed property that returns true if the value of the dependent property\nis NOT null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { notEmpty } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(backpack) {\n    set(this, 'backpack', backpack);\n  }\n\n  @notEmpty('backpack') hasStuff\n}\n\nlet hamster = new Hamster(\n  ['Food', 'Sleeping Bag', 'Tent']\n);\n\nhamster.hasStuff; // true\nset(hamster, 'backpack', []);\nhamster.hasStuff; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "notEmpty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 162, + "description": "

A computed property that returns true if the value of the dependent property\nis null or undefined. This avoids errors from JSLint complaining about use of\n==, which can be technically confusing.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { none } from '@ember/object/computed';\n\nclass Hamster {\n  @none('food') isHungry;\n}\n\nlet hamster = new Hamster();\n\nhamster.isHungry; // true\n\nset(hamster, 'food', 'Banana');\nhamster.isHungry; // false\n\nset(hamster, 'food', null);\nhamster.isHungry; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "none", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is null or undefined.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 205, + "description": "

A computed property that returns the inverse boolean value of the original\nvalue for the dependent property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { not } from '@ember/object/computed';\n\nclass User {\n  loggedIn = false;\n\n  @not('loggedIn') isAnonymous;\n}\n\nlet user = new User();\n\nuser.isAnonymous; // true\nset(user, 'loggedIn', true);\nuser.isAnonymous; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "not", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns inverse of the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 247, + "description": "

A computed property that converts the provided dependent property into a\nboolean value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { bool } from '@ember/object/computed';\n\n\nclass Hamster {\n  @bool('numBananas') hasBananas\n}\n\nlet hamster = new Hamster();\n\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 0);\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 1);\nhamster.hasBananas; // true\n\nset(hamster, 'numBananas', null);\nhamster.hasBananas; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "bool", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which converts to boolean the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 295, + "description": "

A computed property which matches the original value for the dependent\nproperty against a given RegExp, returning true if the value matches the\nRegExp and false if it does not.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { match } from '@ember/object/computed';\n\nclass User {\n  @match('email', /^.+@.+\\..+$/) hasValidEmail;\n}\n\nlet user = new User();\n\nuser.hasValidEmail; // false\n\nset(user, 'email', '');\nuser.hasValidEmail; // false\n\nset(user, 'email', 'ember_hamster@example.com');\nuser.hasValidEmail; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "match", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "regexp", + "description": "", + "type": "RegExp" + } + ], + "return": { + "description": "computed property which match the original value\nfor property against a given RegExp", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 342, + "description": "

A computed property that returns true if the provided dependent property is\nequal to the given value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { equal } from '@ember/object/computed';\n\nclass Hamster {\n  @equal('percentCarrotsEaten', 100) satisfied;\n}\n\nlet hamster = new Hamster();\n\nhamster.satisfied; // false\n\nset(hamster, 'percentCarrotsEaten', 100);\nhamster.satisfied; // true\n\nset(hamster, 'percentCarrotsEaten', 50);\nhamster.satisfied; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "equal", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "String|Number|Object" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is equal to the given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 387, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gt } from '@ember/object/computed';\n\nclass Hamster {\n  @gt('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 11);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 432, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gte } from '@ember/object/computed';\n\nclass Hamster {\n  @gte('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 10);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater or equal then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 477, + "description": "

A computed property that returns true if the provided dependent property is\nless than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lt } from '@ember/object/computed';\n\nclass Hamster {\n  @lt('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 2);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 522, + "description": "

A computed property that returns true if the provided dependent property is\nless than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lte } from '@ember/object/computed';\n\nclass Hamster {\n  @lte('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 5);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less or equal than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 567, + "description": "

A computed property that performs a logical and on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first falsy value or last\ntruthy value just like JavaScript's && operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { and } from '@ember/object/computed';\n\nclass Hamster {\n  @and('hasTent', 'hasBackpack') readyForCamp;\n  @and('hasWalkingStick', 'hasBackpack') readyForHike;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForCamp; // false\n\nset(tomster, 'hasTent', true);\ntomster.readyForCamp; // false\n\nset(tomster, 'hasBackpack', true);\ntomster.readyForCamp; // true\n\nset(tomster, 'hasBackpack', 'Yes');\ntomster.readyForCamp; // 'Yes'\n\nset(tomster, 'hasWalkingStick', null);\ntomster.readyForHike; // null
\n
\n
\n \n", + "itemtype": "method", + "name": "and", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `and` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 613, + "description": "

A computed property which performs a logical or on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first truthy value or last\nfalsy value just like JavaScript's || operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { or } from '@ember/object/computed';\n\nclass Hamster {\n  @or('hasJacket', 'hasUmbrella') readyForRain;\n  @or('hasSunscreen', 'hasUmbrella') readyForBeach;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForRain; // undefined\n\nset(tomster, 'hasUmbrella', true);\ntomster.readyForRain; // true\n\nset(tomster, 'hasJacket', 'Yes');\ntomster.readyForRain; // 'Yes'\n\nset(tomster, 'hasSunscreen', 'Check');\ntomster.readyForBeach; // 'Check'
\n
\n
\n \n", + "itemtype": "method", + "name": "or", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `or` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 656, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { alias } from '@ember/object/computed';\n\nclass Person {\n  name = 'Alex Matchneer';\n\n  @alias('name') nomen;\n}\n\nlet alex = new Person();\n\nalex.nomen; // 'Alex Matchneer'\nalex.name;  // 'Alex Matchneer'\n\nset(alex, 'nomen', '@machty');\nalex.name;  // '@machty'
\n
\n
\n \n", + "itemtype": "method", + "name": "alias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates an alias to the\noriginal value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 691, + "description": "

Where the alias computed macro aliases get and set, and allows for\nbidirectional data flow, the oneWay computed macro only provides an aliased\nget. The set will not mutate the upstream property, rather causes the\ncurrent property to become the value set. This causes the downstream property\nto permanently diverge from the upstream property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { oneWay }from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @oneWay('firstName') nickName;\n}\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear');\nteddy.firstName; // 'Teddy'\nteddy.nickName; // 'TeddyBear'
\n
\n
\n \n", + "itemtype": "method", + "name": "oneWay", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 739, + "description": "

This is a more semantically meaningful alias of the oneWay computed macro,\nwhose name is somewhat ambiguous as to which direction the data flows.

\n", + "itemtype": "method", + "name": "reads", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\n property to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 752, + "description": "

Where oneWay computed macro provides oneWay bindings, the readOnly\ncomputed macro provides a readOnly one way binding. Very often when using\nthe oneWay macro one does not also want changes to propagate back up, as\nthey will replace the value.

\n

This prevents the reverse flow, and also throws an exception when it occurs.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { readOnly } from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @readOnly('firstName') nickName;\n});\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear'); // throws Exception\n// throw new EmberError('Cannot Set: nickName on: <User:ember27288>' );`\n\nteddy.firstName; // 'Teddy'
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 803, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property, but also print a deprecation warning.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { set } from '@ember/object';\nimport { deprecatingAlias } from '@ember/object/computed';\n\nclass Hamster {\n  @deprecatingAlias('cavendishCount', {\n    id: 'hamster.deprecate-banana',\n    until: '3.0.0'\n  })\n  bananaCount;\n}\n\nlet hamster = new Hamster();\n\nset(hamster, 'bananaCount', 5); // Prints a deprecation warning.\nhamster.cavendishCount; // 5
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecatingAlias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "Options for `deprecate`.", + "type": "Object" + } + ], + "return": { + "description": "computed property which creates an alias with a\ndeprecation to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 75, + "description": "

A computed property that returns the sum of the values in the dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { sum } from '@ember/object/computed';\n\nclass Invoice {\n  lineItems = [1.00, 2.50, 9.99];\n\n  @sum('lineItems') total;\n}\n\nlet invoice = new Invoice();\n\ninvoice.total; // 13.49
\n
\n
\n \n", + "itemtype": "method", + "name": "sum", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the sum of all values in the\ndependentKey's array", + "type": "ComputedProperty" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 112, + "description": "

A computed property that calculates the maximum value in the dependent array.\nThis will return -Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, max } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @max('childAges') maxChildAge;\n}\n\nlet lordByron = new Person();\n\nlordByron.maxChildAge; // -Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.maxChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.maxChildAge; // 8
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe max of a list of Date objects will be the highest timestamp as a Number.\nThis behavior is consistent with Math.max.

\n", + "itemtype": "method", + "name": "max", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the largest value in the dependentKey's\narray", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 176, + "description": "

A computed property that calculates the minimum value in the dependent array.\nThis will return Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, min } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @min('childAges') minChildAge;\n}\n\nlet lordByron = Person.create({ children: [] });\n\nlordByron.minChildAge; // Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.minChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.minChildAge; // 5
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe min of a list of Date objects will be the lowest timestamp as a Number.\nThis behavior is consistent with Math.min.

\n", + "itemtype": "method", + "name": "min", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the smallest value in the dependentKey's array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 239, + "description": "

Returns an array mapped via the callback

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function mapCallback(item, index);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', function(chore, index) {\n    return `${chore.toUpperCase()}!`;\n  })\n  excitingChores;\n});\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n

You can optionally pass an array of additional dependent keys as the second\nparameter to the macro, if your map function relies on any external values:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  shouldUpperCase = false;\n\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', ['shouldUpperCase'], function(chore, index) {\n    if (this.shouldUpperCase) {\n      return `${chore.toUpperCase()}!`;\n    } else {\n      return `${chore}!`;\n    }\n  })\n  excitingChores;\n}\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['clean!', 'write more unit tests!']\n\nset(hamster, 'shouldUpperCase', true);\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional\ndependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "an array mapped via the callback", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 363, + "description": "

Returns an array mapped to the specified key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import { set } from '@ember/object';\nimport { mapBy } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n}\n\nlet lordByron = new Person();\n\nlordByron.childAges; // []\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.childAges; // [7]\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.childAges; // [7, 5, 8]
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "an array mapped to the specified key", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 430, + "description": "

Filters the array by the callback.

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
  • array is the dependant array itself.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function filterCallback(item, index, array);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = Hamster.create([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]
\n
\n
\n \n

You can also use @each.property in your dependent key, the callback will\nstill use the underlying array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores.@each.done', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n\nset(hamster.chores[2], 'done', true);\nhamster.remainingChores; // []
\n
\n
\n \n

Finally, you can optionally pass an array of additional dependent keys as the\nsecond parameter to the macro, if your filter function relies on any external\nvalues:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  doneKey = 'finished';\n\n  @filter('chores', ['doneKey'], function(chore, index, array) {\n    return !chore[this.doneKey];\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', finished: true },\n  { name: 'clean', finished: true },\n  { name: 'write more unit tests', finished: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', finished: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional dependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 597, + "description": "

Filters the array by the property and value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { filterBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filterBy('chores', 'done', false) remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{ name: 'write more unit tests', done: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "*" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 653, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniq } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniq('fruits') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  'banana',\n  'grape',\n  'kale',\n  'banana'\n]);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale']
\n
\n
\n \n", + "itemtype": "method", + "name": "uniq", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 724, + "description": "

A computed property which returns a new array with all the unique elements\nfrom an array, with uniqueness determined by specific key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniqBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniqBy('fruits', 'id') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  { id: 1, 'banana' },\n  { id: 2, 'grape' },\n  { id: 3, 'peach' },\n  { id: 1, 'banana' }\n]);\n\nhamster.uniqueFruits; // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 778, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { union } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits, vegetables) {\n    set(this, 'fruits', fruits);\n    set(this, 'vegetables', vegetables);\n  }\n\n  @union('fruits', 'vegetables') uniqueFruits;\n});\n\nlet hamster = new, Hamster(\n  [\n    'banana',\n    'grape',\n    'kale',\n    'banana',\n    'tomato'\n  ],\n  [\n    'tomato',\n    'carrot',\n    'lettuce'\n  ]\n);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale', 'tomato', 'carrot', 'lettuce']
\n
\n
\n \n", + "itemtype": "method", + "name": "union", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the unique elements\nfrom one or more dependent arrays.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 825, + "description": "

A computed property which returns a new array with all the elements\ntwo or more dependent arrays have in common.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { intersect } from '@ember/object/computed';\n\nclass FriendGroups {\n  constructor(adaFriends, charlesFriends) {\n    set(this, 'adaFriends', adaFriends);\n    set(this, 'charlesFriends', charlesFriends);\n  }\n\n  @intersect('adaFriends', 'charlesFriends') friendsInCommon;\n}\n\nlet groups = new FriendGroups(\n  ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n  ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock']\n);\n\ngroups.friendsInCommon; // ['William King', 'Mary Somerville']
\n
\n
\n \n", + "itemtype": "method", + "name": "intersect", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the duplicated\nelements from the dependent arrays", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 906, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array that are not in the second dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { setDiff } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(likes, fruits) {\n    set(this, 'likes', likes);\n    set(this, 'fruits', fruits);\n  }\n\n  @setDiff('likes', 'fruits') wants;\n}\n\nlet hamster = new Hamster(\n  [\n    'banana',\n    'grape',\n    'kale'\n  ],\n  [\n    'grape',\n    'kale',\n  ]\n);\n\nhamster.wants; // ['banana']
\n
\n
\n \n", + "itemtype": "method", + "name": "setDiff", + "static": 1, + "params": [ + { + "name": "setAProperty", + "description": "", + "type": "String" + }, + { + "name": "setBProperty", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the items from the\nfirst dependent array that are not in the second dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 976, + "description": "

A computed property that returns the array of values for the provided\ndependent properties.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { collect } from '@ember/object/computed';\n\nclass Hamster {\n  @collect('hat', 'shirt') clothes;\n}\n\nlet hamster = new Hamster();\n\nhamster.clothes; // [null, null]\n\nset(hamster, 'hat', 'Camp Hat');\nset(hamster, 'shirt', 'Camp Shirt');\nhamster.clothes; // ['Camp Hat', 'Camp Shirt']
\n
\n
\n \n", + "itemtype": "method", + "name": "collect", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which maps values of all passed\nin properties to an array.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 1031, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array sorted based on a property or sort function. The sort\nmacro can be used in two different ways:

\n
    \n
  1. By providing a sort callback function
  2. \n
  3. By providing an array of keys to sort the array
  4. \n
\n

In the first form, the callback method you provide should have the following\nsignature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function sortCallback(itemA, itemB);
\n
\n
\n \n
    \n
  • itemA the first item to compare.
  • \n
  • itemB the second item to compare.
  • \n
\n

This function should return negative number (e.g. -1) when itemA should\ncome before itemB. It should return positive number (e.g. 1) when itemA\nshould come after itemB. If the itemA and itemB are equal this function\nshould return 0.

\n

Therefore, if this function is comparing some numeric values, simple itemA - itemB or itemA.get( 'foo' ) - itemB.get( 'foo' ) can be used instead of\nseries of if.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', function(a, b){\n    if (a.priority > b.priority) {\n      return 1;\n    } else if (a.priority < b.priority) {\n      return -1;\n    }\n\n    return 0;\n  })\n  priorityTodos;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

You can also optionally pass an array of additional dependent keys as the\nsecond parameter, if your sort function is dependent on additional values that\ncould changes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n
import EmberObject, { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  sortKey = 'priority';\n\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', ['sortKey'], function(a, b){\n    if (a[this.sortKey] > b[this.sortKey]) {\n      return 1;\n    } else if (a[this.sortKey] < b[this.sortKey]) {\n      return -1;\n    }\n\n    return 0;\n  })\n  sortedTodos;\n});\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

In the second form, you should provide the key of the array of sort values as\nthe second parameter:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using standard ascending sort\n  todosSorting = ['name'];\n  @sort('todos', 'todosSorting') sortedTodos;\n\n  // using descending sort\n  todosSortingDesc = ['name:desc'];\n  @sort('todos', 'todosSortingDesc') sortedTodosDesc;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.sortedTodos; // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\ntodoList.sortedTodosDesc; // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n", + "itemtype": "method", + "name": "sort", + "static": 1, + "params": [ + { + "name": "itemsKey", + "description": "", + "type": "String" + }, + { + "name": "sortDefinitionOrDependentKeys", + "description": "The key of the sort definition (an array of sort properties),\nthe sort function, or an array of additional dependent keys", + "type": "String|Function|Array" + }, + { + "name": "sortDefinition", + "description": "the sort function (when used with additional dependent keys)", + "type": "Function?" + } + ], + "return": { + "description": "computes a new sorted array based on the sort\nproperty array or callback function", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/object/evented-9c0e842a92.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/object/evented-9c0e842a92.json new file mode 100644 index 000000000..92ce98476 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/object/evented-9c0e842a92.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/object/evented", + "type": "class", + "attributes": { + "name": "@ember/object/evented", + "shortname": "@ember/object/evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 180, + "description": "

Define a property as a function that should be executed when\na specified event or events are triggered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\nimport { on } from '@ember/object/evented';\nimport { sendEvent } from '@ember/object/events';\n\nlet Job = EmberObject.extend({\n  logCompleted: on('completed', function() {\n    console.log('Job completed!');\n  })\n});\n\nlet job = Job.create();\n\nsendEvent(job, 'completed'); // Logs 'Job completed!'
\n
\n
\n \n", + "itemtype": "method", + "name": "on", + "static": 1, + "params": [ + { + "name": "eventNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the listener function, passed as last argument to on(...)", + "type": "Function" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/polyfills-e199d93283.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/polyfills-e199d93283.json new file mode 100644 index 000000000..3ce89a613 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/polyfills-e199d93283.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/polyfills", + "type": "class", + "attributes": { + "name": "@ember/polyfills", + "shortname": "@ember/polyfills", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/polyfills", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/polyfills/lib/assign.ts", + "line": 11, + "description": "

Copy properties from a source object to a target object. Source arguments remain unchanged.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assign } from '@ember/polyfills';\n\nvar a = { first: 'Yehuda' };\nvar b = { last: 'Katz' };\nvar c = { company: 'Other Company' };\nvar d = { company: 'Tilde Inc.' };\nassign(a, b, c, d); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' };
\n
\n
\n \n", + "itemtype": "method", + "name": "assign", + "params": [ + { + "name": "target", + "description": "The object to assign into", + "type": "Object" + }, + { + "name": "args", + "description": "The objects to copy properties from", + "type": "Object", + "multiple": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/polyfills", + "module": "@ember/polyfills" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/polyfills", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/runloop-6c99acc71a.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/runloop-6c99acc71a.json new file mode 100644 index 000000000..e38bd79fa --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/runloop-6c99acc71a.json @@ -0,0 +1,497 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/runloop", + "type": "class", + "attributes": { + "name": "@ember/runloop", + "shortname": "@ember/runloop", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/runloop", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 105, + "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

Normally 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { run } from '@ember/runloop';\n\nrun(function() {\n  // code to be executed within a RunLoop\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "run", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "return value from invoking the passed function.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 150, + "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

Please note: This is not for normal usage, and should be used sparingly.

\n

If invoked when not within a run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { join } from '@ember/runloop';\n\njoin(function() {\n  // creates a new run-loop\n});
\n
\n
\n \n

Alternatively, if called within an existing run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "join", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Return value from invoking the passed function. Please note,\nwhen called within an existing loop, no return value is possible.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 209, + "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

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

Let'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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import 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
\n \n

In 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.

\n", + "itemtype": "method", + "name": "bind", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "returns a new function that will always have a particular context", + "type": "Function" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 323, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "begin", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 346, + "description": "

Ends a RunLoop. This must be called sometime after you call\nbegin() to flush any deferred actions. This is a lower-level way\nto use a RunLoop instead of using run().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "end", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 369, + "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

At 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "schedule", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'", + "type": "String" + }, + { + "name": "target", + "description": "target object to use as the context when invoking a method.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.", + "type": "String|Function" + }, + { + "name": "arguments*", + "description": "Optional arguments to be passed to the queued method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 442, + "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

You 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "later", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 490, + "description": "

Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling scheduleOnce with the "actions" queue.

\n", + "itemtype": "method", + "name": "once", + "static": 1, + "params": [ + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 521, + "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

Note that although you can pass optional arguments these will not be\nconsidered when looking for duplicates. New arguments will replace previous\ncalls.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Also note that for scheduleOnce to prevent additional calls, you need to\npass the same function instance. The following case works as expected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
function log() {\n  console.log('Logging only once');\n}\n\nfunction scheduleIt() {\n  scheduleOnce('actions', myContext, log);\n}\n\nscheduleIt();\nscheduleIt();
\n
\n
\n \n

But this other case will schedule the function multiple times:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { 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
\n \n

Available queues, and their order, can be found at queues

\n", + "itemtype": "method", + "name": "scheduleOnce", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'.", + "type": "String", + "optional": true + }, + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 615, + "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\nlater with a wait time of 1ms.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { 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
\n \n

Multiple 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

Note 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

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

One 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

The 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.

\n", + "itemtype": "method", + "name": "next", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 700, + "description": "

Cancels a scheduled item. Must be a value returned by later(),\nonce(), scheduleOnce(), next(), debounce(), or\nthrottle().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n
import {\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
\n
\n \n", + "itemtype": "method", + "name": "cancel", + "static": 1, + "params": [ + { + "name": "timer", + "description": "Timer object to cancel", + "type": "Object" + } + ], + "return": { + "description": "true if canceled or false/undefined if it wasn't found", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 771, + "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

This 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n \n

Immediate allows you to run the function immediately, but debounce\nother calls for this function until the wait time has elapsed. If\ndebounce 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "debounce", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to false.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 868, + "description": "

Ensure that the target method is never called more frequently than\nthe specified spacing period. The target method is called immediately.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "throttle", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "spacing", + "description": "Number of milliseconds to space out requests.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to true.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 62, + "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.

\n", + "itemtype": "property", + "name": "queues", + "type": "Array", + "default": "['actions', 'destroy']", + "access": "private", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/renderer" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/runloop", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/service-18ee6d5663.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/service-18ee6d5663.json new file mode 100644 index 000000000..b89318af8 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/service-18ee6d5663.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/service", + "type": "class", + "attributes": { + "name": "@ember/service", + "shortname": "@ember/service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/service/index.ts", + "line": 10, + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + }, + { + "file": "packages/@ember/service/index.ts", + "line": 30, + "description": "

Creates a property that lazily looks up a service in the container. There are\nno restrictions as to what objects a service can be injected into.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service('auth') authManager;\n\n  model() {\n    return this.authManager.findCurrentUser();\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default Route.extend({\n  authManager: service('auth'),\n\n  model() {\n    return this.get('authManager').findCurrentUser();\n  }\n});
\n
\n
\n \n

This example will create an authManager property on the application route\nthat looks up the auth service in the container, making it easily accessible\nin the model hook.

\n", + "itemtype": "method", + "name": "service", + "static": 1, + "since": "4.1.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/template-d099e89759.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/template-d099e89759.json new file mode 100644 index 000000000..b35eccf16 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/template-d099e89759.json @@ -0,0 +1,100 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/template", + "type": "class", + "attributes": { + "name": "@ember/template", + "shortname": "@ember/template", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/template", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/utils/managers.ts", + "line": 9, + "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).

\n", + "itemtype": "method", + "name": "setComponentManager", + "params": [ + { + "name": "factory", + "description": "a function to create the owner for an object", + "type": "Function" + }, + { + "name": "obj", + "description": "the object to associate with the componetn manager", + "type": "Object" + } + ], + "return": { + "description": "the same object passed in", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 61, + "description": "

Use this method to indicate that a string should be rendered as HTML\nwhen the string is used in a template. To say this another way,\nstrings marked with htmlSafe will not be HTML escaped.

\n

A word of warning - The htmlSafe method does not make the string safe;\nit only tells the framework to treat the string as if it is safe to render\nas HTML. If a string contains user inputs or other untrusted\ndata, you must sanitize the string before using the htmlSafe method.\nOtherwise your code is vulnerable to\nCross-Site Scripting.\nThere are many open source sanitization libraries to choose from,\nboth for front end and server-side sanitization.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { htmlSafe } from '@ember/template';\n\nconst someTrustedOrSanitizedString = "<div>Hello!</div>"\n\nhtmlSafe(someTrustedorSanitizedString)
\n
\n
\n \n", + "itemtype": "method", + "name": "htmlSafe", + "static": 1, + "return": { + "description": "A string that will not be HTML escaped by Handlebars.", + "type": "SafeString" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 98, + "description": "

Detects if a string was decorated using htmlSafe.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { htmlSafe, isHTMLSafe } from '@ember/template';\n\nvar plainString = 'plain string',\n    safeString = htmlSafe('<div>someValue</div>');\n\nisHTMLSafe(plainString); // false\nisHTMLSafe(safeString);  // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isHTMLSafe", + "static": 1, + "return": { + "description": "`true` if the string was decorated with `htmlSafe`, `false` otherwise.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/template", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/test-f2f6560f02.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/test-f2f6560f02.json new file mode 100644 index 000000000..a5a210146 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/test-f2f6560f02.json @@ -0,0 +1,395 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/test", + "type": "class", + "attributes": { + "name": "@ember/test", + "shortname": "@ember/test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/test", + "namespace": "", + "methods": [ + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 64, + "description": "

This hook defers the readiness of the application, so that you can start\nthe app when your tests are ready to run. It also sets the router's\nlocation to 'none', so that the window's location will not be modified\n(preventing both accidental leaking of state between tests and interference\nwith your testing framework). setupForTesting should only be called after\nsetting a custom router class (for example App.Router = Router.extend().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.setupForTesting();
\n
\n
\n \n", + "itemtype": "method", + "name": "setupForTesting", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 103, + "description": "

This injects the test helpers into the helperContainer object. If an object is provided\nit will be used as the helperContainer. If helperContainer is not set it will default\nto window. If a function of the same name has already been defined it will be cached\n(so that it can be reset if the helper is removed with unregisterHelper or\nremoveTestHelpers).

\n

Any callbacks registered with onInjectHelpers will be called once the\nhelpers have been injected.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.injectTestHelpers();
\n
\n
\n \n", + "itemtype": "method", + "name": "injectTestHelpers", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 148, + "description": "

This removes all helpers that have been registered, and resets and functions\nthat were overridden by the helpers.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.removeTestHelpers();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "removeTestHelpers", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/helpers/current_path.ts", + "line": 9, + "description": "

Returns the current path.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentPath(), 'some.path.index', "correct path was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentPath", + "return": { + "description": "The currently active path.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_route_name.ts", + "line": 8, + "description": "

Returns the currently active route name.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
function validateRouteName() {\nequal(currentRouteName(), 'some.path', "correct route was transitioned into.");\n}\nvisit('/some/path').then(validateRouteName)
\n
\n
\n \n", + "itemtype": "method", + "name": "currentRouteName", + "return": { + "description": "The name of the currently active route.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_url.ts", + "line": 9, + "description": "

Returns the current URL.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentURL(), '/some/path', "correct URL was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentURL", + "return": { + "description": "The currently active URL.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.ts", + "line": 9, + "description": "

Resumes a test paused by pauseTest.

\n", + "itemtype": "method", + "name": "resumeTest", + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.ts", + "line": 22, + "description": "

Pauses the current test - this is useful for debugging while testing or for test-driving.\nIt allows you to inspect the state of your application at any point.\nExample (The test will pause before clicking the button):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('/')\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

You may want to turn off the timeout before pausing.

\n

qunit (timeout available to use as of 2.4.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nassert.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

mocha (timeout happens automatically as of ember-mocha v0.14.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nthis.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n", + "since": "1.9.0", + "itemtype": "method", + "name": "pauseTest", + "return": { + "description": "A promise that will never resolve", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/visit.ts", + "line": 6, + "description": "

Loads a route, sets up any controllers, and renders any templates associated\nwith the route as though a real user had triggered the route change while\nusing your app.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('posts/index').then(function() {\n  // assert something\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/wait.ts", + "line": 12, + "description": "

Causes the run loop to process any pending events. This is used to ensure that\nany async operations from other helpers (or your assertions) have been processed.

\n

This is most often used as the return value for the helper functions (see 'click',\n'fillIn','visit',etc). However, there is a method to register a test helper which\nutilizes this method without the need to actually call wait() in your helpers.

\n

The wait helper is built into registerAsyncHelper by default. You will not need\nto return app.testHelpers.wait(); - the wait behavior is provided for you.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('loginUser', function(app, username, password) {\n  visit('secured/path/here')\n    .fillIn('#username', username)\n    .fillIn('#password', password)\n    .click('.submit');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "wait", + "params": [ + { + "name": "value", + "description": "The value to be returned.", + "type": "Object" + } + ], + "return": { + "description": "Promise that resolves to the passed value.", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 15, + "description": "

registerHelper is used to register a test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

This helper can later be called without arguments because it will be\ncalled with app as the first parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nApp = Application.create();\nApp.injectTestHelpers();\nboot();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 59, + "description": "

registerAsyncHelper is used to register an async test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerAsyncHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterAsyncHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

The advantage of an async helper is that it will not run\nuntil the last async helper has completed. All async helpers\nafter it will wait for it complete before running.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('deletePost', function(app, postId) {\n  click('.delete-' + postId);\n});\n\n// ... in your test\nvisit('/post/2');\ndeletePost(2);\nvisit('/post/3');\ndeletePost(3);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerAsyncHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 112, + "description": "

Remove a previously added helper method.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { unregisterHelper } from '@ember/test';\n\nunregisterHelper('wait');
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregisterHelper", + "static": 1, + "params": [ + { + "name": "name", + "description": "The helper to remove.", + "type": "String" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 7, + "description": "

This allows ember-testing to play nicely with other asynchronous\nevents, such as an application that is waiting for a CSS3\ntransition or an IndexDB transaction. The waiter runs periodically\nafter each async helper (i.e. click, andThen, visit, etc) has executed,\nuntil the returning result is truthy. After the waiters finish, the next async helper\nis executed and the process repeats.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(function() {\n  return myPendingTransactions() === 0;\n});
\n
\n
\n \n

The context argument allows you to optionally specify the this\nwith which your callback will be invoked.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(MyDB, MyDB.hasPendingTransactions);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 66, + "description": "

unregisterWaiter is used to unregister a callback that was\nregistered with registerWaiter.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "unregisterWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 94, + "description": "

Iterates through each registered test waiter, and invokes\nits callback. If any waiter returns false, this method will return\ntrue indicating that the waiters have not settled yet.

\n

This is generally used internally from the acceptance/integration test\ninfrastructure.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "checkWaiters", + "class": "@ember/test", + "module": "@ember/test" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 23, + "description": "

This property contains the testing helpers for the current application. These\nare created once you call injectTestHelpers on your Application\ninstance. The included helpers are also available on the window object by\ndefault, but can be used from this object on the individual application also.

\n", + "itemtype": "property", + "name": "testHelpers", + "type": "{Object}", + "default": "{}", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 36, + "description": "

This property will contain the original methods that were registered\non the helperContainer before injectTestHelpers is called.

\n

When removeTestHelpers is called, these methods are restored to the\nhelperContainer.

\n", + "itemtype": "property", + "name": "originalMethods", + "type": "{Object}", + "default": "{}", + "access": "private", + "tagname": "", + "since": "1.3.0", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 51, + "description": "

This property indicates whether or not this application is currently in\ntesting mode. This is set when setupForTesting is called on the current\napplication.

\n", + "itemtype": "property", + "name": "testing", + "type": "{Boolean}", + "default": "false", + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 91, + "description": "

This will be used as the container to inject the test helpers into. By\ndefault the helpers are injected into window.

\n", + "itemtype": "property", + "name": "helperContainer", + "type": "{Object} The object to be used for test helpers.", + "default": "window", + "since": "1.2.0", + "access": "private", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/test", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/utils-c8877b601e.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/utils-c8877b601e.json new file mode 100644 index 000000000..8646c8bad --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@ember/utils-c8877b601e.json @@ -0,0 +1,213 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/utils", + "type": "class", + "attributes": { + "name": "@ember/utils", + "shortname": "@ember/utils", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/utils", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/is_blank.ts", + "line": 5, + "description": "

A value is blank if it is empty or a whitespace string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "isBlank", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_empty.ts", + "line": 5, + "description": "

Verifies that a value is null or undefined, an empty string, or an empty\narray.

\n

Constrains the rules on isNone by returning true for empty strings and\nempty arrays.

\n

If the value is an object with a size property of type number, it is used\nto check emptiness.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
isEmpty(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
\n
\n \n", + "itemtype": "method", + "name": "isEmpty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_none.ts", + "line": 4, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
isNone(null);          // true\nisNone(undefined);     // true\nisNone('');            // false\nisNone([]);            // false\nisNone(function() {}); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isNone", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_present.ts", + "line": 5, + "description": "

A value is present if it not isBlank.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
isPresent(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
\n
\n \n", + "itemtype": "method", + "name": "isPresent", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.8.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/compare.ts", + "line": 53, + "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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { compare } from '@ember/utils';\n\ncompare('hello', 'hello');  // 0\ncompare('abc', 'dfg');      // -1\ncompare(2, 1);              // 1
\n
\n
\n \n

If 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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { compare } from '@ember/utils';\n\ncompare('hello', 50);       // 1\ncompare(50, 'hello');       // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "compare", + "static": 1, + "params": [ + { + "name": "v", + "description": "First value to compare", + "type": "Object" + }, + { + "name": "w", + "description": "Second value to compare", + "type": "Object" + } + ], + "return": { + "description": "-1 if v < w, 0 if v = w and 1 if v > w.", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/is-equal.ts", + "line": 4, + "description": "

Compares two objects, returning true if they are equal.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { isEqual } from '@ember/utils';\n\nisEqual('hello', 'hello');                   // true\nisEqual(1, 2);                               // false
\n
\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Due 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { isEqual } from '@ember/utils';\n\nisEqual([4, 2], [4, 2]);                     // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEqual", + "static": 1, + "params": [ + { + "name": "a", + "description": "first object to compare", + "type": "Object" + }, + { + "name": "b", + "description": "second object to compare", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/type-of.ts", + "line": 40, + "description": "

Returns a consistent type for the passed object.

\n

Use 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\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
\n
\n \n

Examples:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "typeOf", + "params": [ + { + "name": "item", + "description": "the item to check" + } + ], + "return": { + "description": "the type", + "type": "String" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/utils", + "module": "@ember/utils" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/utils", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@glimmer/tracking-59c5ee66c0.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@glimmer/tracking-59c5ee66c0.json new file mode 100644 index 000000000..aad75c6dd --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@glimmer/tracking-59c5ee66c0.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.6.0-@glimmer/tracking", + "type": "class", + "attributes": { + "name": "@glimmer/tracking", + "shortname": "@glimmer/tracking", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 22, + "description": "

Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are static, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>Count: {{this.count}}</div>\n<div>Times Ten: {{this.timesTen}}</div>\n<div>\n  <button {{on "click" this.plusOne}}>\n    Plus One\n  </button>\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class CounterComponent extends Component {\n  @tracked count = 0;\n\n  get timesTen() {\n    return this.count * 10;\n  }\n\n  @action\n  plusOne() {\n    this.count += 1;\n  }\n}
\n
\n
\n \n

Both the {{this.count}} and the {{this.timesTen}} properties in the\ntemplate will update whenever the button is clicked. Any tracked properties\nthat are used in any way to calculate a value that is used in the template\nwill cause a rerender when updated - this includes through method calls and\nother means:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nclass Entry {\n  @tracked name;\n  @tracked phoneNumber;\n\n  constructor(name, phoneNumber) {\n    this.name = name;\n    this.phoneNumber = phoneNumber;\n  }\n}\n\nexport default class PhoneBookComponent extends Component {\n  entries = [\n    new Entry('Pizza Palace', 5551234),\n    new Entry('1st Street Cleaners', 5554321),\n    new Entry('Plants R Us', 5552468),\n  ];\n\n  // Any usage of this property will update whenever any of the names in the\n  // entries arrays are updated\n  get names() {\n    return this.entries.map(e => e.name);\n  }\n\n  // Any usage of this property will update whenever any of the numbers in the\n  // entries arrays are updated\n  get numbers() {\n    return this.getFormattedNumbers();\n  }\n\n  getFormattedNumbers() {\n    return this.entries\n      .map(e => e.phoneNumber)\n      .map(number => {\n        let numberString = '' + number;\n\n        return numberString.slice(0, 3) + '-' + numberString.slice(3);\n      });\n  }\n}
\n
\n
\n \n

It's important to note that setting tracked properties will always trigger an\nupdate, even if the property is set to the same value as it was before.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let entry = new Entry('Pizza Palace', 5551234);\n\n// if entry was used when rendering, this would cause a rerender, even though\n// the name is being set to the same value as it was before\nentry.name = entry.name;
\n
\n
\n \n

tracked can also be used with the classic Ember object model in a similar\nmanner to classic computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked(),\n  phoneNumber: tracked()\n});
\n
\n
\n \n

Often this is unnecessary, but to ensure robust auto-tracking behavior it is\nadvisable to mark tracked state appropriately wherever possible.

\n

This form of tracked also accepts an optional configuration object\ncontaining either an initial value or an initializer function (but not\nboth).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked({ value: 'Zoey' }),\n  favoriteSongs: tracked({\n    initializer: () => ['Raspberry Beret', 'Time After Time']\n  })\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "tracked", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 158, + "description": "

Gives the getter a caching behavior. The return value of the getter\nwill be cached until any of the properties it is entangled with\nare invalidated. This is useful when a getter is expensive and\nused very often.

\n

For instance, in this GuestList class, we have the sortedGuests\ngetter that sorts the guests alphabetically:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
  import { tracked } from '@glimmer/tracking';\n\n  class GuestList {\n    @tracked guests = ['Zoey', 'Tomster'];\n\n    get sortedGuests() {\n      return this.guests.slice().sort()\n    }\n  }
\n
\n
\n \n

Every time sortedGuests is accessed, a new array will be created and sorted,\nbecause JavaScript getters do not cache by default. When the guest list\nis small, like the one in the example, this is not a problem. However, if\nthe guest list were to grow very large, it would mean that we would be doing\na large amount of work each time we accessed sortedGetters. With @cached,\nwe can cache the value instead:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
  import { tracked, cached } from '@glimmer/tracking';\n\n  class GuestList {\n    @tracked guests = ['Zoey', 'Tomster'];\n\n    @cached\n    get sortedGuests() {\n      return this.guests.slice().sort()\n    }\n  }
\n
\n
\n \n

Now the sortedGuests getter will be cached based on autotracking.\nIt will only rerun and create a new sorted array when the guests tracked\nproperty is updated.

\n

Tradeoffs

\n

Overuse is discouraged.

\n

In general, you should avoid using @cached unless you have confirmed that\nthe getter you are decorating is computationally expensive. @cached adds\na small amount of overhead to the getter, making it more expensive.\nWhile this overhead is small, if @cached is overused it can add up to a\nlarge impact overall in your app. Many getters and tracked properties\nare only accessed once, rendered, and then never rerendered, so adding\n@cached when it is unnecessary can negatively impact performance.

\n

Also, @cached may rerun even if the values themselves have not changed,\nsince tracked properties will always invalidate even if their underlying\nvalue did not change.\nFor example updating an integer value from 5 to an other 5.

\n

Avoiding a cache invalidation in this case is not something that can\nbe achieved on the @cached decorator itself, but rather when updating\nthe underlying values, by applying a diff checking mecanism:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
if (newValue !== this.trackedProp) {\n  this.trackedProp = newValue;\n}
\n
\n
\n \n

Here equal values won't update the property, therefore not triggering a\ncache invalidation.

\n

The cost of these edge-guards adds up to the tradoff calculation of using\na caching strategy, hence requiring a very sensitive approach regarding\nperformance.

\n", + "itemtype": "method", + "name": "cached", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@glimmer/tracking", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-@glimmer/tracking/primitives/cache-9a6dbd965b.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-@glimmer/tracking/primitives/cache-9a6dbd965b.json new file mode 100644 index 000000000..fbe5f176a --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-@glimmer/tracking/primitives/cache-9a6dbd965b.json @@ -0,0 +1,77 @@ +{ + "data": { + "id": "ember-4.6.0-@glimmer/tracking/primitives/cache", + "type": "class", + "attributes": { + "name": "@glimmer/tracking/primitives/cache", + "shortname": "@glimmer/tracking/primitives/cache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking/primitives/cache", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 14, + "description": "

Receives a function, and returns a wrapped version of it that memoizes based on\nautotracking. The function will only rerun whenever any tracked values used\nwithin it have changed. Otherwise, it will return the previous value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state. Now, `counter` will\n  // only rerun if `state.value` changes.\n  state.value;\n\n  return ++computeCount;\n});\n\ngetValue(counter); // 1\n\n// returns the same value because no tracked state has changed\ngetValue(counter); // 1\n\nstate.value = 'foo';\n\n// reruns because a tracked value used in the function has changed,\n// incermenting the counter\ngetValue(counter); // 2
\n
\n
\n \n", + "itemtype": "method", + "name": "createCache", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 56, + "description": "

Gets the value of a cache created with createCache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  return ++computeCount;\n});\n\ngetValue(counter); // 1
\n
\n
\n \n", + "itemtype": "method", + "name": "getValue", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 78, + "description": "

Can be used to check if a memoized function is constant. If no tracked state\nwas used while running a memoized function, it will never rerun, because nothing\ncan invalidate its result. isConst can be used to determine if a memoized\nfunction is constant or not, in order to optimize code surrounding that\nfunction.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue, isConst } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state\n  state.value;\n\n  return computeCount++;\n});\n\nlet constCounter = createCache(() => {\n  return computeCount++;\n});\n\ngetValue(counter);\ngetValue(constCounter);\n\nisConst(counter); // false\nisConst(constCounter); // true
\n
\n
\n \n

If called on a cache that hasn't been accessed yet, it will throw an\nerror. This is because there's no way to know if the function will be constant\nor not yet, and so this helps prevent missing an optimization opportunity on\naccident.

\n", + "itemtype": "method", + "name": "isConst", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@glimmer/tracking/primitives/cache", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Application-29417ee76e.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Application-29417ee76e.json new file mode 100644 index 000000000..77464539f --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Application-29417ee76e.json @@ -0,0 +1,799 @@ +{ + "data": { + "id": "ember-4.6.0-Application", + "type": "class", + "attributes": { + "name": "Application", + "shortname": "Application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/lib/application.ts", + "line": 34, + "description": "

An instance of Application is the starting point for every Ember\napplication. It instantiates, initializes and coordinates the\nobjects that make up your app.

\n

Each Ember app has one and only one Application object. Although\nEmber CLI creates this object implicitly, the Application class\nis defined in the app/app.js. You can define a ready method on the\nApplication class, which will be run by Ember when the application is\ninitialized.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
const App = Application.extend({\n  ready() {\n    // your code here\n  }\n})
\n
\n
\n \n

Because Application ultimately inherits from Ember.Namespace, any classes\nyou create will have useful string representations when calling toString().\nSee the Ember.Namespace documentation for more information.

\n

While you can think of your Application as a container that holds the\nother classes in your application, there are several other responsibilities\ngoing on under-the-hood that you may want to understand. It is also important\nto understand that an Application is different from an ApplicationInstance.\nRefer to the Guides to understand the difference between these.

\n

Event Delegation

\n

Ember uses a technique called event delegation. This allows the framework\nto set up a global, shared event listener instead of requiring each view to\ndo it manually. For example, instead of each view registering its own\nmousedown listener on its associated element, Ember sets up a mousedown\nlistener on the body.

\n

If a mousedown event occurs, Ember will look at the target of the event and\nstart walking up the DOM node tree, finding corresponding views and invoking\ntheir mouseDown method as it goes.

\n

Application has a number of default events that it listens for, as\nwell as a mapping from lowercase events to camel-cased view method names. For\nexample, the keypress event causes the keyPress method on the view to be\ncalled, the dblclick event causes doubleClick to be called, and so on.

\n

If there is a bubbling browser event that Ember does not listen for by\ndefault, you can specify custom events and their corresponding view method\nnames by setting the application's customEvents property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // add support for the paste event\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent Ember from setting up a listener for a default event,\nspecify the event name with a null value in the customEvents\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // prevent listeners for mouseenter/mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n

By default, the application sets up these event listeners on the document\nbody. However, in cases where you are embedding an Ember application inside\nan existing page, you may want it to set up the listeners on an element\ninside the body.

\n

For example, if only events inside a DOM element with the ID of ember-app\nshould be delegated, set your application's rootElement property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  rootElement: '#ember-app'\n});
\n
\n
\n \n

The rootElement can be either a DOM element or a CSS selector\nstring. Note that views appended to the DOM outside the root element will\nnot receive events. If you specify a custom root element, make sure you only\nappend views inside it!

\n

To learn more about the events Ember components use, see

\n

components/handling-events.

\n

Initializers

\n

To add behavior to the Application's boot process, you can define initializers in\nthe app/initializers directory, or with ember generate initializer using Ember CLI.\nThese files should export a named initialize function which will receive the created application\nobject as its first argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
export function initialize(application) {\n  // application.inject('route', 'foo', 'service:foo');\n}
\n
\n
\n \n

Application initializers can be used for a variety of reasons including:

\n
    \n
  • setting up external libraries
  • \n
  • injecting dependencies
  • \n
  • setting up event listeners in embedded apps
  • \n
  • deferring the boot process using the deferReadiness and advanceReadiness APIs.
  • \n
\n

Routing

\n

In addition to creating your application's router, Application is\nalso responsible for telling the router when to start routing. Transitions\nbetween routes can be logged with the LOG_TRANSITIONS flag, and more\ndetailed intra-transition logging can be logged with\nthe LOG_TRANSITIONS_INTERNAL flag:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  LOG_TRANSITIONS: true, // basic logging of successful transitions\n  LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n});
\n
\n
\n \n

By default, the router will begin trying to translate the current URL into\napplication state once the browser emits the DOMContentReady event. If you\nneed to defer routing, you can call the application's deferReadiness()\nmethod. Once routing can begin, call the advanceReadiness() method.

\n

If there is any setup required before routing begins, you can implement a\nready() method on your app that will be invoked immediately before routing\nbegins.

\n", + "extends": "Engine", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/application/lib/application.ts", + "line": 188, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 435, + "description": "

Create an ApplicationInstance for this application.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the application instance", + "type": "ApplicationInstance" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 460, + "description": "

Start tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is created.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_watchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 471, + "description": "

Stop tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is about to be destroyed.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_unwatchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 484, + "description": "

Enable the legacy globals mode by allowing this application to act\nas a global namespace. See the docs on the _globalsMode property\nfor details.

\n

Most of these features are already deprecated in 1.x, so we can\nstop using them internally and try to remove them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareForGlobalsMode", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 531, + "description": "

Automatically kick-off the boot process for the application once the\nDOM has become ready.

\n

The initialization itself is scheduled on the actions queue which\nensures that code-loading finishes before booting.

\n

If you are asynchronously loading code, you should call deferReadiness()\nto defer booting, and then call advanceReadiness() once all of your code\nhas finished loading.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "waitForDOMReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 571, + "description": "

This is the autoboot flow:

\n
    \n
  1. Boot the app by calling this.boot()
  2. \n
  3. Create an instance (or use the __deprecatedInstance__ in globals mode)
  4. \n
  5. Boot the instance by calling instance.boot()
  6. \n
  7. Invoke the App.ready() callback
  8. \n
  9. Kick-off routing on the instance
  10. \n
\n

Ideally, this is all we would need to do:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
_autoBoot() {\n  this.boot().then(() => {\n    let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance();\n    return instance.boot();\n  }).then((instance) => {\n    App.ready();\n    instance.startRouting();\n  });\n}
\n
\n
\n \n

Unfortunately, we cannot actually write this because we need to participate\nin the "synchronous" boot process. While the code above would work fine on\nthe initial boot (i.e. DOM ready), when App.reset() is called, we need to\nboot a new instance synchronously (see the documentation on _bootSync()\nfor details).

\n

Because of this restriction, the actual logic of this method is located\ninside didBecomeReady().

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "domReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 616, + "description": "

Use this to defer readiness until some condition is true.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Application from '@ember/application';\n\nlet App = Application.create();\n\nApp.deferReadiness();\n\nfetch('/auth-token')\n.then(response => response.json())\n.then(data => {\n  App.token = data.token;\n  App.advanceReadiness();\n});
\n
\n
\n \n

This allows you to perform asynchronous setup logic and defer\nbooting your application until the setup has finished.

\n

However, if the setup requires a loading UI, it might be better\nto use the router for this purpose.

\n", + "itemtype": "method", + "name": "deferReadiness", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 666, + "description": "

Call advanceReadiness after any asynchronous setup logic has completed.\nEach call to deferReadiness must be matched by a call to advanceReadiness\nor the application will never become ready and routing will not begin.

\n", + "itemtype": "method", + "name": "advanceReadiness", + "see": [ + "{Application#deferReadiness}" + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 705, + "description": "

Initialize the application and return a promise that resolves with the Application\nobject when the boot process is complete.

\n

Run any application initializers and run the application load hook. These hooks may\nchoose to defer readiness. For example, an authentication hook might want to defer\nreadiness until the auth token has been retrieved.

\n

By default, this method is called automatically on "DOM ready"; however, if autoboot\nis disabled, this is automatically called when the first application instance is\ncreated via visit.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 786, + "description": "

Reset the application. This is typically used only in tests. It cleans up\nthe application in the following order:

\n
    \n
  1. Deactivate existing routes
  2. \n
  3. Destroy all objects in the container
  4. \n
  5. Create a new application container
  6. \n
  7. Re-route to the existing url
  8. \n
\n

Typical Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    App.reset();\n  }\n});\n\ntest('first test', function() {\n  // App is freshly reset\n});\n\ntest('second test', function() {\n  // App is again freshly reset\n});
\n
\n
\n \n

Advanced Example:

\n

Occasionally you may want to prevent the app from initializing during\nsetup. This could enable extra configuration, or enable asserting prior\nto the app becoming ready.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    run(function() {\n      App.reset();\n      App.deferReadiness();\n    });\n  }\n});\n\ntest('first test', function() {\n  ok(true, 'something before app is initialized');\n\n  run(function() {\n    App.advanceReadiness();\n  });\n\n  ok(true, 'something after app is initialized');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reset", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 890, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "didBecomeReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 968, + "description": "

Boot a new instance of ApplicationInstance for the current\napplication and navigate it to the given url. Returns a Promise that\nresolves with the instance when the initial routing and rendering is\ncomplete, or rejects with any error that occurred during the boot process.

\n

When autoboot is disabled, calling visit would first cause the\napplication to boot, which runs the application initializers.

\n

This method also takes a hash of boot-time configuration options for\ncustomizing the instance's behavior. See the documentation on\nApplicationInstance.BootOptions for details.

\n

ApplicationInstance.BootOptions is an interface class that exists\npurely to document the available options; you do not need to construct it\nmanually. Simply pass a regular JavaScript object containing of the\ndesired options:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Supported Scenarios

\n

While the BootOptions class exposes a large number of knobs, not all\ncombinations of them are valid; certain incompatible combinations might\nresult in unexpected behavior.

\n

For example, booting the instance in the full browser environment\nwhile specifying a foreign document object (e.g. { isBrowser: true, document: iframe.contentDocument }) does not work correctly today,\nlargely due to Ember's jQuery dependency.

\n

Currently, there are three officially supported scenarios/configurations.\nUsages outside of these scenarios are not guaranteed to work, but please\nfeel free to file bug reports documenting your experience and any issues\nyou encountered to help expand support.

\n

Browser Applications (Manual Boot)

\n

The setup is largely similar to how Ember works out-of-the-box. Normally,\nEmber will boot a default instance for your Application on "DOM ready".\nHowever, you can customize this behavior by disabling autoboot.

\n

For example, this allows you to render a miniture demo of your application\ninto a specific area on your marketing website:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let options = {\n    // Override the router's location adapter to prevent it from updating\n    // the URL in the address bar\n    location: 'none',\n\n    // Override the default `rootElement` on the app to render into a\n    // specific `div` on the page\n    rootElement: '#demo'\n  };\n\n  // Start the app at the special demo URL\n  App.visit('/demo', options);\n});
\n
\n
\n \n

Or perhaps you might want to boot two instances of your app on the same\npage for a split-screen multiplayer experience:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let sessionId = MyApp.generateSessionID();\n\n  let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' });\n  let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' });\n\n  Promise.all([player1, player2]).then(() => {\n    // Both apps have completed the initial render\n    $('#loading').fadeOut();\n  });\n});
\n
\n
\n \n

Do note that each app instance maintains their own registry/container, so\nthey will run in complete isolation by default.

\n

Server-Side Rendering (also known as FastBoot)

\n

This setup allows you to run your Ember app in a server environment using\nNode.js and render its content into static HTML for SEO purposes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap);\n\nfunction renderURL(url) {\n  let dom = new SimpleDOM.Document();\n  let rootElement = dom.body;\n  let options = { isBrowser: false, document: dom, rootElement: rootElement };\n\n  return MyApp.visit(options).then(instance => {\n    try {\n      return HTMLSerializer.serialize(rootElement.firstChild);\n    } finally {\n      instance.destroy();\n    }\n  });\n}
\n
\n
\n \n

In this scenario, because Ember does not have access to a global document\nobject in the Node.js environment, you must provide one explicitly. In practice,\nin the non-browser environment, the stand-in document object only needs to\nimplement a limited subset of the full DOM API. The SimpleDOM library is known\nto work.

\n

Since there is no DOM access in the non-browser environment, you must also\nspecify a DOM Element object in the same document for the rootElement option\n(as opposed to a selector string like "body").

\n

See the documentation on the isBrowser, document and rootElement properties\non ApplicationInstance.BootOptions for details.

\n

Server-Side Resource Discovery

\n

This setup allows you to run the routing layer of your Ember app in a server\nenvironment using Node.js and completely disable rendering. This allows you\nto simulate and discover the resources (i.e. AJAX requests) needed to fulfill\na given request and eagerly "push" these resources to the client.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
service.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import BrowserNetworkService from 'app/services/network/browser';\nimport NodeNetworkService from 'app/services/network/node';\n\n// Inject a (hypothetical) service for abstracting all AJAX calls and use\n// the appropriate implementation on the client/server. This also allows the\n// server to log all the AJAX calls made during a particular request and use\n// that for resource-discovery purpose.\n\nexport function initialize(application) {\n  if (window) { // browser\n    application.register('service:network', BrowserNetworkService);\n  } else { // node\n    application.register('service:network', NodeNetworkService);\n  }\n};\n\nexport default {\n  name: 'network-service',\n  initialize: initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\n// An example of how the (hypothetical) service is used in routes.\n\nexport default class IndexRoute extends Route {\n  @service network;\n\n  model(params) {\n    return this.network.fetch(`/api/posts/${params.post_id}.json`);\n  }\n\n  afterModel(post) {\n    if (post.isExternalContent) {\n      return this.network.fetch(`/api/external/?url=${post.externalURL}`);\n    } else {\n      return post;\n    }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
// Finally, put all the pieces together\n\nfunction discoverResourcesFor(url) {\n  return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => {\n    let networkService = instance.lookup('service:network');\n    return networkService.requests; // => { "/api/posts/123.json": "..." }\n  });\n}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "The initial URL to navigate to", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "ApplicationInstance.BootOptions" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 62, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 209, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 285, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 346, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 359, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 371, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 384, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 392, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 400, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 414, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 448, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Enginer" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 51, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + } + ], + "events": [ + { + "file": "packages/@ember/application/lib/application.ts", + "line": 943, + "description": "

Called when the Application has become ready, immediately before routing\nbegins. The call will be delayed until the DOM has become ready.

\n", + "itemtype": "event", + "name": "ready", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + } + ], + "properties": [ + { + "file": "packages/@ember/application/lib/application.ts", + "line": 233, + "description": "

The root DOM element of the Application. This can be specified as an\nelement or a selector string.

\n

This is the element that will be passed to the Application's,\neventDispatcher, which sets up the listeners for event delegation. Every\nview in your application should be a child of the element you specify here.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 248, + "itemtype": "property", + "name": "_document", + "type": "Document | null", + "default": "'window.document'", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 257, + "description": "

The Ember.EventDispatcher responsible for delegating events to this\napplication's views.

\n

The event dispatcher is created by the application at initialization time\nand sets up event listeners on the DOM element described by the\napplication's rootElement property.

\n

See the documentation for Ember.EventDispatcher for more information.

\n", + "itemtype": "property", + "name": "eventDispatcher", + "type": "Ember.EventDispatcher", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 274, + "description": "

The DOM events for which the event dispatcher should listen.

\n

By default, the application's Ember.EventDispatcher listens\nfor a set of standard DOM events, such as mousedown and\nkeyup, and delegates them to your application's Ember.View\ninstances.

\n

If you would like additional bubbling events to be delegated to your\nviews, set your Application's customEvents property\nto a hash containing the DOM event name as the key and the\ncorresponding view method name as the value. Setting an event to\na value of null will prevent a default event listener from being\nadded for that event.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // add support for the paste event\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // remove support for mouseenter / mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "customEvents", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 322, + "description": "

Whether the application should automatically start routing and render\ntemplates to the rootElement on DOM ready. While default by true,\nother environments such as FastBoot or a testing harness can set this\nproperty to false and control the precise timing and behavior of the boot\nprocess.

\n", + "itemtype": "property", + "name": "autoboot", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 336, + "description": "

Whether the application should be configured for the legacy "globals mode".\nUnder this mode, the Application object serves as a global namespace for all\nclasses.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Application from '@ember/application';\nimport Component from '@ember/component';\n\nlet App = Application.create({\n  ...\n});\n\nApp.Router.reopen({\n  location: 'none'\n});\n\nApp.Router.map({\n  ...\n});\n\nApp.MyComponent = Component.extend({\n  ...\n});
\n
\n
\n \n

This flag also exposes other internal APIs that assumes the existence of\na special "default instance", like App.__container__.lookup(...).

\n

This option is currently not configurable, its value is derived from\nthe autoboot flag – disabling autoboot also implies opting-out of\nglobals mode support, although they are ultimately orthogonal concerns.

\n

Some of the global modes features are already deprecated in 1.x. The\nexistence of this flag is to untangle the globals mode code paths from\nthe autoboot code paths, so that these legacy features can be reviewed\nfor deprecation/removal separately.

\n

Forcing the (autoboot=true, _globalsMode=false) here and running the tests\nwould reveal all the places where we are still relying on these legacy\nbehavior internally (mostly just tests).

\n", + "itemtype": "property", + "name": "_globalsMode", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 385, + "description": "

An array of application instances created by buildInstance(). Used\ninternally to ensure that all instances get destroyed.

\n", + "itemtype": "property", + "name": "_applicationInstances", + "type": "Array", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 325, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 338, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-Engine", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-ApplicationInstance-e2fd101085.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-ApplicationInstance-e2fd101085.json new file mode 100644 index 000000000..57c2edc65 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-ApplicationInstance-e2fd101085.json @@ -0,0 +1,1052 @@ +{ + "data": { + "id": "ember-4.6.0-ApplicationInstance", + "type": "class", + "attributes": { + "name": "ApplicationInstance", + "shortname": "ApplicationInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/instance.ts", + "line": 29, + "description": "

The ApplicationInstance encapsulates all of the stateful aspects of a\nrunning Application.

\n

At a high-level, we break application boot into two distinct phases:

\n
    \n
  • Definition time, where all of the classes, templates, and other\ndependencies are loaded (typically in the browser).
  • \n
  • Run time, where we begin executing the application once everything\nhas loaded.
  • \n
\n

Definition time can be expensive and only needs to happen once since it is\nan idempotent operation. For example, between test runs and FastBoot\nrequests, the application stays the same. It is only the state that we want\nto reset.

\n

That state is what the ApplicationInstance manages: it is responsible for\ncreating the container that contains all application state, and disposing of\nit once the particular test run or FastBoot request has finished.

\n", + "access": "public", + "tagname": "", + "extends": "EngineInstance", + "methods": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 306, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 39, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 86, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 152, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 169, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 199, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 39, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 65, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 126, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 51, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 55, + "description": "

The Application for which this is an instance.

\n", + "itemtype": "property", + "name": "application", + "type": "Application", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 63, + "description": "

The root DOM element of the Application as an element or a\nCSS selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "String|DOMElement", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 47, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 31, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-EngineInstance", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-ApplicationInstance.BootOptions-4c9124c9cc.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-ApplicationInstance.BootOptions-4c9124c9cc.json new file mode 100644 index 000000000..dc0b72d33 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-ApplicationInstance.BootOptions-4c9124c9cc.json @@ -0,0 +1,143 @@ +{ + "data": { + "id": "ember-4.6.0-ApplicationInstance.BootOptions", + "type": "class", + "attributes": { + "name": "ApplicationInstance.BootOptions", + "shortname": "ApplicationInstance.BootOptions", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "ApplicationInstance", + "file": "packages/@ember/application/instance.ts", + "line": 326, + "description": "

A list of boot-time configuration options for customizing the behavior of\nan ApplicationInstance.

\n

This is an interface class that exists purely to document the available\noptions; you do not need to construct it manually. Simply pass a regular\nJavaScript object containing the desired options into methods that require\none of these options object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Not all combinations of the supported options are valid. See the documentation\non Application#visit for the supported configurations.

\n

Internal, experimental or otherwise unstable flags are marked as private.

\n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 349, + "description": "

Interactive mode: whether we need to set up event delegation and invoke\nlifecycle callbacks on Components.

\n", + "itemtype": "property", + "name": "isInteractive", + "type": "boolean", + "default": "auto-detected", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 360, + "itemtype": "property", + "name": "_renderMode", + "type": "string", + "default": "undefined", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 368, + "description": "

Run in a full browser environment.

\n

When this flag is set to false, it will disable most browser-specific\nand interactive features. Specifically:

\n
    \n
  • It does not use jQuery to append the root view; the rootElement\n(either specified as a subsequent option or on the application itself)\nmust already be an Element in the given document (as opposed to a\nstring selector).

    \n
  • \n
  • It does not set up an EventDispatcher.

    \n
  • \n
  • It does not run any Component lifecycle hooks (such as didInsertElement).

    \n
  • \n
  • It sets the location option to "none". (If you would like to use\nthe location adapter specified in the app's router instead, you can also\nspecify { location: null } to specifically opt-out.)

    \n
  • \n
\n", + "itemtype": "property", + "name": "isBrowser", + "type": "boolean", + "default": "auto-detected", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 394, + "description": "

If present, overrides the router's location property with this\nvalue. This is useful for environments where trying to modify the\nURL would be inappropriate.

\n", + "itemtype": "property", + "name": "location", + "type": "string", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 406, + "description": "

Disable rendering completely.

\n

When this flag is set to false, it will disable the entire rendering\npipeline. Essentially, this puts the app into "routing-only" mode. No\ntemplates will be rendered, and no Components will be created.

\n", + "itemtype": "property", + "name": "shouldRender", + "type": "boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 420, + "description": "

If present, render into the given Document object instead of the\nglobal window.document object.

\n

In practice, this is only useful in non-browser environment or in\nnon-interactive mode, because Ember's jQuery dependency is\nimplicitly bound to the current document, causing event delegation\nto not work properly when the app is rendered into a foreign\ndocument object (such as an iframe's contentDocument).

\n

In non-browser mode, this could be a "Document-like" object as\nEmber only interact with a small subset of the DOM API in non-\ninteractive mode. While the exact requirements have not yet been\nformalized, the SimpleDOM library's implementation is known to\nwork.

\n", + "itemtype": "property", + "name": "document", + "type": "Document", + "default": "the global `document` object", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 443, + "description": "

If present, overrides the application's rootElement property on\nthe instance. This is useful for testing environment, where you\nmight want to append the root view to a fixture area.

\n

In non-browser mode, because Ember does not have access to jQuery,\nthis options must be specified as a DOM Element object instead of\na selector string.

\n

See the documentation on Application's rootElement for\ndetails.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "String|Element", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-ArrayProxy-ad82148e31.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-ArrayProxy-ad82148e31.json new file mode 100644 index 000000000..e3618f792 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-ArrayProxy-ad82148e31.json @@ -0,0 +1,1834 @@ +{ + "data": { + "id": "ember-4.6.0-ArrayProxy", + "type": "class", + "attributes": { + "name": "ArrayProxy", + "shortname": "ArrayProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.ts", + "line": 51, + "description": "

An ArrayProxy wraps any other object that implements Array and/or\nMutableArray, forwarding all requests. This makes it very useful for\na number of binding use cases or other cases where being able to swap\nout the underlying array is useful.

\n

A simple example of usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({ content: A(pets) });\n\nap.get('firstObject');                        // 'dog'\nap.set('content', ['amoeba', 'paramecium']);\nap.get('firstObject');                        // 'amoeba'
\n
\n
\n \n

This class can also be useful as a layer to transform the contents of\nan array, as they are accessed. This can be done by overriding\nobjectAtContent:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({\n    content: A(pets),\n    objectAtContent: function(idx) {\n        return this.get('content').objectAt(idx).toUpperCase();\n    }\n});\n\nap.get('firstObject'); // . 'DOG'
\n
\n
\n \n

When overriding this class, it is important to place the call to\n_super after setting content so the internal observers have\na chance to fire properly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nexport default ArrayProxy.extend({\n  init() {\n    this.set('content', A(['dog', 'cat', 'fish']));\n    this._super(...arguments);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.ts", + "line": 176, + "description": "

Should actually retrieve the object at the specified index from the\ncontent. You can override this method in subclasses to transform the\ncontent item to something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "objectAtContent", + "params": [ + { + "name": "idx", + "description": "The index to retrieve.", + "type": "Number" + } + ], + "return": { + "description": "the value or undefined if none found", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.ts", + "line": 204, + "description": "

Should actually replace the specified objects on the content array.\nYou can override this method in subclasses to transform the content item\ninto something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "replaceContent", + "params": [ + { + "name": "idx", + "description": "The starting index", + "type": "Number" + }, + { + "name": "amt", + "description": "The number of items to remove from the content.", + "type": "Number" + }, + { + "name": "objects", + "description": "Optional array of objects to insert.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1496, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1515, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1541, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1563, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1588, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1608, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1628, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1654, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1679, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1699, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1720, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1739, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1766, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1794, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1812, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1838, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 329, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 354, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 438, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 481, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 523, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 577, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 637, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 660, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 683, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 731, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 752, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 829, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 881, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 906, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 934, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 981, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1015, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1057, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1101, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1145, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1175, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1246, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1285, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1297, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1313, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1346, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1390, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1409, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1431, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.ts", + "line": 164, + "description": "

The content array. Must be an object that implements Array and/or\nMutableArray.

\n", + "itemtype": "property", + "name": "content", + "type": "EmberArray", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.ts", + "line": 393, + "description": "

The array that the proxy pretends to be. In the default ArrayProxy\nimplementation, this and content are the same. Subclasses of ArrayProxy\ncan override this property to provide things like sorting and filtering.

\n", + "itemtype": "property", + "name": "arrangedContent", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 319, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 373, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 401, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 426, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Component-289a541439.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Component-289a541439.json new file mode 100644 index 000000000..3a284620f --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Component-289a541439.json @@ -0,0 +1,1587 @@ +{ + "data": { + "id": "ember-4.6.0-Component", + "type": "class", + "attributes": { + "name": "Component", + "shortname": "Component", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 39, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault component's for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Classic components. If you are looking for the\nAPI documentation for Template-only or Glimmer components, it is\navailable here.

\n

Defining a Classic Component

\n

If you want to customize the component in order to handle events, transform\narguments or maintain internal state, you implement a subclass of Component.

\n

One example is to add computed properties to your component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  displayName: computed('person.title', 'person.firstName', 'person.lastName', function() {\n    let { title, firstName, lastName } = this.person;\n\n    if (title) {\n      return `${title} ${lastName}`;\n    } else {\n      return `${firstName} ${lastName}`;\n    }\n  })\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

Customizing a Classic Component's HTML Element in JavaScript

\n

HTML Tag

\n

The default HTML tag name used for a component's HTML representation is div.\nThis can be customized by setting the tagName property.

\n

Consider the following component class:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
paragraph.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'em'\n});
\n
\n
\n \n

When invoked, this component would produce output that looks something like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<em id="ember1" class="ember-view"></em>
\n
\n
\n \n

HTML class Attribute

\n

The HTML class attribute of a component's tag can be set by providing a\nclassNames property that is set to an array of strings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class']\n});
\n
\n
\n \n

Invoking this component will produce output that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class"></div>
\n
\n
\n \n

class attribute values can also be set by providing a classNameBindings\nproperty set to an array of properties names for the component. The return\nvalue of these properties will be added as part of the value for the\ncomponents's class attribute. These properties can be computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class'],\n  classNameBindings: ['propertyA', 'propertyB'],\n\n  propertyA: 'from-a',\n  propertyB: computed(function() {\n    if (someLogic) { return 'from-b'; }\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

Note that classNames and classNameBindings is in addition to the class\nattribute passed with the angle bracket invocation syntax. Therefore, if this\ncomponent was invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyWidget class="from-invocation" />
\n
\n
\n \n

The resulting HTML will look similar to this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="from-invocation ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

If the value of a class name binding returns a boolean the property name\nitself will be used as the class name if the property is true. The class name\nwill not be added if the value is false or undefined.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['hovered'],\n\n  hovered: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view hovered"></div>
\n
\n
\n \n

Custom Class Names for Boolean Values

\n

When using boolean class name bindings you can supply a string value other\nthan the property name for use as the class HTML attribute by appending the\npreferred value after a ":" character when defining the binding:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['awesome:so-very-cool'],\n\n  awesome: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view so-very-cool"></div>
\n
\n
\n \n

Boolean value class name bindings whose property names are in a\ncamelCase-style format will be converted to a dasherized format:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isUrgent'],\n\n  isUrgent: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view is-urgent"></div>
\n
\n
\n \n

Class name bindings can also refer to object values that are found by\ntraversing a path relative to the component itself:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport EmberObject from '@ember/object';\n\nexport default Component.extend({\n  classNameBindings: ['messages.empty'],\n\n  messages: EmberObject.create({\n    empty: true\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view empty"></div>
\n
\n
\n \n

If you want to add a class name for a property which evaluates to true and\nand a different class name if it evaluates to false, you can pass a binding\nlike this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isEnabled:enabled:disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view enabled"></div>
\n
\n
\n \n

When isEnabled is false, the resulting HTML representation looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

This syntax offers the convenience to add a class if a property is false:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\n// Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\nexport default Component.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component when the isEnabled property is true will produce\nHTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view"></div>
\n
\n
\n \n

Invoking it when the isEnabled property on the component is false will\nproduce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

Updates to the value of a class name binding will result in automatic update\nof the HTML class attribute in the component's rendered HTML\nrepresentation. If the value becomes false or undefined the class name\nwill be removed.

\n

Both classNames and classNameBindings are concatenated properties. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Other HTML Attributes

\n

The HTML attribute section of a component's tag can be set by providing an\nattributeBindings property set to an array of property names on the component.\nThe return value of these properties will be used as the value of the component's\nHTML associated attribute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['href'],\n\n  href: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

One property can be mapped on to another by placing a ":" between\nthe source property and the destination property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['url:href'],\n\n  url: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

HTML attributes passed with angle bracket invocations will take precedence\nover those specified in attributeBindings. Therefore, if this component was\ninvoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyAnchor href="http://bing.com" @url="http://google.com" />
\n
\n
\n \n

The resulting HTML will looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://bing.com"></a>
\n
\n
\n \n

Note that the href attribute is ultimately set to http://bing.com,\ndespite it having attribute binidng to the url property, which was\nset to http://google.com.

\n

Namespaced attributes (e.g. xlink:href) are supported, but have to be\nmapped, since : is not a valid character for properties in Javascript:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
use.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'use',\n  attributeBindings: ['xlinkHref:xlink:href'],\n\n  xlinkHref: '#triangle'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<use xlink:href="#triangle"></use>
\n
\n
\n \n

If the value of a property monitored by attributeBindings is a boolean, the\nattribute will be present or absent depending on the value:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: false\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id="ember1" class="ember-view" />
\n
\n
\n \n

attributeBindings can refer to computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: computed(function() {\n    if (someLogic) {\n      return true;\n    } else {\n      return false;\n    }\n  })\n});
\n
\n
\n \n

To prevent setting an attribute altogether, use null or undefined as the\nvalue of the property used in attributeBindings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'form',\n  attributeBindings: ['novalidate'],\n  novalidate: null\n});
\n
\n
\n \n

Updates to the property of an attribute binding will result in automatic\nupdate of the HTML attribute in the component's HTML output.

\n

attributeBindings is a concatenated property. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Layouts

\n

The layout property can be used to dynamically specify a template associated\nwith a component class, instead of relying on Ember to link together a\ncomponent class and a template based on file names.

\n

In general, applications should not use this feature, but it's commonly used\nin addons for historical reasons.

\n

The layout property should be set to the default export of a template\nmodule, which is the name of a template file without the .hbs extension.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>Person's Title</h1>\n<div class='details'>{{yield}}</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n
  import Component from '@ember/component';\n  import layout from '../templates/components/person-profile';\n\n  export default Component.extend({\n    layout\n  });
\n
\n
\n \n

If you invoke the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile>\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</PersonProfile>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#person-profile}}\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n{{/person-profile}}
\n
\n
\n \n

It will result in the following HTML output:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<h1>Person's Title</h1>\n  <div class="details">\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</div>
\n
\n
\n \n

Handling Browser Events

\n

Components can respond to user-initiated events in one of three ways: passing\nactions with angle bracket invocation, adding event handler methods to the\ncomponent's class, or adding actions to the component's template.

\n

Passing Actions With Angle Bracket Invocation

\n

For one-off events specific to particular instance of a component, it is possible\nto pass actions to the component's element using angle bracket invocation syntax.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyWidget {{action 'firstWidgetClicked'}} />\n\n<MyWidget {{action 'secondWidgetClicked'}} />
\n
\n
\n \n

In this case, when the first component is clicked on, Ember will invoke the\nfirstWidgetClicked action. When the second component is clicked on, Ember\nwill invoke the secondWidgetClicked action instead.

\n

Besides {{action}}, it is also possible to pass any arbitrary element modifiers\nusing the angle bracket invocation syntax.

\n

Event Handler Methods

\n

Components can also respond to user-initiated events by implementing a method\nthat matches the event name. This approach is appropriate when the same event\nshould be handled by all instances of the same component.

\n

An event object will be passed as the argument to the event handler method.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click(event) {\n    // `event.target` is either the component's element or one of its children\n    let tag = event.target.tagName.toLowerCase();\n    console.log('clicked on a `<${tag}>` HTML element!');\n  }\n});
\n
\n
\n \n

In this example, whenever the user clicked anywhere inside the component, it\nwill log a message to the console.

\n

It is possible to handle event types other than click by implementing the\nfollowing event handler methods. In addition, custom events can be registered\nby using Application.customEvents.

\n

Touch events:

\n
    \n
  • touchStart
  • \n
  • touchMove
  • \n
  • touchEnd
  • \n
  • touchCancel
  • \n
\n

Keyboard events:

\n
    \n
  • keyDown
  • \n
  • keyUp
  • \n
  • keyPress
  • \n
\n

Mouse events:

\n
    \n
  • mouseDown
  • \n
  • mouseUp
  • \n
  • contextMenu
  • \n
  • click
  • \n
  • doubleClick
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
\n

Form events:

\n
    \n
  • submit
  • \n
  • change
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
  • input
  • \n
\n

Drag and drop events:

\n
    \n
  • dragStart
  • \n
  • drag
  • \n
  • dragEnter
  • \n
  • dragLeave
  • \n
  • dragOver
  • \n
  • dragEnd
  • \n
  • drop
  • \n
\n

{{action}} Helper

\n

Instead of handling all events of a particular type anywhere inside the\ncomponent's element, you may instead want to limit it to a particular\nelement in the component's template. In this case, it would be more\nconvenient to implement an action instead.

\n

For example, you could implement the action hello for the person-profile\ncomponent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  actions: {\n    hello(name) {\n      console.log("Hello", name);\n    }\n  }\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
<h1>{{@person.name}}</h1>\n\n<button {{action 'hello' @person.name}}>\n  Say Hello to {{@person.name}}\n</button>
\n
\n
\n \n

When the user clicks the button, Ember will invoke the hello action,\npassing in the current value of @person.name as an argument.

\n

See Ember.Templates.helpers.action.

\n", + "extends": "Ember.CoreView", + "uses": [ + "Ember.ViewStateSupport", + "Ember.ViewMixin", + "Ember.ActionSupport", + "Ember.ClassNamesSupport", + "Ember.TargetActionSupport" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 656, + "description": "

Called when the attributes passed into the component have been updated.\n Called both during the initial render of a container and during a rerender.\n Can be used in place of an observer; code placed here will be executed\n every time any attribute updates.

\n", + "itemtype": "method", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 677, + "description": "

Called after a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "method", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 694, + "description": "

Called before a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "method", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 711, + "description": "

Called when the attributes passed into the component have been changed.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 728, + "description": "

Called when the component is about to update and rerender itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 745, + "description": "

Called when the component has updated and rerendered itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 951, + "description": "

Normally, Ember's component model is "write-only". The component takes a\nbunch of attributes that it got passed in, and uses them to render its\ntemplate.

\n

One nice thing about this model is that if you try to set a value to the\nsame thing as last time, Ember (through HTMLBars) will avoid doing any\nwork on the DOM.

\n

This is not just a performance optimization. If an attribute has not\nchanged, it is important not to clobber the element's "hidden state".\nFor example, if you set an input's value to the same value as before,\nit will clobber selection state and cursor position. In other words,\nsetting an attribute is not always idempotent.

\n

This method provides a way to read an element's attribute and also\nupdate the last value Ember knows about at the same time. This makes\nsetting an attribute idempotent.

\n

In particular, what this means is that if you get an <input> element's\nvalue attribute and then re-render the template with the same value,\nit will avoid clobbering the cursor and selection position.\nSince most attribute sets are idempotent in the browser, you typically\ncan get away with reading attributes using jQuery, but the most reliable\nway to do so is through this method.

\n", + "itemtype": "method", + "name": "readDOMAttr", + "params": [ + { + "name": "name", + "description": "the name of the attribute", + "type": "String" + } + ], + "return": { + "description": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 36, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 58, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 78, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 110, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 153, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 162, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 177, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 193, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 209, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 75, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 92, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 120, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 140, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 180, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 245, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 330, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 404, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 438, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 51, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.TargetActionSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 171, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 95, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 121, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 142, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 165, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 180, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 428, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Mixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 667, + "description": "

Called when the attributes passed into the component have been updated.\n Called both during the initial render of a container and during a rerender.\n Can be used in place of an observer; code placed here will be executed\n every time any attribute updates.

\n", + "itemtype": "event", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 686, + "description": "

Called after a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "event", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 703, + "description": "

Called before a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "event", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 720, + "description": "

Called when the attributes passed into the component have been changed.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 737, + "description": "

Called when the component is about to update and rerender itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 754, + "description": "

Called when the component has updated and rerendered itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 299, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 307, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 320, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 344, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 357, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 365, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 762, + "description": "

The HTML id of the component's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent @elementId="a-really-cool-id" />
\n
\n
\n \n

If not manually set a default value will be provided by the framework.\nOnce rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
export default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    var index = this.get('index');\n    this.set('elementId', `component-id${index}`);\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1011, + "description": "

Layout can be used to wrap content in a component.

\n", + "itemtype": "property", + "name": "layout", + "type": "Function", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1019, + "description": "

The name of the layout to lookup if no layout is provided.\nBy default Component will lookup a template with this name in\nEmber.TEMPLATES (a shared global object).

\n", + "itemtype": "property", + "name": "layoutName", + "type": "String", + "default": "undefined", + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1030, + "description": "

The WAI-ARIA role of the control represented by this view. For example, a\n button may have a role of type 'button', or a pane may have a role of\n type 'alertdialog'. This property is used by assistive software to help\n visually challenged users navigate rich web applications.

\n

The full list of valid WAI-ARIA roles is available at:\n https://www.w3.org/TR/wai-aria/#roles_categorization

\n", + "itemtype": "property", + "name": "ariaRole", + "type": "String", + "default": "undefined", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1055, + "description": "

Enables components to take a list of parameters as arguments.\n For example, a component that takes two parameters with the names\n name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: ['name', 'age']\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" 38}}
\n
\n
\n \n

The parameters can be referred to just like named parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Name: {{name}}, Age: {{age}}.
\n
\n
\n \n

Using a string instead of an array allows for an arbitrary number of\n parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: 'names'\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" "Michael" "Scott"}}
\n
\n
\n \n

The parameters can then be referred to by enumerating over the list:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{#each names as |name|}}{{name}}{{/each}}
\n
\n
\n \n", + "static": 1, + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "positionalParams", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 36, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 34, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 165, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 266, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 377, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/child_views_support.ts", + "line": 13, + "description": "

Array of child views. You should never edit this array directly.

\n", + "itemtype": "property", + "name": "childViews", + "type": "Array", + "default": "[]", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 35, + "description": "

Standard CSS class names to apply to the view's outer element. This\nproperty automatically inherits any class names defined by the view's\nsuperclasses as well.

\n", + "itemtype": "property", + "name": "classNames", + "type": "Array", + "default": "['ember-view']", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 47, + "description": "

A list of properties of the view to apply as class names. If the property\nis a string value, the value of that string will be applied as a class\nname.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'high' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['priority'],\n  priority: 'high'\n});
\n
\n
\n \n

If the value of the property is a Boolean, the name of that property is\nadded as a dasherized class name.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'is-urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would prefer to use a custom value instead of the dasherized\nproperty name, you can pass a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent:urgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would like to specify a class that should only be added when the\nproperty is false, you can declare a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'disabled' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: false\n});
\n
\n
\n \n

This list of properties is inherited from the component's superclasses as well.

\n", + "itemtype": "property", + "name": "classNameBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 26, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-Ember.CoreView", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-ComputedProperty-c20af30b2d.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-ComputedProperty-c20af30b2d.json new file mode 100644 index 000000000..ddbf1f7a0 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-ComputedProperty-c20af30b2d.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-4.6.0-ComputedProperty", + "type": "class", + "attributes": { + "name": "ComputedProperty", + "shortname": "ComputedProperty", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 77, + "description": "

@computed is a decorator that turns a JavaScript getter and setter into a\ncomputed property, which is a cached, trackable value. By default the getter\nwill only be called once and the result will be cached. You can specify\nvarious properties that your computed property depends on. This will force the\ncached result to be cleared if the dependencies are modified, and lazily recomputed the next time something asks for it.

\n

In the following example we decorate a getter - fullName - by calling\ncomputed with the property dependencies (firstName and lastName) as\narguments. The fullName getter will be called once (regardless of how many\ntimes it is accessed) as long as its dependencies do not change. Once\nfirstName or lastName are updated any future calls to fullName will\nincorporate the new values, and any watchers of the value such as templates\nwill be updated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet tom = new Person('Tom', 'Dale');\n\ntom.fullName; // 'Tom Dale'
\n
\n
\n \n

You can also provide a setter, which will be used when updating the computed\nproperty. Ember's set function must be used to update the property\nsince it will also notify observers of the property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(' ');\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

You can also pass a getter function or object with get and set functions\nas the last argument to the computed decorator. This allows you to define\ncomputed property macros:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { computed } from '@ember/object';\n\nfunction join(...keys) {\n  return computed(...keys, function() {\n    return keys.map(key => this[key]).join(' ');\n  });\n}\n\nclass Person {\n  @join('firstName', 'lastName')\n  fullName;\n}
\n
\n
\n \n

Note that when defined this way, getters and setters receive the key of the\nproperty they are decorating as the first argument. Setters receive the value\nthey are setting to as the second argument instead. Additionally, setters must\nreturn the value that should be cached:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { computed, set } from '@ember/object';\n\nfunction fullNameMacro(firstNameKey, lastNameKey) {\n  return computed(firstNameKey, lastNameKey, {\n    get() {\n      return `${this[firstNameKey]} ${this[lastNameKey]}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, firstNameKey, firstName);\n      set(this, lastNameKey, lastName);\n\n      return value;\n    }\n  });\n}\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @fullNameMacro('firstName', 'lastName') fullName;\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

Computed properties can also be used in classic classes. To do this, we\nprovide the getter and setter as the last argument like we would for a macro,\nand we assign it to a property on the class definition. This is an anonymous\ncomputed macro:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import EmberObject, { computed, set } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  // these will be supplied by `create`\n  firstName: null,\n  lastName: null,\n\n  fullName: computed('firstName', 'lastName', {\n    get() {\n      return `${this.firstName} ${this.lastName}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, 'firstName', firstName);\n      set(this, 'lastName', lastName);\n\n      return value;\n    }\n  })\n});\n\nlet tom = Person.create({\n  firstName: 'Tom',\n  lastName: 'Dale'\n});\n\ntom.get('fullName') // 'Tom Dale'
\n
\n
\n \n

You can overwrite computed property without setters with a normal property (no\nlonger computed) that won't change if dependencies change. You can also mark\ncomputed property as .readOnly() and block all attempts to set it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName').readOnly()\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet person = new Person();\nperson.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX>
\n
\n
\n \n

Additional resources:

\n\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 607, + "description": "

Call on a computed property to set it into read-only mode. When in this\nmode the computed property will throw an error when set.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  @computed().readOnly()\n  get guid() {\n    return 'guid-guid-guid';\n  }\n}\n\nlet person = new Person();\nset(person, 'guid', 'new-guid'); // will throw an exception
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  guid: computed(function() {\n    return 'guid-guid-guid';\n  }).readOnly()\n});\n\nlet person = Person.create();\nperson.set('guid', 'new-guid'); // will throw an exception
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "return": { + "description": "this", + "type": "ComputedProperty" + }, + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 657, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For example,\ncomputed property functions may close over variables that are then no longer\navailable for introspection. You can pass a hash of these values to a\ncomputed property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nclass Store {\n  @computed().meta({ type: Person })\n  get person() {\n    let personId = this.personId;\n    return Person.create({ id: personId });\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nconst Store = EmberObject.extend({\n  person: computed(function() {\n    let personId = this.get('personId');\n    return Person.create({ id: personId });\n  }).meta({ type: Person })\n});
\n
\n
\n \n

The hash that you pass to the meta() function will be saved on the\ncomputed property descriptor under the _meta key. Ember runtime\nexposes a public API for retrieving these values from classes,\nvia the metaForProperty() function.

\n", + "itemtype": "method", + "name": "meta", + "params": [ + { + "name": "meta", + "description": "", + "type": "Object" + } + ], + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Container-81db5dce78.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Container-81db5dce78.json new file mode 100644 index 000000000..8e93d0a24 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Container-81db5dce78.json @@ -0,0 +1,175 @@ +{ + "data": { + "id": "ember-4.6.0-Container", + "type": "class", + "attributes": { + "name": "Container", + "shortname": "Container", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 53, + "description": "

A container used to instantiate and cache objects.

\n

Every Container must be associated with a Registry, which is referenced\nto determine the factory and options that should be used to instantiate\nobjects.

\n

The public API for Container is still in flux and should not be considered\nstable.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 112, + "description": "

Given a fullName return a corresponding instance.\n The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter');\ntwitter instanceof Twitter; // => true\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted, an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "TypeOptions", + "optional": true + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 151, + "description": "

A depth first traversal, destroying the container, its descendant containers and all\ntheir managed objects.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "destroy", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 168, + "description": "

Clear either the entire cache or just the cache for a particular key.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "params": [ + { + "name": "fullName", + "description": "optional key to reset; if missing, resets everything", + "type": "String" + } + ], + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 185, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "return": { + "description": "", + "type": "Object" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 198, + "description": "

Given a fullName, return the corresponding factory. The consumer of the factory\nis responsible for the destruction of any factory instances, as there is no\nway for the container to ensure instances are destroyed when it itself is\ndestroyed.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 93, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registry", + "type": "Registry", + "since": "1.11.0", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 100, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "cache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 106, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "validationCache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-ContainerDebugAdapter-cf8a35a7ec.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-ContainerDebugAdapter-cf8a35a7ec.json new file mode 100644 index 000000000..4f4df2816 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-ContainerDebugAdapter-cf8a35a7ec.json @@ -0,0 +1,592 @@ +{ + "data": { + "id": "ember-4.6.0-ContainerDebugAdapter", + "type": "class", + "attributes": { + "name": "ContainerDebugAdapter", + "shortname": "ContainerDebugAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.ts", + "line": 12, + "description": "

The ContainerDebugAdapter helps the container and resolver interface\nwith tools that debug Ember such as the\nEmber Inspector\nfor Chrome and Firefox.

\n

This class can be extended by a custom resolver implementer\nto override some of the methods with library-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • canCatalogEntriesByType
  • \n
  • catalogEntriesByType
  • \n
\n

The adapter will need to be registered\nin the application's container as container-debug-adapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "containerDebugAdapter",\n\n  initialize(application) {\n    application.register('container-debug-adapter:main', require('app/container-debug-adapter'));\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "since": "1.5.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.ts", + "line": 63, + "description": "

Returns true if it is possible to catalog a list of available\nclasses in the resolver for a given type.

\n", + "itemtype": "method", + "name": "canCatalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "whether a list is available for this type.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.ts", + "line": 80, + "description": "

Returns the available classes a given type.

\n", + "itemtype": "method", + "name": "catalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "An array of strings.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.ts", + "line": 53, + "description": "

The resolver instance of the application\nbeing debugged. This property will be injected\non creation.

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-ContainerProxyMixin-5cf527cb09.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-ContainerProxyMixin-5cf527cb09.json new file mode 100644 index 000000000..09cc51cd1 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-ContainerProxyMixin-5cf527cb09.json @@ -0,0 +1,131 @@ +{ + "data": { + "id": "ember-4.6.0-ContainerProxyMixin", + "type": "class", + "attributes": { + "name": "ContainerProxyMixin", + "shortname": "ContainerProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 19, + "description": "

ContainerProxyMixin is used to provide public access to specific\ncontainer functionality.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 39, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "ContainerProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 65, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ContainerProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 126, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ContainerProxyMixin", + "module": "ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 31, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ContainerProxyMixin", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Controller-4962ce1d15.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Controller-4962ce1d15.json new file mode 100644 index 000000000..9c5e0ea66 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Controller-4962ce1d15.json @@ -0,0 +1,724 @@ +{ + "data": { + "id": "ember-4.6.0-Controller", + "type": "class", + "attributes": { + "name": "Controller", + "shortname": "Controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "", + "file": "packages/@ember/controller/index.ts", + "line": 11, + "extends": "EmberObject", + "uses": [ + "Ember.ControllerMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 54, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 75, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 96, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 186, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 171, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 26, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.ts", + "line": 43, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.ts", + "line": 63, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 26, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-CoreObject-7f11faf39e.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-CoreObject-7f11faf39e.json new file mode 100644 index 000000000..9af0eba3f --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-CoreObject-7f11faf39e.json @@ -0,0 +1,158 @@ +{ + "data": { + "id": "ember-4.6.0-CoreObject", + "type": "class", + "attributes": { + "name": "CoreObject", + "shortname": "CoreObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 173, + "description": "

CoreObject is the base class for all Ember constructs. It establishes a\nclass system based on Ember's Mixin system, and provides the basis for the\nEmber Object Model. CoreObject should generally not be used directly,\ninstead you should use EmberObject.

\n

Usage

\n

You can define a class by extending from CoreObject using the extend\nmethod:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Person = CoreObject.extend({\n  name: 'Tomster',\n});
\n
\n
\n \n

For detailed usage, see the Object Model\nsection of the guides.

\n

Usage with Native Classes

\n

Native JavaScript class syntax can be used to extend from any CoreObject\nbased class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
class Person extends CoreObject {\n  init() {\n    super.init(...arguments);\n    this.name = 'Tomster';\n  }\n}
\n
\n
\n \n

Some notes about class usage:

\n
    \n
  • new syntax is not currently supported with classes that extend from\nEmberObject or CoreObject. You must continue to use the create method\nwhen making new instances of classes, even if they are defined using native\nclass syntax. If you want to use new syntax, consider creating classes\nwhich do not extend from EmberObject or CoreObject. Ember features,\nsuch as computed properties and decorators, will still work with base-less\nclasses.
  • \n
  • Instead of using this._super(), you must use standard super syntax in\nnative classes. See the MDN docs on classes\nfor more details.
  • \n
  • Native classes support using constructors\nto set up newly-created instances. Ember uses these to, among other things,\nsupport features that need to retrieve other entities by name, like Service\ninjection and getOwner. To ensure your custom instance setup logic takes\nplace after this important work is done, avoid using the constructor in\nfavor of init.
  • \n
  • Properties passed to create will be available on the instance by the time\ninit runs, so any code that requires these values should work at that\ntime.
  • \n
  • Using native classes, and switching back to the old Ember Object model is\nfully supported.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.6.0-Helper" + }, + { + "type": "class", + "id": "ember-4.6.0-EmberObject" + } + ] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-DataAdapter-fda7225810.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-DataAdapter-fda7225810.json new file mode 100644 index 000000000..792463b4f --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-DataAdapter-fda7225810.json @@ -0,0 +1,935 @@ +{ + "data": { + "id": "ember-4.6.0-DataAdapter", + "type": "class", + "attributes": { + "name": "DataAdapter", + "shortname": "DataAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 156, + "description": "

The DataAdapter helps a data persistence library\ninterface with tools that debug Ember such\nas the Ember Inspector\nfor Chrome and Firefox.

\n

This class will be extended by a persistence library\nwhich will override some of the methods with\nlibrary-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • getFilters
  • \n
  • detect
  • \n
  • columnsForType
  • \n
  • getRecords
  • \n
  • getRecordColumnValues
  • \n
  • getRecordKeywords
  • \n
  • getRecordFilterValues
  • \n
  • getRecordColor
  • \n
\n

The adapter will need to be registered\nin the application's container as dataAdapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "data-adapter",\n\n  initialize: function(application) {\n    application.register('data-adapter:main', DS.DataAdapter);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 283, + "description": "

Specifies how records can be filtered.\nRecords returned will need to have a filterValues\nproperty with a key for every name in the returned array.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getFilters", + "return": { + "description": "List of objects defining filters.\n The object should have a `name` and `desc` property.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 297, + "description": "

Fetch the model types and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchModelTypes", + "params": [ + { + "name": "typesAdded", + "description": "Callback to call to add types.\nTakes an array of objects containing wrapped types (returned from `wrapModelType`).", + "type": "Function" + }, + { + "name": "typesUpdated", + "description": "Callback to call when a type has changed.\nTakes an array of objects containing wrapped types.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 345, + "description": "

Fetch the records of a given type and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchRecords", + "params": [ + { + "name": "modelName", + "description": "The model name.", + "type": "String" + }, + { + "name": "recordsAdded", + "description": "Callback to call to add records.\nTakes an array of objects containing wrapped records.\nThe object should have the following properties:\n columnValues: {Object} The key and value of a table cell.\n object: {Object} The actual record object.", + "type": "Function" + }, + { + "name": "recordsUpdated", + "description": "Callback to call when a record has changed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + }, + { + "name": "recordsRemoved", + "description": "Callback to call when a record has removed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 417, + "description": "

Clear all observers before destruction

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 435, + "description": "

Detect whether a class is a model.

\n

Test that against the model class\nof your persistence library.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "detect", + "return": { + "description": "boolean Whether the class is a model class or not." + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 449, + "description": "

Get the columns for a given model type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "columnsForType", + "return": { + "description": "An array of columns of the following format:\n name: {String} The name of the column.\n desc: {String} Humanized description (what would show in a table column name).", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 462, + "description": "

Adds observers to a model type class.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "observeModelType", + "params": [ + { + "name": "modelName", + "description": "The model type name.", + "type": "String" + }, + { + "name": "typesUpdated", + "description": "Called when a type is modified.", + "type": "Function" + } + ], + "return": { + "description": "The function to call to remove observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 499, + "description": "

Wraps a given model type and observes changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapModelType", + "params": [ + { + "name": "klass", + "description": "A model class.", + "type": "Class" + }, + { + "name": "modelName", + "description": "Name of the class.", + "type": "String" + } + ], + "return": { + "description": "The wrapped type has the following format:\n name: {String} The name of the type.\n count: {Integer} The number of records available.\n columns: {Columns} An array of columns to describe the record.\n object: {Class} The actual Model type class.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 523, + "description": "

Fetches all models defined in the application.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getModelTypes", + "return": { + "description": "Array of model types.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 548, + "description": "

Loops over all namespaces and all objects\nattached to them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getObjectsOnNamespaces", + "return": { + "description": "Array of model type strings.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 577, + "description": "

Fetches all loaded records for a given type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecords", + "return": { + "description": "An array of records.\n This array will be observed for changes,\n so it should update when new records are added/removed.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 590, + "description": "

Wraps a record and observers changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapRecord", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The wrapped record. Format:\ncolumnValues: {Array}\nsearchKeywords: {Array}", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 610, + "description": "

Gets the values for each column.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColumnValues", + "return": { + "description": "Keys should match column names defined\nby the model type.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 622, + "description": "

Returns keywords to match when searching records.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordKeywords", + "return": { + "description": "Relevant keywords for search.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 633, + "description": "

Returns the values of filters defined by getFilters.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordFilterValues", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The filter values.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 645, + "description": "

Each record can have a color that represents its state.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColor", + "params": [ + { + "name": "record", + "description": "The record instance", + "type": "Object" + } + ], + "return": { + "description": "The records color.\n Possible options: black, red, blue, green.", + "type": "String" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 212, + "description": "

The container-debug-adapter which is used\nto list all models.

\n", + "itemtype": "property", + "name": "containerDebugAdapter", + "default": "undefined", + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 222, + "description": "

The number of attributes to send\nas columns. (Enough to make the record\nidentifiable).

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "attributeLimit", + "default": "3", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 234, + "description": "

Ember Data > v1.0.0-beta.18\nrequires string model names to be passed\naround instead of the actual factories.

\n

This is a stamp for the Ember Inspector\nto differentiate between the versions\nto be able to support older versions too.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "acceptsModelName", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 248, + "description": "

Map from records arrays to RecordsWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "recordsWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 256, + "description": "

Map from records arrays to TypeWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "typeWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 264, + "description": "

Callback that is currently scheduled on backburner end to flush and check\nall active watchers.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "flushWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 274, + "description": "

Stores all methods that clear observers.\nThese methods will be called on destruction.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "releaseMethods", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.ActionHandler-b74ae5f873.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.ActionHandler-b74ae5f873.json new file mode 100644 index 000000000..c0cc17b04 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.ActionHandler-b74ae5f873.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.6.0-Ember.ActionHandler", + "type": "class", + "attributes": { + "name": "Ember.ActionHandler", + "shortname": "Ember.ActionHandler", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.ControllerMixin", + "Ember.CoreView" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 8, + "description": "

Ember.ActionHandler is available on some familiar classes including\nRoute, Component, and Controller.\n(Internally the mixin is used by Ember.CoreView, Ember.ControllerMixin,\nand Route and available to the above classes through\ninheritance.)

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 171, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 26, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.ControllerMixin-6eceab4b02.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.ControllerMixin-6eceab4b02.json new file mode 100644 index 000000000..3170d2c6e --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.ControllerMixin-6eceab4b02.json @@ -0,0 +1,223 @@ +{ + "data": { + "id": "ember-4.6.0-Ember.ControllerMixin", + "type": "class", + "attributes": { + "name": "Ember.ControllerMixin", + "shortname": "Ember.ControllerMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Controller" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/controller/lib/controller_mixin.ts", + "line": 17, + "uses": [ + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 54, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 75, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 96, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 186, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 171, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 26, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.ts", + "line": 43, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.ts", + "line": 63, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 26, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.CoreView-79971ca73f.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.CoreView-79971ca73f.json new file mode 100644 index 000000000..a08d18873 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.CoreView-79971ca73f.json @@ -0,0 +1,933 @@ +{ + "data": { + "id": "ember-4.6.0-Ember.CoreView", + "type": "class", + "attributes": { + "name": "Ember.CoreView", + "shortname": "Ember.CoreView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 7, + "description": "

Ember.CoreView is an abstract class that exists to give view-like behavior\nto both Ember's main view class Component and other classes that don't need\nthe full functionality of Component.

\n

Unless you have specific needs for CoreView, you will use Component\nin your applications.

\n", + "extends": "EmberObject", + "deprecated": true, + "deprecationMessage": "Use `Component` instead.", + "uses": [ + "Evented", + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 36, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 58, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 78, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 110, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 153, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 162, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 177, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 193, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 209, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 75, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 95, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 121, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 142, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 165, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 180, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 171, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 36, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 26, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.6.0-Component" + } + ] + }, + "module": { + "data": { + "id": "ember-4.6.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.EventDispatcher-0f28bd048f.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.EventDispatcher-0f28bd048f.json new file mode 100644 index 000000000..e9d9c6ad3 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.EventDispatcher-0f28bd048f.json @@ -0,0 +1,174 @@ +{ + "data": { + "id": "ember-4.6.0-Ember.EventDispatcher", + "type": "class", + "attributes": { + "name": "Ember.EventDispatcher", + "shortname": "Ember.EventDispatcher", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 19, + "description": "

Ember.EventDispatcher handles delegating browser events to their\ncorresponding Ember.Views. For example, when you click on a view,\nEmber.EventDispatcher ensures that that view's mouseDown method gets\ncalled.

\n", + "access": "private", + "tagname": "", + "extends": "Ember.Object", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 114, + "description": "

Sets up event listeners for standard browser events.

\n

This will be called after the browser sends a DOMContentReady event. By\ndefault, it will set up all of the listeners on the document body. If you\nwould like to register the listeners on a different element, set the event\ndispatcher's root property.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "params": [ + { + "name": "addedEvents", + "description": "", + "type": "Object" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 208, + "description": "

Setup event listeners for the given browser event name

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForBrowserEvent", + "params": [ + { + "name": "event", + "description": "the name of the event in the browser" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 221, + "description": "

Setup event listeners for the given Ember event name (camel case)

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForEmberEvent", + "params": [ + { + "name": "eventName", + "description": "" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 238, + "description": "

Registers an event listener on the rootElement. If the given event is\ntriggered, the provided event handler will be triggered on the target view.

\n

If the target view does not implement the event handler, or if the handler\nreturns false, the parent view will be called. The event will continue to\nbubble to each successive parent view until it reaches the top.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandler", + "params": [ + { + "name": "rootElement", + "description": "", + "type": "Element" + }, + { + "name": "event", + "description": "the name of the event in the browser", + "type": "String" + }, + { + "name": "eventName", + "description": "the name of the method to call on the view", + "type": "String" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/system/action_manager.ts", + "line": 9, + "description": "

Global action id hash.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registeredActions", + "type": "Object", + "class": "Ember.EventDispatcher", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 31, + "description": "

The set of events names (and associated handler function names) to be setup\nand dispatched by the EventDispatcher. Modifications to this list can be done\nat setup time, generally via the Application.customEvents hash.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "events", + "type": "Object", + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 91, + "description": "

The root DOM element to which event listeners should be attached. Event\nlisteners will be attached to the document unless this is overridden.

\n

Can be specified as a DOMElement or a selector string.

\n

The default body is a string since this may be evaluated before document.body\nexists in the DOM.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.Object", + "type": "missing" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.NativeArray-17f2b9166d.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.NativeArray-17f2b9166d.json new file mode 100644 index 000000000..695625190 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.NativeArray-17f2b9166d.json @@ -0,0 +1,1636 @@ +{ + "data": { + "id": "ember-4.6.0-Ember.NativeArray", + "type": "class", + "attributes": { + "name": "Ember.NativeArray", + "shortname": "Ember.NativeArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1896, + "description": "

The NativeArray mixin contains the properties needed to make the native\nArray support MutableArray and all of its dependent APIs. Unless you\nhave EmberENV.EXTEND_PROTOTYPES or EmberENV.EXTEND_PROTOTYPES.Array set to\nfalse, this will be applied automatically. Otherwise you can apply the mixin\nat anytime by calling Ember.NativeArray.apply(Array.prototype).

\n", + "uses": [ + "Observable", + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1496, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1515, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1541, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1563, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1588, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1608, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1628, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1654, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1679, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1699, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1720, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1739, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1766, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1794, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1812, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1838, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 329, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 354, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 438, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 481, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 523, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 577, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 637, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 660, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 683, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 731, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 752, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 829, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 881, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 906, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 934, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 981, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1015, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1057, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1101, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1145, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1175, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1246, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1285, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1297, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1313, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1346, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1390, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1409, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1431, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 319, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 373, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 401, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 426, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.TargetActionSupport-d90c7962c2.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.TargetActionSupport-d90c7962c2.json new file mode 100644 index 000000000..22a03fb49 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.TargetActionSupport-d90c7962c2.json @@ -0,0 +1,101 @@ +{ + "data": { + "id": "ember-4.6.0-Ember.TargetActionSupport", + "type": "class", + "attributes": { + "name": "Ember.TargetActionSupport", + "shortname": "Ember.TargetActionSupport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 10, + "description": "

Ember.TargetActionSupport is a mixin that can be included in a class\nto add a triggerAction method with semantics similar to the Handlebars\n{{action}} helper. In normal Ember usage, the {{action}} helper is\nusually the best choice. This mixin is most often useful when you are\ndoing more complex event handling in Components.

\n", + "extends": "Mixin", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 51, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 428, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Mixin" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-Mixin", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.Templates.components-b9d30a4e67.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.Templates.components-b9d30a4e67.json new file mode 100644 index 000000000..508c03028 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.Templates.components-b9d30a4e67.json @@ -0,0 +1,85 @@ +{ + "data": { + "id": "ember-4.6.0-Ember.Templates.components", + "type": "class", + "attributes": { + "name": "Ember.Templates.components", + "shortname": "Ember.Templates.components", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 66, + "description": "

The Input component lets you create an HTML <input> element.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value="987" />
\n
\n
\n \n

creates an <input> element with type="text" and value set to 987.

\n

Text field

\n

If no type argument is specified, a default of type 'text' is used.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Search:\n<Input @value={{this.searchWord}} />
\n
\n
\n \n

In this example, the initial value in the <input> will be set to the value of\nthis.searchWord. If the user changes the text, the value of this.searchWord will also be\nupdated.

\n

Actions

\n

The Input component takes a number of arguments with callbacks that are invoked in response to\nuser events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-down
  • \n
  • key-press
  • \n
  • key-up
  • \n
\n

These callbacks are passed to Input like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Starting with Ember Octane, we recommend using the {{on}} modifier to call actions\non specific events, such as the input event.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
<label for="input-name">Name:</label>\n<Input\n  @id="input-name"\n  @value={{this.name}}\n  {{on "input" this.validateName}}\n/>
\n
\n
\n \n

The event name (e.g. focusout, input, keydown) always follows the casing\nthat the HTML standard uses.

\n

<input> HTML Attributes to Avoid

\n

In most cases, if you want to pass an attribute to the underlying HTML <input> element, you\ncan pass the attribute directly, just like any other Ember component.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @type="text" size="10" />
\n
\n
\n \n

In this example, the size attribute will be applied to the underlying <input> element in the\noutputted HTML.

\n

However, there are a few attributes where you must use the @ version.

\n
    \n
  • @type: This argument is used to control which Ember component is used under the hood
  • \n
  • @value: The @value argument installs a two-way binding onto the element. If you wanted a\none-way binding, use <input> with the value property and the input event instead.
  • \n
  • @checked (for checkboxes): like @value, the @checked argument installs a two-way binding\nonto the element. If you wanted a one-way binding, use <input type="checkbox"> with\nchecked and the input event instead.
  • \n
\n

Extending TextField

\n

Internally, <Input @type="text" /> creates an instance of TextField, passing arguments from\nthe helper to TextField's create method. Subclassing TextField is supported but not\nrecommended.

\n

See TextField

\n

Checkbox

\n

To create an <input type="checkbox">:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Emberize Everything:\n<Input @type="checkbox" @checked={{this.isEmberized}} name="isEmberized" />
\n
\n
\n \n

This will bind the checked state of this checkbox to the value of isEmberized -- if either one\nchanges, it will be reflected in the other.

\n

Extending Checkbox

\n

Internally, <Input @type="checkbox" /> creates an instance of Checkbox. Subclassing\nTextField is supported but not recommended.

\n

See Checkbox

\n", + "itemtype": "method", + "name": "Input", + "see": [ + "{TextField}", + "{Checkbox}" + ], + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 41, + "description": "

The LinkTo component renders a link to the supplied routeName passing an optionally\nsupplied model to the route as its model context of the route. The block for LinkTo\nbecomes the contents of the rendered element:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

Disabling the LinkTo component

\n

The LinkTo component can be disabled by using the disabled argument. A disabled link\ndoesn't result in a transition when activated, and adds the disabled class to the <a>\nelement.

\n

(The class name to apply to the element can be overridden by using the disabledClass\nargument)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @disabled={{true}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

Handling href

\n

<LinkTo> will use your application's Router to fill the element's href property with a URL\nthat matches the path to the supplied routeName.

\n

Handling current route

\n

The LinkTo component will apply a CSS class name of 'active' when the application's current\nroute matches the supplied routeName. For example, if the application's current route is\n'photoGallery.recent', then the following invocation of LinkTo:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

will result in

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="active">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

The CSS class used for active classes can be customized by passing an activeClass argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent' @activeClass="current-url">\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="current-url">\n  Great Hamster Photos\n</a>
\n
\n
\n \n\n

If you need a link to be 'active' even when it doesn't match the current route, you can use the\ncurrent-when argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @current-when='photos'>\n  Photo Gallery\n</LinkTo>
\n
\n
\n \n

This may be helpful for keeping links active for:

\n
    \n
  • non-nested routes that are logically related
  • \n
  • some secondary menu approaches
  • \n
  • 'top navigation' with 'sub navigation' scenarios
  • \n
\n

A link will be active if current-when is true or the current\nroute is the route this link would transition to.

\n

To match multiple routes 'space-separate' the routes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='gallery' @current-when='photos drawings paintings'>\n  Art Gallery\n</LinkTo>
\n
\n
\n \n

Supplying a model

\n

An optional model argument can be used for routes whose\npaths contain dynamic segments. This argument will become\nthe model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", {path: "hamster-photos/:photo_id"});\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{this.aPhoto}}>\n  {{aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

Supplying multiple models

\n

For deep-linking to route paths that contain multiple\ndynamic segments, the models argument can be used.

\n

As the router transitions through the route path, each\nsupplied model argument will become the context for the\nroute with the dynamic segments:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() {\n    this.route("comment", {path: "comments/:comment_id"});\n  });\n});
\n
\n
\n \n

This argument will become the model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.comment' @models={{array this.aPhoto this.comment}}>\n  {{comment.body}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42/comments/718">\n  A+++ would snuggle again.\n</a>
\n
\n
\n \n

Supplying an explicit dynamic segment value

\n

If you don't have a model object available to pass to LinkTo,\nan optional string or integer argument can be passed for routes whose\npaths contain dynamic segments. This argument will become the value\nof the dynamic segment:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{aPhotoId}}>\n  {{this.aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

When transitioning into the linked route, the model hook will\nbe triggered with parameters including this passed identifier.

\n

Supplying query parameters

\n

If you need to add optional key-value pairs that appear to the right of the ? in a URL,\nyou can use the query argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @query={{hash page=1 per_page=20}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos?page=1&per_page=20">\n  Great Hamster Photos\n</a>
\n
\n
\n \n", + "itemtype": "method", + "name": "LinkTo", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 9, + "description": "

The Textarea component inserts a new instance of <textarea> tag into the template.

\n

The @value argument provides the content of the <textarea>.

\n

This template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value="A bunch of text" />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  A bunch of text\n</textarea>
\n
\n
\n \n

The @value argument is two-way bound. If the user types text into the textarea, the @value\nargument is updated. If the @value argument is updated, the text in the textarea is updated.

\n

In the following example, the writtenWords property on the component will be updated as the user\ntypes 'Lots of text' into the text area of their browser's window.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class WordEditorComponent extends Component {\n  @tracked writtenWords = "Lots of text that IS bound";\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{writtenWords}} />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  Lots of text that IS bound\n</textarea>
\n
\n
\n \n

If you wanted a one way binding, you could use the <textarea> element directly, and use the\nvalue DOM property and the input event.

\n

Actions

\n

The Textarea component takes a number of arguments with callbacks that are invoked in\nresponse to user events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-press
  • \n
\n

These callbacks are passed to Textarea like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Classic Invocation Syntax

\n

The Textarea component can also be invoked using curly braces, just like any other Ember\ncomponent.

\n

For example, this is an invocation using angle-bracket notation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

You could accomplish the same thing using classic invocation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{textarea value=this.searchWord enter=this.query}}
\n
\n
\n \n

The main difference is that angle-bracket invocation supports any HTML attribute using HTML\nattribute syntax, because attributes and arguments have different syntax when using angle-bracket\ninvocation. Curly brace invocation, on the other hand, only has a single syntax for arguments,\nand components must manually map attributes onto component arguments.

\n

When using classic invocation with {{textarea}}, only the following attributes are mapped onto\narguments:

\n
    \n
  • rows
  • \n
  • cols
  • \n
  • name
  • \n
  • selectionEnd
  • \n
  • selectionStart
  • \n
  • autocomplete
  • \n
  • wrap
  • \n
  • lang
  • \n
  • dir
  • \n
  • value
  • \n
\n

Classic layout and layoutName properties

\n

Because HTML textarea elements do not contain inner HTML the layout and\nlayoutName properties will not be applied.

\n", + "itemtype": "method", + "name": "Textarea", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.Templates.helpers-57eddaeb3c.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.Templates.helpers-57eddaeb3c.json new file mode 100644 index 000000000..a9b0ddc81 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.Templates.helpers-57eddaeb3c.json @@ -0,0 +1,484 @@ +{ + "data": { + "id": "ember-4.6.0-Ember.Templates.helpers", + "type": "class", + "attributes": { + "name": "Ember.Templates.helpers", + "shortname": "Ember.Templates.helpers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 86, + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 45, + "description": "

See Ember.Templates.components.Input.

\n", + "itemtype": "method", + "name": "input", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 253, + "description": "

See Ember.Templates.components.LinkTo.

\n", + "itemtype": "method", + "name": "link-to", + "see": [ + "{Ember.Templates.components.LinkTo}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 122, + "description": "

See Ember.Templates.components.Textarea.

\n", + "itemtype": "method", + "name": "textarea", + "see": [ + "{Ember.Templates.components.Textarea}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/action.ts", + "line": 18, + "description": "

The {{action}} helper provides a way to pass triggers for behavior (usually\njust a function) between components, and into components from controllers.

\n

Passing functions with the action helper

\n

There are three contexts an action helper can be used in. The first two\ncontexts to discuss are attribute context, and Handlebars value context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>\n{{! Examples of Handlebars value context }}\n{{input on-input=(action "save")}}\n{{yield (action "refreshData") andAnotherParam}}
\n
\n
\n \n

In these contexts,\nthe helper is called a "closure action" helper. Its behavior is simple:\nIf passed a function name, read that function off the actions property\nof the current context. Once that function is read, or immediately if a function was\npassed, create a closure over that function and any arguments.\nThe resulting value of an action helper used this way is simply a function.

\n

For example, in the attribute context:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>
\n
\n
\n \n

The resulting template render logic would be:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
var div = document.createElement('div');\nvar actionFunction = (function(context){\n  return function() {\n    return context.actions.save.apply(context, arguments);\n  };\n})(context);\ndiv.onclick = actionFunction;
\n
\n
\n \n

Thus when the div is clicked, the action on that context is called.\nBecause the actionFunction is just a function, closure actions can be\npassed between components and still execute in the correct context.

\n

Here is an example action handler on a component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  save() {\n    this.model.save();\n  }\n}
\n
\n
\n \n

Actions are always looked up on the actions property of the current context.\nThis avoids collisions in the naming of common actions, such as destroy.\nTwo options can be passed to the action helper when it is used in this way.

\n
    \n
  • target=someProperty will look to someProperty instead of the current\ncontext for the actions hash. This can be useful when targeting a\nservice for actions.
  • \n
  • value="target.value" will read the path target.value off the first\nargument to the action when it is called and rewrite the first argument\nto be that value. This is useful when attaching actions to event listeners.
  • \n
\n

Invoking an action

\n

Closure actions curry both their scope and any arguments. When invoked, any\nadditional arguments are added to the already curried list.\nActions are presented in JavaScript as callbacks, and are\ninvoked like any other JavaScript function.

\n

For example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.hbs
1\n
{{input on-input=(action (action 'setName' @model) value="target.value")}}
\n
\n
\n \n

The first argument (@model) was curried over, and the run-time argument (event)\nbecomes a second argument. Action calls can be nested this way because each simply\nreturns a function. Any function can be passed to the {{action}} helper, including\nother actions.

\n

Actions invoked with sendAction have the same currying behavior as demonstrated\nwith on-input above. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyInput @submit={{action 'setName' @model}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-input submit=(action 'setName' @model)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    // Note that model is not passed, it was curried in the template\n    this.submit('bob');\n  }\n});
\n
\n
\n \n

Attaching actions to DOM elements

\n

The third context of the {{action}} helper can be called "element space".\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of element space }}\n<div {{action "save"}}></div>
\n
\n
\n \n

Used this way, the {{action}} helper provides a useful shortcut for\nregistering an HTML element in a template for a single DOM event and\nforwarding that interaction to the template's context (controller or component).\nIf the context of a template is a controller, actions used this way will\nbubble to routes when the controller does not implement the specified action.\nOnce an action hits a route, it will bubble through the route hierarchy.

\n

Event Propagation

\n

{{action}} helpers called in element space can control event bubbling. Note\nthat the closure style actions cannot.

\n

Events triggered through the action helper will automatically have\n.preventDefault() called on them. You do not need to do so in your event\nhandlers. If you need to allow event propagation (to handle file inputs for\nexample) you can supply the preventDefault=false option to the {{action}} helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<div {{action "sayHello" preventDefault=false}}>\n  <input type="file" />\n  <input type="checkbox" />\n</div>
\n
\n
\n \n

To disable bubbling, pass bubbles=false to the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<button {{action 'edit' post bubbles=false}}>Edit</button>
\n
\n
\n \n

To disable bubbling with closure style actions you must create your own\nwrapper helper that makes use of event.stopPropagation():

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div onclick={{disable-bubbling (action "sayHello")}}>Hello</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
bubbling.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { helper } from '@ember/component/helper';\n\nexport function disableBubbling([action]) {\n  return function(event) {\n    event.stopPropagation();\n    return action(event);\n  };\n}\nexport default helper(disableBubbling);
\n
\n
\n \n

If you need the default handler to trigger you should either register your\nown event handler, or use event methods on your view class. See\n"Responding to Browser Events"\nin the documentation for Component for more information.

\n

Specifying DOM event type

\n

{{action}} helpers called in element space can specify an event type.\nBy default the {{action}} helper registers for DOM click events. You can\nsupply an on option to the helper to specify a different DOM event name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" on="doubleClick"}}>\n  click me\n</div>
\n
\n
\n \n

See "Event Names" for a list of\nacceptable DOM event names.

\n

Specifying whitelisted modifier keys

\n

{{action}} helpers called in element space can specify modifier keys.\nBy default the {{action}} helper will ignore click events with pressed modifier\nkeys. You can supply an allowedKeys option to specify which keys should not be ignored.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="alt"}}>\n  click me\n</div>
\n
\n
\n \n

This way the action will fire when clicking with the alt key pressed down.\nAlternatively, supply "any" to the allowedKeys option to accept any combination of modifier keys.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="any"}}>\n  click me with any key pressed\n</div>
\n
\n
\n \n

Specifying a Target

\n

A target option can be provided to the helper to change\nwhich object will receive the method call. This option must be a path\nto an object, accessible in the current context:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<div {{action "anActionName" target=someService}}>\n  click me\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n
import Controller from '@ember/controller';\nimport { service } from '@ember/service';\n\nexport default class extends Controller {\n  @service someService;\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "action", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/array.ts", + "line": 5, + "description": "

Use the {{array}} helper to create an array to pass as an option to your\ncomponents.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<MyComponent @people={{array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson}}\n/>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{my-component people=(array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson)\n}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Tom Dale', 'Yehuda Katz', this.get('myOtherPerson')]
\n
\n
\n \n

Where the 3rd item in the array is bound to updates of the myOtherPerson property.

\n", + "itemtype": "method", + "name": "array", + "params": [ + { + "name": "options", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "Array", + "type": "Array" + }, + "since": "3.8.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/component.ts", + "line": 5, + "description": "

The {{component}} helper lets you add instances of Component to a\ntemplate. See Component for\nadditional information on how a Component functions.\n{{component}}'s primary use is for cases where you want to dynamically\nchange which type of component is rendered as the state of your application\nchanges. This helper has three modes: inline, block, and nested.

\n

Inline Form

\n

Given the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/application.hbs
1\n
{{component this.infographicComponentName}}
\n
\n
\n \n

And the following application code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Controller from '@ember/controller';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

The live-updating-chart component will be appended when isMarketOpen is\ntrue, and the market-close-summary component will be appended when\nisMarketOpen is false. If the value changes while the app is running,\nthe component will be automatically swapped out accordingly.\nNote: You should not use this helper when you are consistently rendering the same\ncomponent. In that case, use standard component syntax, for example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LiveUpdatingChart />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{live-updating-chart}}
\n
\n
\n \n

Block Form

\n

Using the block form of this helper is similar to using the block form\nof a component. Given the following application template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
{{#component this.infographicComponentName}}\n  Last update: {{this.lastUpdateTimestamp}}\n{{/component}}
\n
\n
\n \n

The following controller code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Controller from '@ember/controller';\nimport { computed } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get lastUpdateTimestamp() {\n    return new Date();\n  }\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

And the following component template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
chart.hbs
1\n2\n
{{! chart }}\n{{yield}}
\n
\n
\n \n

The Last Update: {{this.lastUpdateTimestamp}} will be rendered in place of the {{yield}}.

\n

Nested Usage

\n

The component helper can be used to package a component path with initial attrs.\nThe included attrs can then be merged during the final invocation.\nFor example, given a person-form component with the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.hbs
1\n2\n3\n
{{yield (hash\n  nameInput=(component "my-input-component" value=@model.name placeholder="First Name")\n)}}
\n
\n
\n \n

When yielding the component via the hash helper, the component is invoked directly.\nSee the following snippet:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonForm as |form|>\n  <form.nameInput @placeholder="Username" />\n</PersonForm>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-form as |form|}}\n  {{form.nameInput placeholder="Username"}}\n{{/person-form}}
\n
\n
\n \n

Which outputs an input whose value is already bound to model.name and placeholder\nis "Username".

\n

When yielding the component without the hash helper use the component helper.\nFor example, below is a full-name component template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{yield (component "my-input-component" value=@model.name placeholder="Name")}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<FullName as |field|>\n  {{component field placeholder="Full name"}}\n</FullName>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#full-name as |field|}}\n  {{component field placeholder="Full name"}}\n{{/full-name}}
\n
\n
\n \n", + "itemtype": "method", + "name": "component", + "since": "1.11.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/concat.ts", + "line": 5, + "description": "

Concatenates the given arguments into a string.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{some-component name=(concat firstName " " lastName)}}\n\n{{! would pass name="<first name value> <last name value>" to the component}}
\n
\n
\n \n

or for angle bracket invocation, you actually don't need concat at all.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @name="{{firstName}} {{lastName}}" />
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "concat", + "since": "1.13.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 13, + "description": "

The {{#each}} helper loops over elements in a collection. It is an extension\nof the base Handlebars {{#each}} helper.

\n

The default behavior of {{#each}} is to yield its inner block once for every\nitem in an array passing the item as the first block parameter.

\n

Assuming the @developers argument contains this array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
[{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }];
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

The same rules apply to arrays of primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Yehuda', 'Tom', 'Paul']
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developerNames as |name|}}\n    <li>Hello, {{name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

During iteration, the index of each item in the array is provided as a second block\nparameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person index|}}\n    <li>Hello, {{person.name}}! You're number {{index}} in line</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

Specifying Keys

\n

In order to improve rendering speed, Ember will try to reuse the DOM elements\nwhere possible. Specifically, if the same item is present in the array both\nbefore and after the change, its DOM output will be reused.

\n

The key option is used to tell Ember how to determine if the items in the\narray being iterated over with {{#each}} has changed between renders. By\ndefault the item's object identity is used.

\n

This is usually sufficient, so in most cases, the key option is simply not\nneeded. However, in some rare cases, the objects' identities may change even\nthough they represent the same underlying data.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
people.map(person => {\n  return { ...person, type: 'developer' };\n});
\n
\n
\n \n

In this case, each time the people array is map-ed over, it will produce\nan new array with completely different objects between renders. In these cases,\nyou can help Ember determine how these objects related to each other with the\nkey option:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers key="name" as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

By doing so, Ember will use the value of the property specified (person.name\nin the example) to find a "match" from the previous render. That is, if Ember\nhas previously seen an object from the @developers array with a matching\nname, its DOM elements will be re-used.

\n

There are two special values for key:

\n
    \n
  • @index - The index of the item in the array.
  • \n
  • @identity - The item in the array itself.
  • \n
\n

{{else}} condition

\n

{{#each}} can have a matching {{else}}. The contents of this block will render\nif the collection is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<ul>\n  {{#each @developers as |person|}}\n    <li>{{person.name}} is available!</li>\n  {{else}}\n    <li>Sorry, nobody is available for this task.</li>\n  {{/each}}\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 124, + "description": "

The {{each-in}} helper loops over properties on an object.

\n

For example, given this component definition:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    "name": "Shelly Sails",\n    "age": 42\n  };\n}
\n
\n
\n \n

This template would display all properties on the developer\nobject in a list:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.hbs
1\n2\n3\n4\n5\n
<ul>\n  {{#each-in this.developer as |key value|}}\n    <li>{{key}}: {{value}}</li>\n  {{/each-in}}\n</ul>
\n
\n
\n \n

Outputting their name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<ul>\n  <li>name: Shelly Sails</li>\n  <li>age: 42</li>\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each-in", + "access": "public", + "tagname": "", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/fn.ts", + "line": 5, + "description": "

The fn helper allows you to ensure a function that you are passing off\nto another component, helper, or modifier has access to arguments that are\navailable in the template.

\n

For example, if you have an each helper looping over a number of items, you\nmay need to pass a function that expects to receive the item as an argument\nto a component invoked within the loop. Here's how you could use the fn\nhelper to pass both the function and its arguments together:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
listing.hbs
1\n2\n3\n
{{#each @items as |item|}}\n<DisplayItem @item=item @select={{fn this.handleSelected item}} />\n{{/each}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class ItemsList extends Component {\n  @action\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this case the display-item component will receive a normal function\nthat it can invoke. When it invokes the function, the handleSelected\nfunction will receive the item and any arguments passed, thanks to the\nfn helper.

\n

Let's take look at what that means in a couple circumstances:

\n
    \n
  • When invoked as this.args.select() the handleSelected function will\nreceive the item from the loop as its first and only argument.
  • \n
  • When invoked as this.args.select('foo') the handleSelected function\nwill receive the item from the loop as its first argument and the\nstring 'foo' as its second argument.
  • \n
\n

In the example above, we used @action to ensure that handleSelected is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class ItemsList extends Component {\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when handleSelected is invoked inside the display-item\ncomponent, it will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into fn!

\n

See also partial application.

\n", + "itemtype": "method", + "name": "fn", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/get.ts", + "line": 5, + "description": "

Dynamically look up a property on an object or an element in an array.\nThe second argument to {{get}} should have a string or number value,\nalthough it can be bound.

\n

For example, these two usages are equivalent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{this.developer.name}}\n{{get this.developer "name"}}
\n
\n
\n \n

If there were several facts about a person, the {{get}} helper can dynamically\npick one:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<DeveloperDetail @factName="language" />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.developer @factName}}
\n
\n
\n \n

For a more complex example, this template would allow the user to switch\nbetween showing the user's name and preferred coding language with a click:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n\n  @tracked currentFact = 'name'\n\n  @action\n  showFact(fact) {\n    this.currentFact = fact;\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
{{get this.developer this.currentFact}}\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

The {{get}} helper can also respect mutable values itself. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
<Input @value={{mut (get this.person this.currentFact)}} />\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

Would allow the user to swap what fact is being displayed, and also edit\nthat fact via a two-way mutable binding.

\n

The {{get}} helper can also be used for array element access via index.\nThis would display the value of the first element in the array this.names:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names 0}}
\n
\n
\n \n

Array element access also works with a dynamic second argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names @index}}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "get", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/hash.ts", + "line": 5, + "description": "

Use the {{hash}} helper to create a hash to pass as an option to your\ncomponents. This is specially useful for contextual components where you can\njust yield a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{yield (hash\n   name='Sarah'\n   title=office\n)}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ name: 'Sarah', title: this.get('office') }
\n
\n
\n \n

Where the title is bound to updates of the office property.

\n

Note that the hash is an empty object with no prototype chain, therefore\ncommon methods like toString are not available in the resulting hash.\nIf you need to use such a method, you can use the call or apply\napproach:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
function toString(obj) {\n  return Object.prototype.toString.apply(obj);\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "Hash", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 5, + "description": "

The if helper allows you to conditionally render one of two branches,\ndepending on the "truthiness" of a property.\nFor example the following values are all falsey: false, undefined, null, "", 0, NaN or an empty array.

\n

This helper has two forms, block and inline.

\n

Block form

\n

You can use the block form of if to conditionally render a section of the template.

\n

To use it, pass the conditional value to the if helper,\nusing the block form to wrap the section of template you want to conditionally render.\nLike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n
{{! will not render because greeting is undefined}}\n{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{/if}}
\n
\n
\n \n

You can also define what to show if the property is falsey by using\nthe else helper.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n
{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{else}}\n  No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

You are also able to combine else and if helpers to create more complex\nconditional logic.

\n

For the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if @isRaining}}\n Yes, grab an umbrella!\n{{else if @isCold}}\n Grab a coat, it's chilly!\n{{else}}\n No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

If you call it by saying isCold is true:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather @isCold={{true}} />
\n
\n
\n \n

Then Grab a coat, it's chilly! will be rendered.

\n

Inline form

\n

The inline if helper conditionally renders a single property or string.

\n

In this form, the if helper receives three arguments, the conditional value,\nthe value to render when truthy, and the value to render when falsey.

\n

For example, if useLongGreeting is truthy, the following:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{true}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{if @useLongGreeting "Hello" "Hi"}} Alex
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hello Alex
\n
\n
\n \n

One detail to keep in mind is that both branches of the if helper will be evaluated,\nso if you have {{if condition "foo" (expensive-operation "bar"),\nexpensive-operation will always calculate.

\n", + "itemtype": "method", + "name": "if", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 97, + "description": "

The unless helper is the inverse of the if helper. It displays if a value\nis falsey ("not true" or "is false"). Example values that will display with\nunless: false, undefined, null, "", 0, NaN or an empty array.

\n

Inline form

\n

The inline unless helper conditionally renders a single property or string.\nThis helper acts like a ternary operator. If the first property is falsy,\nthe second argument will be displayed, otherwise, the third argument will be\ndisplayed

\n

For example, if you pass a falsey useLongGreeting to the Greeting component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{false}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{unless @useLongGreeting "Hi" "Hello"}} Ben
\n
\n
\n \n

Then it will display:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hi Ben
\n
\n
\n \n

Block form

\n

Like the if helper, the unless helper also has a block form.

\n

The following will not render anything:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n2\n3\n
{{#unless @greeting}}\n  No greeting was found. Why not set one?\n{{/unless}}
\n
\n
\n \n

You can also use an else helper with the unless block. The\nelse will display if the value is truthy.

\n

If you have the following component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
in.hbs
1\n2\n3\n4\n5\n
{{#unless @userData}}\n  Please login.\n{{else}}\n  Welcome back!\n{{/unless}}
\n
\n
\n \n

Calling it with a truthy userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{hash username="Zoey"}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Welcome back!
\n
\n
\n \n

and calling it with a falsey userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{false}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Please login.
\n
\n
\n \n", + "itemtype": "method", + "name": "unless", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/log.ts", + "line": 5, + "description": "

log allows you to output the value of variables in the current rendering\ncontext. log also accepts primitive types such as strings or numbers.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{log "myVariable:" myVariable }}
\n
\n
\n \n", + "itemtype": "method", + "name": "log", + "params": [ + { + "name": "params", + "description": "", + "type": "Array" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/mut.ts", + "line": 9, + "description": "

The mut helper lets you clearly specify that a child Component can update the\n(mutable) value passed to it, which will change the value of the parent component.

\n

To specify that a parameter is mutable, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{fn (mut totalClicks)}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(mut totalClicks)}}
\n
\n
\n \n

The child Component can then modify the parent's value just by modifying its own\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

Note that for curly components ({{my-component}}) the bindings are already mutable,\nmaking the mut unnecessary.

\n

Additionally, the mut helper can be combined with the fn helper to\nmutate a value. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=totalClicks click-count-change=(fn (mut totalClicks))}}
\n
\n
\n \n

The child Component would invoke the function with the new click value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.get('click-count-change')(this.get('childClickCount') + 1);\n  }\n});
\n
\n
\n \n

The mut helper changes the totalClicks value to what was provided as the fn argument.

\n

The mut helper, when used with fn, will return a function that\nsets the value passed to mut to its first argument. As an example, we can create a\nbutton that increments a value passing the value directly to the fn:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{! inc helper is not provided by Ember }}\n<button onclick={{fn (mut count) (inc count)}}>\n  Increment count\n</button>
\n
\n
\n \n", + "itemtype": "method", + "name": "mut", + "params": [ + { + "name": "attr", + "description": "the \"two-way\" attribute that can be modified.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/page-title.ts", + "line": 5, + "description": "

page-title allows you to set the title of any page in your application and\nappend additional titles for each route. For complete documentation, see\nhttps://github.com/ember-cli/ember-page-title.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{page-title "My Page Title" }}
\n
\n
\n \n", + "itemtype": "method", + "name": "page-title", + "params": [ + { + "name": "param", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/readonly.ts", + "line": 9, + "description": "

The readonly helper let's you specify that a binding is one-way only,\ninstead of two-way.\nWhen you pass a readonly binding from an outer context (e.g. parent component),\nto to an inner context (e.g. child component), you are saying that changing that\nproperty in the inner context does not change the value in the outer context.

\n

To specify that a binding is read-only, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n
export default Component.extend({\n  totalClicks: 3\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} // -> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Now, when you update childClickCount:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n
export default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

The value updates in the child component, but not the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClickCount}} //-> 4
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Objects and Arrays

\n

When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string),\nonly the reference to the object is protected using the readonly helper.\nThis means that you can change properties of the object both on the parent component, as well as the child component.\nThe readonly binding behaves similar to the const keyword in JavaScript.

\n

Let's look at an example:

\n

First let's set up the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  clicks: null,\n\n  init() {\n    this._super(...arguments);\n    this.set('clicks', { total: 3 });\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n

Now, if you update the total property of childClicks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    this.get('clicks').incrementProperty('total');\n  }\n});
\n
\n
\n \n

You will see the following happen:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClicks.total}} //-> 4
\n
\n
\n \n", + "itemtype": "method", + "name": "readonly", + "params": [ + { + "name": "attr", + "description": "the read-only attribute.", + "type": "Object", + "optional": true + } + ], + "access": "private", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unbound.ts", + "line": 10, + "description": "

The {{unbound}} helper disconnects the one-way binding of a property,\nessentially freezing its value at the moment of rendering. For example,\nin this example the display of the variable name will not change even\nif it is set with a new value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{unbound this.name}}
\n
\n
\n \n

Like any helper, the unbound helper can accept a nested helper expression.\nThis allows for custom helpers to be rendered unbound:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{unbound (some-custom-helper)}}\n{{unbound (capitalize this.name)}}\n{{! You can use any helper, including unbound, in a nested expression }}\n{{capitalize (unbound this.name)}}
\n
\n
\n \n

The unbound helper only accepts a single argument, and it return an\nunbound value.

\n", + "itemtype": "method", + "name": "unbound", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts", + "line": 5, + "description": "

Use the {{unique-id}} helper to generate a unique ID string suitable for use as\nan ID attribute in the DOM.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id={{unique-id}} type="email" />
\n
\n
\n \n

Each 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#let (unique-id) as |emailId|}}\n  <label for={{emailId}}>Email address</label>\n  <input id={{emailId}} type="email" />\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "unique-id", + "since": "4.4.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/modifiers/on.ts", + "line": 5, + "description": "

The {{on}} modifier lets you easily add event listeners (it uses\nEventTarget.addEventListener\ninternally).

\n

For example, if you'd like to run a function on your component when a <button>\nin the components template is clicked you might do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' this.saveLike}}>Like this post!</button>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class LikePostComponent extends Component {\n  @action\n  saveLike() {\n    // someone likes your post!\n    // better send a request off to your server...\n  }\n}
\n
\n
\n \n

Arguments

\n

{{on}} accepts two positional arguments, and a few named arguments.

\n

The positional arguments are:

\n
    \n
  • event -- the name to use when calling addEventListener
  • \n
  • callback -- the function to be passed to addEventListener
  • \n
\n

The named arguments are:

\n
    \n
  • capture -- a true value indicates that events of this type will be dispatched\nto the registered listener before being dispatched to any EventTarget beneath it\nin the DOM tree.
  • \n
  • once -- indicates that the listener should be invoked at most once after being\nadded. If true, the listener would be automatically removed when invoked.
  • \n
  • passive -- if true, indicates that the function specified by listener will never\ncall preventDefault(). If a passive listener does call preventDefault(), the user\nagent will do nothing other than generate a console warning. See\nImproving scrolling performance with passive listeners\nto learn more.
  • \n
\n

The callback function passed to {{on}} will receive any arguments that are passed\nto the event handler. Most commonly this would be the event itself.

\n

If you would like to pass additional arguments to the function you should use\nthe {{fn}} helper.

\n

For example, in our example case above if you'd like to pass in the post that\nwas being liked when the button is clicked you could do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' (fn this.saveLike @post)}}>Like this post!</button>
\n
\n
\n \n

In this case, the saveLike function will receive two arguments: the click event\nand the value of @post.

\n

Function Context

\n

In the example above, we used @action to ensure that likePost is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class LikePostComponent extends Component {\n  saveLike() {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when the button is clicked saveLike will be invoked,\nit will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into on!

\n", + "itemtype": "method", + "name": "on", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/in-element.ts", + "line": 5, + "description": "

The in-element helper renders its block content outside of the regular flow,\ninto a DOM element given by its destinationElement positional argument.

\n

Common use cases - often referred to as "portals" or "wormholes" - are rendering\ndropdowns, modals or tooltips close to the root of the page to bypass CSS overflow\nrules, or to render content to parts of the page that are outside of the control\nof the Ember app itself (e.g. embedded into a static or server rendered HTML page).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#in-element this.destinationElement}}\n  <div>Some content</div>\n{{/in-element}}
\n
\n
\n \n

Arguments

\n

{{in-element}} requires a single positional argument:

\n
    \n
  • destinationElement -- the DOM element to render into. It must exist at the time\nof rendering.
  • \n
\n

It also supports an optional named argument:

\n
    \n
  • insertBefore -- by default the DOM element's content is replaced when used as\ndestinationElement. Passing null changes the behaviour to appended at the end\nof any existing content. Any other value than null is currently not supported.
  • \n
\n", + "itemtype": "method", + "name": "in-element", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/let.ts", + "line": 5, + "description": "

The let helper receives one or more positional arguments and yields\nthem out as block params.

\n

This allows the developer to introduce shorter names for certain computations\nin the template.

\n

This is especially useful if you are passing properties to a component\nthat receives a lot of options and you want to clean up the invocation.

\n

For the following example, the template receives a post object with\ncontent and title properties.

\n

We are going to call the my-post component, passing a title which is\nthe title of the post suffixed with the name of the blog, the content\nof the post, and a series of options defined in-place.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n    (concat post.title ' | The Ember.js Blog')\n    post.content\n    (hash\n      theme="high-contrast"\n      enableComments=true\n    )\n    as |title content options|\n}}\n  <MyPost @title={{title}} @content={{content}} @options={{options}} />\n{{/let}}
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n  (concat post.title ' | The Ember.js Blog')\n  post.content\n  (hash\n    theme="high-contrast"\n    enableComments=true\n  )\n  as |title content options|\n}}\n{{my-post title=title content=content options=options}}\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "let", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/mount.ts", + "line": 16, + "description": "

The {{mount}} helper lets you embed a routeless engine in a template.\nMounting an engine will cause an instance to be booted and its application\ntemplate to be rendered.

\n

For example, the following template mounts the ember-chat engine:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! application.hbs }}\n{{mount "ember-chat"}}
\n
\n
\n \n

Additionally, you can also pass in a model argument that will be\nset as the engines model. This can be an existing object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div>\n  {{mount 'admin' model=userSettings}}\n</div>
\n
\n
\n \n

Or an inline hash, and you can even pass components:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>\n  <h1>Application template!</h1>\n  {{mount 'admin' model=(hash\n      title='Secret Admin'\n      signInButton=(component 'sign-in-button')\n  )}}\n</div>
\n
\n
\n \n", + "itemtype": "method", + "name": "mount", + "params": [ + { + "name": "name", + "description": "Name of the engine to mount.", + "type": "String" + }, + { + "name": "model", + "description": "Object that will be set as\n the model of the engine.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/outlet.ts", + "line": 22, + "description": "

The {{outlet}} helper lets you specify where a child route will render in\nyour template. An important use of the {{outlet}} helper is in your\napplication's application.hbs file:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n7\n8\n
<MyHeader />\n\n<div class="my-dynamic-content">\n  <!-- this content will change based on the current route, which depends on the current URL -->\n  {{outlet}}\n</div>\n\n<MyFooter />
\n
\n
\n \n

See the routing guide for more\ninformation on how your route interacts with the {{outlet}} helper.\nNote: Your content will not render if there isn't an {{outlet}} for it.

\n", + "itemtype": "method", + "name": "outlet", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 91, + "description": "

{{yield}} denotes an area of a template that will be rendered inside\nof another template.

\n

Use with Component

\n

When designing components {{yield}} is used to denote where, inside the component's\ntemplate, an optional block passed to the component should render:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<LabeledTextfield @value={{@model.name}}>\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<label>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n

Additionally you can yield properties into the context for use by the consumer:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n
<LabeledTextfield @value={{@model.validation}} @validator={{this.firstNameValidator}} as |validationError|>\n  {{#if validationError}}\n    <p class="error">{{validationError}}</p>\n  {{/if}}\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield this.validationError}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<label>\n  <p class="error">First Name must be at least 3 characters long.</p>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n", + "itemtype": "method", + "name": "yield", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "return": { + "description": "HTML string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 152, + "description": "

{{(has-block)}} indicates if the component was invoked with a block.

\n

This component is invoked with a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component}}
\n
\n
\n \n

Using angle bracket invocation, this looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent>Hi Jen!</MyComponent> {{! with a block}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent/> {{! without a block}}
\n
\n
\n \n

This is useful when you want to create a component that can optionally take a block\nand then render a default template when it is not invoked with a block.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n
{{#if (has-block)}}\n  Welcome {{yield}}, we are happy you're here!\n{{else}}\n  Hey you! You're great!\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with a block", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 197, + "description": "

{{(has-block-params)}} indicates if the component was invoked with block params.

\n

This component is invoked with block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component as |favoriteFlavor|}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jenn!\n{{/my-component}}
\n
\n
\n \n

With angle bracket syntax, block params look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent as |favoriteFlavor|>\nHi Jen!\n</MyComponent>
\n
\n
\n \n

And without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent>\n  Hi Jen!\n</MyComponent>
\n
\n
\n \n

This is useful when you want to create a component that can render itself\ndifferently when it is not invoked with block params.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if (has-block-params)}}\n  Welcome {{yield this.favoriteFlavor}}, we're happy you're here and hope you\n  enjoy your favorite ice cream flavor.\n{{else}}\n  Welcome {{yield}}, we're happy you're here, but we're unsure what\n  flavor ice cream you would enjoy.\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block-params", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with block params", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 252, + "description": "

Execute the debugger statement in the current template's context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{debugger}}
\n
\n
\n \n

When using the debugger helper you will have access to a get function. This\nfunction retrieves values available in the context of the template.\nFor example, if you're wondering why a value {{foo}} isn't rendering as\nexpected within a template, you could place a {{debugger}} statement and,\nwhen the debugger; breakpoint is hit, you can attempt to retrieve this value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('foo')
\n
\n
\n \n

get is also aware of keywords. So in this situation

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#each this.items as |item|}}\n  {{debugger}}\n{{/each}}
\n
\n
\n \n

You'll be able to get values from the current item:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('item.name')
\n
\n
\n \n

You can also access the context of the view to make sure it is the object that\nyou expect:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> context
\n
\n
\n \n", + "itemtype": "method", + "name": "debugger", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.Test-921423839d.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.Test-921423839d.json new file mode 100644 index 000000000..3541d8865 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.Test-921423839d.json @@ -0,0 +1,147 @@ +{ + "data": { + "id": "ember-4.6.0-Ember.Test", + "type": "class", + "attributes": { + "name": "Ember.Test", + "shortname": "Ember.Test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/ember-testing/lib/test.ts", + "line": 11, + "description": "

This is a container for an assortment of testing related functionality:

\n
    \n
  • Choose your default test adapter (for your framework of choice).
  • \n
  • Register/Unregister additional test helpers.
  • \n
  • Setup callbacks to be fired when the test helpers are injected into\nyour application.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/ember-testing/lib/test/on_inject_helpers.ts", + "line": 5, + "description": "

Used to register callbacks to be fired whenever App.injectTestHelpers\nis called.

\n

The callback will receive the current application as an argument.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import $ from 'jquery';\n\nEmber.Test.onInjectHelpers(function() {\n  $(document).ajaxSend(function() {\n    Test.pendingRequests++;\n  });\n\n  $(document).ajaxComplete(function() {\n    Test.pendingRequests--;\n  });\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "onInjectHelpers", + "params": [ + { + "name": "callback", + "description": "The function to be called.", + "type": "Function" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.ts", + "line": 32, + "description": "

This returns a thenable tailored for testing. It catches failed\nonSuccess callbacks and invokes the Ember.Test.adapter.exception\ncallback in the last chained then.

\n

This method should be returned by async helpers such as wait.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "promise", + "params": [ + { + "name": "resolver", + "description": "The function used to resolve the promise.", + "type": "Function" + }, + { + "name": "label", + "description": "An optional string for identifying the promise.", + "type": "String" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.ts", + "line": 50, + "description": "

Replacement for Ember.RSVP.resolve\nThe only difference is this uses\nan instance of Ember.Test.Promise

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "The", + "description": "value to resolve", + "type": "Mixed" + } + ], + "since": "1.2.0", + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/setup_for_testing.ts", + "line": 8, + "description": "

Sets Ember up for testing. This is useful to perform\nbasic setup steps in order to unit test.

\n

Use App.setupForTesting to perform integration tests (full\napplication testing).

\n", + "itemtype": "method", + "name": "setupForTesting", + "since": "1.5.0", + "access": "private", + "tagname": "", + "class": "Ember.Test", + "module": "@ember/test", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/test.ts", + "line": 24, + "description": "

Hash containing all known test helpers.

\n", + "itemtype": "property", + "name": "_helpers", + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/ember-testing/lib/test.ts", + "line": 45, + "description": "

Used to allow ember-testing to communicate with a specific testing\nframework.

\n

You can manually set it before calling App.setupForTesting().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Ember.Test.adapter = MyCustomAdapter.create()
\n
\n
\n \n

If you do not set it, ember-testing will default to Ember.Test.QUnitAdapter.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "adapter", + "type": "{Class} The adapter to be used.", + "default": "Ember.Test.QUnitAdapter", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.ViewMixin-a22bbf8bb2.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.ViewMixin-a22bbf8bb2.json new file mode 100644 index 000000000..0f7ae5420 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Ember.ViewMixin-a22bbf8bb2.json @@ -0,0 +1,322 @@ +{ + "data": { + "id": "ember-4.6.0-Ember.ViewMixin", + "type": "class", + "attributes": { + "name": "Ember.ViewMixin", + "shortname": "Ember.ViewMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 14, + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 92, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 120, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 140, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 180, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 245, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 330, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 404, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 438, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 299, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 307, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 320, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 344, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 357, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 365, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 34, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 165, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 266, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 377, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-EmberArray-ada5d35ae2.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-EmberArray-ada5d35ae2.json new file mode 100644 index 000000000..3b1bbb84c --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-EmberArray-ada5d35ae2.json @@ -0,0 +1,836 @@ +{ + "data": { + "id": "ember-4.6.0-EmberArray", + "type": "class", + "attributes": { + "name": "EmberArray", + "shortname": "EmberArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "MutableArray" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 219, + "description": "

This mixin implements Observer-friendly Array-like behavior. It is not a\nconcrete implementation, but it can be used up by other classes that want\nto appear like arrays.

\n

For example, ArrayProxy is a concrete class that can be instantiated to\nimplement array-like behavior. This class uses the Array Mixin by way of\nthe MutableArray mixin, which allows observable changes to be made to the\nunderlying array.

\n

This mixin defines methods specifically for collections that provide\nindex-ordered access to their contents. When you are designing code that\nneeds to accept any kind of Array-like object, you should use these methods\ninstead of Array primitives because these will properly notify observers of\nchanges to the array.

\n

Although these methods are efficient, they do add a layer of indirection to\nyour application so it is a good idea to use them only when you need the\nflexibility of using both true JavaScript arrays and "virtual" arrays such\nas controllers and collections.

\n

You can use the methods defined in this module to access and modify array\ncontents in an observable-friendly way. You can also be notified whenever\nthe membership of an array changes by using .observes('myArray.[]').

\n

To support EmberArray in your own class, you must override two\nprimitives to use it: length() and objectAt().

\n", + "uses": [ + "Enumerable" + ], + "since": "Ember 0.9.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 329, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 354, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 438, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 481, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 523, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 577, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 637, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 660, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 683, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 731, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 752, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 829, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 881, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 906, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 934, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 981, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1015, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1057, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1101, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1145, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1175, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1246, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1285, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1297, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1313, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1346, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1390, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1409, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1431, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 319, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 373, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 401, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 426, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-EmberObject-90471243c2.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-EmberObject-90471243c2.json new file mode 100644 index 000000000..8c39c029d --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-EmberObject-90471243c2.json @@ -0,0 +1,596 @@ +{ + "data": { + "id": "ember-4.6.0-EmberObject", + "type": "class", + "attributes": { + "name": "EmberObject", + "shortname": "EmberObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/object.ts", + "line": 13, + "description": "

EmberObject is the main base class for all Ember objects. It is a subclass\nof CoreObject with the Observable mixin applied. For details,\nsee the documentation for each of these.

\n", + "extends": "CoreObject", + "uses": [ + "Observable" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.6.0-ContainerDebugAdapter" + }, + { + "type": "class", + "id": "ember-4.6.0-DataAdapter" + }, + { + "type": "class", + "id": "ember-4.6.0-HashLocation" + }, + { + "type": "class", + "id": "ember-4.6.0-HistoryLocation" + }, + { + "type": "class", + "id": "ember-4.6.0-NoneLocation" + }, + { + "type": "class", + "id": "ember-4.6.0-Route" + }, + { + "type": "class", + "id": "ember-4.6.0-EmberRouter" + }, + { + "type": "class", + "id": "ember-4.6.0-ArrayProxy" + }, + { + "type": "class", + "id": "ember-4.6.0-Namespace" + }, + { + "type": "class", + "id": "ember-4.6.0-ObjectProxy" + }, + { + "type": "class", + "id": "ember-4.6.0-Ember.CoreView" + }, + { + "type": "class", + "id": "ember-4.6.0-Controller" + }, + { + "type": "class", + "id": "ember-4.6.0-EngineInstance" + }, + { + "type": "class", + "id": "ember-4.6.0-Service" + } + ] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-EmberRouter-bcd53fae40.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-EmberRouter-bcd53fae40.json new file mode 100644 index 000000000..206c7419f --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-EmberRouter-bcd53fae40.json @@ -0,0 +1,1192 @@ +{ + "data": { + "id": "ember-4.6.0-EmberRouter", + "type": "class", + "attributes": { + "name": "EmberRouter", + "shortname": "EmberRouter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 137, + "description": "

The EmberRouter class manages the application state and URLs. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 216, + "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

The first parameter is the name of the route which is used by default as the\npath name as well.

\n

The 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\nsegments.
  • \n
  • resetNamespace: false by default; when nesting routes, ember will\ncombine the route names to form the fully-qualified route name, which is\nused with {{link-to}} or manually transitioning to routes. Setting\nresetNamespace: true will cause the route not to inherit from its\nparent route's names. This is handy for preventing extremely long route names.\nKeep in mind that the actual URL path behavior is still retained.
  • \n
\n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
Router.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
\n
\n \n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 551, + "description": "

Initializes the current router instance and sets up the change handling\nevent listeners used by the instances location implementation.

\n

A property named initialURL will be used to determine the initial URL.\nIf no value is found / will be used.

\n", + "itemtype": "method", + "name": "startRouting", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 674, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 719, + "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", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 746, + "description": "

Determines if the supplied route is currently active.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 758, + "description": "

An alternative form of isActive that doesn't require\nmanual concatenation of the arguments into a single\narray.

\n", + "itemtype": "method", + "name": "isActiveIntent", + "params": [ + { + "name": "routeName", + "description": "" + }, + { + "name": "models", + "description": "" + }, + { + "name": "queryParams", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 780, + "description": "

Does this router instance have the given route.

\n", + "itemtype": "method", + "name": "hasRoute", + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 791, + "description": "

Resets the state of the router by clearing the current route\nhandlers and deactivating them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 939, + "description": "

Serializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Arrray" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 969, + "description": "

Serializes the value of a query parameter based on a type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "type", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 987, + "description": "

Deserializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1015, + "description": "

Deserializes the value of a query parameter based on a default type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "defaultType", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1036, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_pruneDefaultQueryParamValues", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1117, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareQueryParams", + "params": [ + { + "name": "targetRouteName", + "description": "", + "type": "String" + }, + { + "name": "models", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + }, + { + "name": "keepDefaultQueryParamValues", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1144, + "description": "

Returns the meta information for the query params of a given route. This\nwill be overridden to allow support for lazy routes.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getQPMeta", + "params": [ + { + "name": "routeInfo", + "description": "", + "type": "RouteInfo" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1158, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_queryParamsFor", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1220, + "description": "

Maps all query param keys to their fully scoped property name of the form\ncontrollerName:propName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_fullyScopeQueryParams", + "params": [ + { + "name": "leafRouteName", + "description": "", + "type": "String" + }, + { + "name": "contexts", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1258, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_hydrateUnsuppliedQueryParams", + "params": [ + { + "name": "state", + "description": "", + "type": "TransitionState" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1429, + "description": "

Handles updating the paths and notifying any listeners of the URL\nchange.

\n

Triggers the router level didTransition hook.

\n

For example, to notify google analytics when the route changes,\nyou could use this hook. (Note: requires also including GA scripts, etc.)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "didTransition", + "access": "private", + "tagname": "", + "since": "1.2.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1466, + "description": "

Handles notifying any listeners of an impending URL\nchange.

\n

Triggers the router level willTransition hook.

\n", + "itemtype": "method", + "name": "willTransition", + "access": "private", + "tagname": "", + "since": "1.11.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 95, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 121, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 142, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 165, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 180, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 147, + "description": "

Represents the URL of the root of the application, often '/'. This prefix is\n assumed on all routes defined on this router.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 158, + "description": "

The location property determines the type of URL's that your\n application will use.

\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 history by the locationType setting of /config/environment.js

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1479, + "description": "

Represents the current URL.

\n", + "itemtype": "property", + "name": "url", + "type": "{String}", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Engine-9d262fd6b8.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Engine-9d262fd6b8.json new file mode 100644 index 000000000..8d9fe23c5 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Engine-9d262fd6b8.json @@ -0,0 +1,499 @@ +{ + "data": { + "id": "ember-4.6.0-Engine", + "type": "class", + "attributes": { + "name": "Engine", + "shortname": "Engine", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/index.ts", + "line": 40, + "description": "

The Engine class contains core functionality for both applications and\nengines.

\n

Each engine manages a registry that's used for dependency injection and\nexposed through RegistryProxy.

\n

Engines also manage initializers and instance initializers.

\n

Engines can spawn EngineInstance instances via buildInstance().

\n", + "extends": "Ember.Namespace", + "uses": [ + "RegistryProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/engine/index.ts", + "line": 62, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 209, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 285, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 346, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 359, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 371, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 384, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 392, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 400, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 414, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 448, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Enginer" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 51, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/index.ts", + "line": 325, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 338, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Engine", + "module": "@ember/engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.Namespace", + "type": "missing" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.6.0-Application" + } + ] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-EngineInstance-e0f167a8db.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-EngineInstance-e0f167a8db.json new file mode 100644 index 000000000..ba100e1b6 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-EngineInstance-e0f167a8db.json @@ -0,0 +1,1003 @@ +{ + "data": { + "id": "ember-4.6.0-EngineInstance", + "type": "class", + "attributes": { + "name": "EngineInstance", + "shortname": "EngineInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/instance.ts", + "line": 26, + "description": "

The EngineInstance encapsulates all of the stateful aspects of a\nrunning Engine.

\n", + "access": "public", + "tagname": "", + "extends": "EmberObject", + "uses": [ + "RegistryProxyMixin", + "ContainerProxyMixin" + ], + "methods": [ + { + "file": "packages/@ember/engine/instance.ts", + "line": 39, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 86, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 152, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 169, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 199, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 51, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 39, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 65, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 126, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/instance.ts", + "line": 47, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 31, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.6.0-ApplicationInstance" + } + ] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Evented-3cb7cf4c29.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Evented-3cb7cf4c29.json new file mode 100644 index 000000000..9a0239878 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Evented-3cb7cf4c29.json @@ -0,0 +1,190 @@ +{ + "data": { + "id": "ember-4.6.0-Evented", + "type": "class", + "attributes": { + "name": "Evented", + "shortname": "Evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Route", + "EmberRouter", + "Ember.CoreView" + ], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 13, + "description": "

This mixin allows for Ember objects to subscribe to and emit events.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/utils/person.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport Evented from '@ember/object/evented';\n\nexport default EmberObject.extend(Evented, {\n  greet() {\n    // ...\n    this.trigger('greet');\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
var person = Person.create();\n\nperson.on('greet', function() {\n  console.log('Our person has greeted');\n});\n\nperson.greet();\n\n// outputs: 'Our person has greeted'
\n
\n
\n \n

You can also chain multiple event subscriptions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
person.on('greet', function() {\n  console.log('Our person has greeted');\n}).one('greet', function() {\n  console.log('Offer one-time special');\n}).off('event', this, forgetThis);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 95, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 121, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 142, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 165, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 180, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-HashLocation-1562bdf66d.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-HashLocation-1562bdf66d.json new file mode 100644 index 000000000..21ff7fbf1 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-HashLocation-1562bdf66d.json @@ -0,0 +1,641 @@ +{ + "data": { + "id": "ember-4.6.0-HashLocation", + "type": "class", + "attributes": { + "name": "HashLocation", + "shortname": "HashLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 11, + "description": "

HashLocation implements the location API using the browser's\nhash. At present, it relies on a hashchange event existing in the\nbrowser.

\n

Using HashLocation results in URLs with a # (hash sign) separating the\nserver side URL portion of the URL from the portion that is used by Ember.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'hash'\n});
\n
\n
\n \n

This will result in a posts.new url of /#/posts/new.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 51, + "access": "private", + "tagname": "Returns normalized location.hash", + "since": "1.5.1", + "itemtype": "method", + "name": "getHash", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 63, + "description": "

Returns the normalized URL, constructed from location.hash.

\n

e.g. #/foo => /foo as well as #/foo#bar => /foo#bar.

\n

By convention, hashed paths must begin with a forward slash, otherwise they\nare not treated as a path so we can distinguish intent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 93, + "description": "

Set the location.hash and remembers what was set. This prevents\nonUpdateURL callbacks from triggering when the hash was set by\nHashLocation.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 107, + "description": "

Uses location.replace to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 122, + "description": "

Register a callback to be invoked when the hash changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 147, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 162, + "description": "

Cleans up the HashLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Helper-e93c62f3e4.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Helper-e93c62f3e4.json new file mode 100644 index 000000000..70d175943 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Helper-e93c62f3e4.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.6.0-Helper", + "type": "class", + "attributes": { + "name": "Helper", + "shortname": "Helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 47, + "description": "

Ember Helpers are functions that can compute values, and are used in templates.\nFor example, this code calls a helper named format-currency:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Cost @cents={{230}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/cost.hbs
1\n
<div>{{format-currency @cents currency="$"}}</div>
\n
\n
\n \n

Additionally a helper can be called as a nested helper.\nIn this example, we show the formatted currency value if the showMoney\nnamed argument is truthy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{if @showMoney (format-currency @cents currency="$")}}
\n
\n
\n \n

Helpers defined using a class must provide a compute function. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n6\n7\n
import Helper from '@ember/component/helper';\n\nexport default class extends Helper {\n  compute([cents], { currency }) {\n    return `${currency}${cents * 0.01}`;\n  }\n}
\n
\n
\n \n

Each time the input to a helper changes, the compute function will be\ncalled again.

\n

As instances, these helpers also have access to the container and will accept\ninjected dependencies.

\n

Additionally, class helpers can call recompute to force a new computation.

\n", + "extends": "CoreObject", + "access": "public", + "tagname": "", + "since": "1.13.0", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 93, + "description": "

Override this function when writing a class-based helper.

\n", + "itemtype": "method", + "name": "compute", + "params": [ + { + "name": "params", + "description": "The positional arguments to the helper", + "type": "Array" + }, + { + "name": "hash", + "description": "The named arguments to the helper", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 117, + "description": "

On a class-based helper, it may be useful to force a recomputation of that\nhelpers value. This is akin to rerender on a component.

\n

For example, this component will rerender when the currentUser on a\nsession service changes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
email.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Helper from '@ember/component/helper'\nimport { service } from '@ember/service'\nimport { observer } from '@ember/object'\n\nexport default Helper.extend({\n  session: service(),\n\n  onNewUser: observer('session.currentUser', function() {\n    this.recompute();\n  }),\n\n  compute() {\n    return this.get('session.currentUser.email');\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "recompute", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-HistoryLocation-d9f50258e7.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-HistoryLocation-d9f50258e7.json new file mode 100644 index 000000000..0db48b7c0 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-HistoryLocation-d9f50258e7.json @@ -0,0 +1,707 @@ +{ + "data": { + "id": "ember-4.6.0-HistoryLocation", + "type": "class", + "attributes": { + "name": "HistoryLocation", + "shortname": "HistoryLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 21, + "description": "

HistoryLocation implements the location API using the browser's\nhistory.pushState API.

\n

Using HistoryLocation results in URLs that are indistinguishable from a\nstandard URL. This relies upon the browser's history API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'history'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new.

\n

Keep in mind that your server must serve the Ember app at all the routes you\ndefine.

\n

Using HistoryLocation will also result in location states being recorded by\nthe browser history API with the following schema:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
window.history.state -> { path: '/', uuid: '3552e730-b4a6-46bd-b8bf-d8c3c1a97e0a' }
\n
\n
\n \n

This allows each in-app location state to be tracked uniquely across history\nstate changes via the uuid field.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 79, + "access": "private", + "tagname": "Returns normalized location.hash", + "itemtype": "method", + "name": "getHash", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 105, + "description": "

Used to set state on first call to setURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initState", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 126, + "description": "

Returns the current location.pathname without rootURL or baseURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 153, + "description": "

Uses history.pushState to update the url without a page reload.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 169, + "description": "

Uses history.replaceState to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 186, + "description": "

Pushes a new state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "pushState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 202, + "description": "

Replaces the current state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 218, + "description": "

Register a callback to be invoked whenever the browser\nhistory changes, including using forward and back buttons.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 243, + "description": "

Used when using {{action}} helper. The url is always appended to the rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "formatted url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 267, + "description": "

Cleans up the HistoryLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 71, + "description": "

Will be pre-pended to path upon state change

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Location-92519d93ef.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Location-92519d93ef.json new file mode 100644 index 000000000..8c79f017b --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Location-92519d93ef.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.6.0-Location", + "type": "class", + "attributes": { + "name": "Location", + "shortname": "Location", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/api.ts", + "line": 21, + "description": "

Location returns an instance of the correct implementation of\nthe location API.

\n

Implementations

\n

You can pass an implementation name (hash, history, none, auto) to force a\nparticular implementation to be used in your application.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n

Location API

\n

Each location implementation must provide the following methods:

\n
    \n
  • implementation: returns the string name used to reference the implementation.
  • \n
  • getURL: returns the current URL.
  • \n
  • setURL(path): sets the current URL.
  • \n
  • replaceURL(path): replace the current URL (optional).
  • \n
  • onUpdateURL(callback): triggers the callback when the URL changes.
  • \n
  • formatURL(url): formats url to be placed into href attribute.
  • \n
  • detect() (optional): instructs the location to do any feature detection\n necessary. If the location needs to redirect to a different URL, it\n can cancel routing by setting the cancelRouterSetup property on itself\n to false.
  • \n
\n

Calling setURL or replaceURL will not trigger onUpdateURL callbacks.

\n

Custom implementation

\n

Ember scans app/locations/* for extending the Location API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import HistoryLocation from '@ember/routing/history-location';\n\nexport default class MyHistory {\n  implementation = 'my-custom-history';\n\n  constructor() {\n    this._history = HistoryLocation.create(...arguments);\n  }\n\n  create() {\n    return new this(...arguments);\n  }\n\n  pushState(path) {\n     this._history.pushState(path);\n  }\n}
\n
\n
\n \n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/api.ts", + "line": 82, + "description": "

This is deprecated in favor of using the container to lookup the location\nimplementation as desired.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
// Given a location registered as follows:\ncontainer.register('location:history-test', HistoryTestLocation);\n\n// You could create a new instance via:\ncontainer.lookup('location:history-test');
\n
\n
\n \n", + "itemtype": "method", + "name": "create", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "an instance of an implementation of the `location` API", + "type": "Object" + }, + "deprecated": true, + "deprecationMessage": "Use the container to lookup the location implementation that you\n need.", + "access": "private", + "tagname": "", + "class": "Location", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Mixin-072b173cae.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Mixin-072b173cae.json new file mode 100644 index 000000000..16d379f77 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Mixin-072b173cae.json @@ -0,0 +1,75 @@ +{ + "data": { + "id": "ember-4.6.0-Mixin", + "type": "class", + "attributes": { + "name": "Mixin", + "shortname": "Mixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 442, + "description": "

The Mixin class allows you to create mixins, whose properties can be\nadded to other classes. For instance,

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nconst EditableMixin = Mixin.create({\n  edit() {\n    console.log('starting to edit');\n    this.set('isEditing', true);\n  },\n  isEditing: false\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import EmberObject from '@ember/object';\nimport EditableMixin from '../mixins/editable';\n\n// Mix mixins into classes by passing them as the first arguments to\n// `.extend.`\nconst Comment = EmberObject.extend(EditableMixin, {\n  post: null\n});\n\nlet comment = Comment.create({\n  post: somePost\n});\n\ncomment.edit(); // outputs 'starting to edit'
\n
\n
\n \n

Note that Mixins are created with Mixin.create, not\nMixin.extend.

\n

Note that mixins extend a constructor's prototype so arrays and object literals\ndefined as properties will be shared amongst objects that implement the mixin.\nIf you want to define a property in a mixin that is not shared, you can define\nit either as a computed property or have it be created on initialization of the object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
// filters array will be shared amongst any object implementing mixin\nimport Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\nconst FilterableMixin = Mixin.create({\n  filters: A()\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\nimport { computed } from '@ember/object';\n\n// filters will be a separate array for every object implementing the mixin\nconst FilterableMixin = Mixin.create({\n  filters: computed(function() {\n    return A();\n  })\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\n// filters will be created as a separate array during the object's initialization\nconst Filterable = Mixin.create({\n  filters: null,\n\n  init() {\n    this._super(...arguments);\n    this.set("filters", A());\n  }\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 428, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Mixin", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.6.0-Ember.TargetActionSupport" + } + ] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-MutableArray-fe58ad8683.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-MutableArray-fe58ad8683.json new file mode 100644 index 000000000..e64334bbc --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-MutableArray-fe58ad8683.json @@ -0,0 +1,1240 @@ +{ + "data": { + "id": "ember-4.6.0-MutableArray", + "type": "class", + "attributes": { + "name": "MutableArray", + "shortname": "MutableArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "ArrayProxy" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1457, + "description": "

This mixin defines the API for modifying array-like objects. These methods\ncan be applied only to a collection that keeps its items in an ordered set.\nIt builds upon the Array mixin and adds methods to modify the array.\nOne concrete implementations of this class include ArrayProxy.

\n

It is important to use the methods in this class to modify arrays so that\nchanges are observable. This allows the binding system in Ember to function\ncorrectly.

\n

Note that an Array can change even if it does not implement this mixin.\nFor example, one might implement a SparseArray that cannot be directly\nmodified, but if its underlying enumerable changes, it will change also.

\n", + "uses": [ + "MutableEnumerable", + "EmberArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1496, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1515, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1541, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1563, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1588, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1608, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1628, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1654, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1679, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1699, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1720, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1739, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1766, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1794, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1812, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1838, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 329, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 354, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 438, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 481, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 523, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 577, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 637, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 660, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 683, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 731, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 752, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 829, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 881, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 906, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 934, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 981, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1015, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1057, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1101, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1145, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1175, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1246, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1285, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1297, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1313, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1346, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1390, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1409, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1431, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 319, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 373, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 401, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 426, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Namespace-0a876da147.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Namespace-0a876da147.json new file mode 100644 index 000000000..29e436fb0 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Namespace-0a876da147.json @@ -0,0 +1,536 @@ +{ + "data": { + "id": "ember-4.6.0-Namespace", + "type": "class", + "attributes": { + "name": "Namespace", + "shortname": "Namespace", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/namespace.ts", + "line": 20, + "description": "

A Namespace is an object usually used to contain other objects or methods\nsuch as an application or framework. Create a namespace anytime you want\nto define one of these new containers.

\n

Example Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
MyFramework = Ember.Namespace.create({\n  VERSION: '1.0.0'\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-NoneLocation-94f1419168.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-NoneLocation-94f1419168.json new file mode 100644 index 000000000..b1c2843fb --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-NoneLocation-94f1419168.json @@ -0,0 +1,639 @@ +{ + "data": { + "id": "ember-4.6.0-NoneLocation", + "type": "class", + "attributes": { + "name": "NoneLocation", + "shortname": "NoneLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 10, + "description": "

NoneLocation does not interact with the browser. It is useful for\ntesting, or when you need to manage state with your Router, but temporarily\ndon't want it to muck with the URL (for example when you embed your\napplication in a larger page).

\n

Using NoneLocation causes Ember to not store the applications URL state\nin the actual URL. This is generally used for testing purposes, and is one\nof the changes made when calling App.setupForTesting().

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 55, + "description": "

Returns the current path without rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "path", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 72, + "description": "

Set the path and remembers what was set. Using this method\nto change the path will not invoke the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 84, + "description": "

Register a callback to be invoked when the path changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 97, + "description": "

Sets the path and calls the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "handleURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 109, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 31, + "description": "

Will be pre-pended to path.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-ObjectProxy-61a5f2d202.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-ObjectProxy-61a5f2d202.json new file mode 100644 index 000000000..7784dcb56 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-ObjectProxy-61a5f2d202.json @@ -0,0 +1,571 @@ +{ + "data": { + "id": "ember-4.6.0-ObjectProxy", + "type": "class", + "attributes": { + "name": "ObjectProxy", + "shortname": "ObjectProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/object_proxy.ts", + "line": 4, + "description": "

ObjectProxy forwards all properties not defined by the proxy itself\nto a proxied content object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nlet exampleObject = EmberObject.create({\n  name: 'Foo'\n});\n\nlet exampleProxy = ObjectProxy.create({\n  content: exampleObject\n});\n\n// Access and change existing properties\nexampleProxy.get('name');          // 'Foo'\nexampleProxy.set('name', 'Bar');\nexampleObject.get('name');         // 'Bar'\n\n// Create new 'description' property on `exampleObject`\nexampleProxy.set('description', 'Foo is a whizboo baz');\nexampleObject.get('description');  // 'Foo is a whizboo baz'
\n
\n
\n \n

While content is unset, setting a property to be delegated will throw an\nError.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import ObjectProxy from '@ember/object/proxy';\n\nlet exampleProxy = ObjectProxy.create({\n  content: null,\n  flag: null\n});\nexampleProxy.set('flag', true);\nexampleProxy.get('flag');         // true\nexampleProxy.get('foo');          // undefined\nexampleProxy.set('foo', 'data');  // throws Error
\n
\n
\n \n

Delegated properties can be bound to and will change when content is updated.

\n

Computed properties on the proxy itself can depend on delegated properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { computed } from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nProxyWithComputedProperty = ObjectProxy.extend({\n  fullName: computed('firstName', 'lastName', function() {\n    var firstName = this.get('firstName'),\n        lastName = this.get('lastName');\n    if (firstName && lastName) {\n      return firstName + ' ' + lastName;\n    }\n    return firstName || lastName;\n  })\n});\n\nlet exampleProxy = ProxyWithComputedProperty.create();\n\nexampleProxy.get('fullName');  // undefined\nexampleProxy.set('content', {\n  firstName: 'Tom', lastName: 'Dale'\n}); // triggers property change for fullName on proxy\n\nexampleProxy.get('fullName');  // 'Tom Dale'
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "Ember.ProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 72, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 94, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Observable-60150c1c34.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Observable-60150c1c34.json new file mode 100644 index 000000000..1eb016c56 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Observable-60150c1c34.json @@ -0,0 +1,388 @@ +{ + "data": { + "id": "ember-4.6.0-Observable", + "type": "class", + "attributes": { + "name": "Observable", + "shortname": "Observable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "EmberObject" + ], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 25, + "description": "

Overview

\n

This mixin provides properties and property observing functionality, core\nfeatures of the Ember object model.

\n

Properties and observers allow one object to observe changes to a\nproperty on another object. This is one of the fundamental ways that\nmodels, controllers and views communicate with each other in an Ember\napplication.

\n

Any object that has this mixin applied can be used in observer\noperations. That includes EmberObject and most objects you will\ninteract with as you write your Ember application.

\n

Note that you will not generally apply this mixin to classes yourself,\nbut you will use the features provided by this module frequently, so it\nis important to understand how to use it.

\n

Using get() and set()

\n

Because of Ember's support for bindings and observers, you will always\naccess properties using the get method, and set properties using the\nset method. This allows the observing objects to be notified and\ncomputed properties to be handled properly.

\n

More documentation about get and set are below.

\n

Observing Property Changes

\n

You typically observe property changes simply by using the observer\nfunction in classes that you write.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { observer } from '@ember/object';\nimport EmberObject from '@ember/object';\n\nEmberObject.extend({\n  valueObserver: observer('value', function(sender, key, value, rev) {\n    // Executes whenever the "value" property changes\n    // See the addObserver method for more information about the callback arguments\n  })\n});
\n
\n
\n \n

Although this is the most common way to add an observer, this capability\nis actually built into the EmberObject class on top of two methods\ndefined in this mixin: addObserver and removeObserver. You can use\nthese two methods to add and remove observers yourself if you need to\ndo so at runtime.

\n

To add an observer for a property, call:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
object.addObserver('propertyKey', targetObject, targetAction)
\n
\n
\n \n

This will call the targetAction method on the targetObject whenever\nthe value of the propertyKey changes.

\n

Note that if propertyKey is a computed property, the observer will be\ncalled when any of the property dependencies are changed, even if the\nresulting value of the computed property is unchanged. This is necessary\nbecause computed properties are not computed until get is called.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Promise-adfae77aaf.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Promise-adfae77aaf.json new file mode 100644 index 000000000..2d47941d6 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Promise-adfae77aaf.json @@ -0,0 +1,246 @@ +{ + "data": { + "id": "ember-4.6.0-Promise", + "type": "class", + "attributes": { + "name": "Promise", + "shortname": "Promise", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 26, + "description": "

Promise objects represent the eventual result of an asynchronous operation. The\nprimary way of interacting with a promise is through its then method, which\nregisters callbacks to receive either a promise’s eventual value or the reason\nwhy the promise cannot be fulfilled.

\n

Terminology

\n
    \n
  • promise is an object or function with a then method whose behavior conforms to this specification.
  • \n
  • thenable is an object or function that defines a then method.
  • \n
  • value is any legal JavaScript value (including undefined, a thenable, or a promise).
  • \n
  • exception is a value that is thrown using the throw statement.
  • \n
  • reason is a value that indicates why a promise was rejected.
  • \n
  • settled the final resting state of a promise, fulfilled or rejected.
  • \n
\n

A promise can be in one of three states: pending, fulfilled, or rejected.

\n

Promises that are fulfilled have a fulfillment value and are in the fulfilled\nstate. Promises that are rejected have a rejection reason and are in the\nrejected state. A fulfillment value is never a thenable.

\n

Promises can also be said to resolve a value. If this value is also a\npromise, then the original promise's settled state will match the value's\nsettled state. So a promise that resolves a promise that rejects will\nitself reject, and a promise that resolves a promise that fulfills will\nitself fulfill.

\n

Basic Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
let promise = new Promise(function(resolve, reject) {\n  // on success\n  resolve(value);\n\n  // on failure\n  reject(reason);\n});\n\npromise.then(function(value) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Advanced Usage:

\n

Promises shine when abstracting away asynchronous interactions such as\nXMLHttpRequests.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
function getJSON(url) {\n  return new Promise(function(resolve, reject){\n    let xhr = new XMLHttpRequest();\n\n    xhr.open('GET', url);\n    xhr.onreadystatechange = handler;\n    xhr.responseType = 'json';\n    xhr.setRequestHeader('Accept', 'application/json');\n    xhr.send();\n\n    function handler() {\n      if (this.readyState === this.DONE) {\n        if (this.status === 200) {\n          resolve(this.response);\n        } else {\n          reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n        }\n      }\n    };\n  });\n}\n\ngetJSON('/posts.json').then(function(json) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Unlike callbacks, promises are great composable primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Promise.all([\n  getJSON('/posts'),\n  getJSON('/comments')\n]).then(function(values){\n  values[0] // => postsJSON\n  values[1] // => commentsJSON\n\n  return values;\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "params": [ + { + "name": "resolver", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "is_constructor": 1, + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/promise/all.js", + "line": 3, + "description": "

Promise.all accepts an array of promises, and returns a new promise which\nis fulfilled with an array of fulfillment values for the passed promises, or\nrejected with the reason of the first passed promise to be rejected. It casts all\nelements of the passed iterable to promises as it runs this algorithm.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Promise, { resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // The array here would be [ 1, 2, 3 ];\n});
\n
\n
\n \n

If any of the promises given to RSVP.all are rejected, the first promise\nthat is rejected will be given as an argument to the returned promises's\nrejection handler. For example:

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Promise, { resolve, reject } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error("2"));\nlet promise3 = reject(new Error("3"));\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(error) {\n  // error.message === "2"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "all", + "params": [ + { + "name": "entries", + "description": "array of promises", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all `promises` have been\nfulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "static": 1, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/race.js", + "line": 9, + "description": "

Promise.race returns a new promise which is settled in the same way as the\nfirst passed promise to settle.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 2');\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // result === 'promise 2' because it was resolved before promise1\n  // was resolved.\n});
\n
\n
\n \n

Promise.race is deterministic in that only the state of the first\nsettled promise matters. For example, even if other promises given to the\npromises array argument are resolved, but the first settled promise has\nbecome rejected before the other promises became fulfilled, the returned\npromise will become rejected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    reject(new Error('promise 2'));\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // Code here never runs\n}, function(reason){\n  // reason.message === 'promise 2' because promise 2 became rejected before\n  // promise 1 became fulfilled\n});
\n
\n
\n \n

An example real-world use case is implementing timeouts:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import Promise from 'rsvp';\n\nPromise.race([ajax('foo.json'), timeout(5000)])
\n
\n
\n \n", + "itemtype": "method", + "name": "race", + "static": 1, + "params": [ + { + "name": "entries", + "description": "array of promises to observe", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for describing the promise returned.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise which settles in the same way as the first passed\npromise to settle.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/reject.js", + "line": 6, + "description": "

Promise.reject returns a promise rejected with the passed reason.\nIt is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  reject(new Error('WHOOPS'));\n});\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = Promise.reject(new Error('WHOOPS'));\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/resolve.js", + "line": 6, + "description": "

Promise.resolve returns a promise that will become resolved with the\npassed value. It is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  resolve(1);\n});\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Promise from 'rsvp';\n\nlet promise = RSVP.Promise.resolve(1);\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "resolve", + "static": 1, + "params": [ + { + "name": "object", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 155, + "description": "

catch is simply sugar for then(undefined, onRejection) which makes it the same\nas the catch block of a try/catch statement.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
function findAuthor(){\n  throw new Error('couldn\\'t find that author');\n}\n\n// synchronous\ntry {\n  findAuthor();\n} catch(reason) {\n  // something went wrong\n}\n\n// async with promises\nfindAuthor().catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 187, + "description": "

finally will be invoked regardless of the promise's fate just as native\ntry/catch/finally behaves

\n

Synchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
findAuthor() {\n  if (Math.random() > 0.5) {\n    throw new Error();\n  }\n  return new Author();\n}\n\ntry {\n  return findAuthor(); // succeed or fail\n} catch(error) {\n  return findOtherAuthor();\n} finally {\n  // always runs\n  // doesn't affect the return value\n}
\n
\n
\n \n

Asynchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findAuthor().catch(function(reason){\n  return findOtherAuthor();\n}).finally(function(){\n  // author was either found, or not\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 248, + "description": "

The primary way of interacting with a promise is through its then method,\nwhich registers callbacks to receive either a promise's eventual value or the\nreason why the promise cannot be fulfilled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function(user){\n  // user is available\n}, function(reason){\n  // user is unavailable, and you are given the reason why\n});
\n
\n
\n \n

Chaining

\n

The return value of then is itself a promise. This second, 'downstream'\npromise is resolved with the return value of the first promise's fulfillment\nor rejection handler, or rejected if the handler throws an exception.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
findUser().then(function (user) {\n  return user.name;\n}, function (reason) {\n  return 'default name';\n}).then(function (userName) {\n  // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n  // will be `'default name'`\n});\n\nfindUser().then(function (user) {\n  throw new Error('Found user, but still unhappy');\n}, function (reason) {\n  throw new Error('`findUser` rejected and we\\'re unhappy');\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n  // If `findUser` rejected, `reason` will be '`findUser` rejected and we\\'re unhappy'.\n});
\n
\n
\n \n

If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
findUser().then(function (user) {\n  throw new PedagogicalException('Upstream error');\n}).then(function (value) {\n  // never reached\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // The `PedgagocialException` is propagated all the way down to here\n});
\n
\n
\n \n

Assimilation

\n

Sometimes the value you want to propagate to a downstream promise can only be\nretrieved asynchronously. This can be achieved by returning a promise in the\nfulfillment or rejection handler. The downstream promise will then be pending\nuntil the returned promise is settled. This is called assimilation.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // The user's comments are now available\n});
\n
\n
\n \n

If the assimliated promise rejects, then the downstream promise will also reject.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // If `findCommentsByAuthor` fulfills, we'll have the value here\n}, function (reason) {\n  // If `findCommentsByAuthor` rejects, we'll have the reason here\n});
\n
\n
\n \n

Simple Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let result;\n\ntry {\n  result = findResult();\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findResult(function(result, err){\n  if (err) {\n    // failure\n  } else {\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findResult().then(function(result){\n  // success\n}, function(reason){\n  // failure\n});
\n
\n
\n \n

Advanced Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let author, books;\n\ntry {\n  author = findAuthor();\n  books  = findBooksByAuthor(author);\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
function foundBooks(books) {\n\n}\n\nfunction failure(reason) {\n\n}\n\nfindAuthor(function(author, err){\n  if (err) {\n    failure(err);\n    // failure\n  } else {\n    try {\n      findBoooksByAuthor(author, function(books, err) {\n        if (err) {\n          failure(err);\n        } else {\n          try {\n            foundBooks(books);\n          } catch(reason) {\n            failure(reason);\n          }\n        }\n      });\n    } catch(error) {\n      failure(err);\n    }\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findAuthor().\n  then(findBooksByAuthor).\n  then(function(books){\n    // found books\n}).catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "onFulfillment", + "description": "", + "type": "Function" + }, + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-PromiseProxyMixin-1cde4653aa.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-PromiseProxyMixin-1cde4653aa.json new file mode 100644 index 000000000..8237ce269 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-PromiseProxyMixin-1cde4653aa.json @@ -0,0 +1,186 @@ +{ + "data": { + "id": "ember-4.6.0-PromiseProxyMixin", + "type": "class", + "attributes": { + "name": "PromiseProxyMixin", + "shortname": "PromiseProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 46, + "description": "

A low level mixin making ObjectProxy promise-aware.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { resolve } from 'rsvp';\nimport $ from 'jquery';\nimport ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nlet ObjectPromiseProxy = ObjectProxy.extend(PromiseProxyMixin);\n\nlet proxy = ObjectPromiseProxy.create({\n  promise: resolve($.getJSON('/some/remote/data.json'))\n});\n\nproxy.then(function(json){\n   // the json\n}, function(reason) {\n   // the reason why you have no json\n});
\n
\n
\n \n

the proxy has bindable attributes which\ntrack the promises life cycle

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> true\nproxy.get('isSettled')  //=> false\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> false
\n
\n
\n \n

When the $.getJSON completes, and the promise is fulfilled\nwith json, the life cycle attributes will update accordingly.\nNote that $.getJSON doesn't return an ECMA specified promise,\nit is useful to wrap this with an RSVP.resolve so that it behaves\nas a spec compliant promise.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> false\nproxy.get('isSettled')   //=> true\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> true
\n
\n
\n \n

As the proxy is an ObjectProxy, and the json now its content,\nall the json properties will be available directly from the proxy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// Assuming the following json:\n{\n  firstName: 'Stefan',\n  lastName: 'Penner'\n}\n\n// both properties will accessible on the proxy\nproxy.get('firstName') //=> 'Stefan'\nproxy.get('lastName')  //=> 'Penner'
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 204, + "description": "

An alias to the proxied promise's then.

\n

See RSVP.Promise.then.

\n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 216, + "description": "

An alias to the proxied promise's catch.

\n

See RSVP.Promise.catch.

\n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 229, + "description": "

An alias to the proxied promise's finally.

\n

See RSVP.Promise.finally.

\n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 125, + "description": "

If the proxied promise is rejected this will contain the reason\nprovided.

\n", + "itemtype": "property", + "name": "reason", + "default": "null", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 135, + "description": "

Once the proxied promise has settled this will become false.

\n", + "itemtype": "property", + "name": "isPending", + "default": "true", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 146, + "description": "

Once the proxied promise has settled this will become true.

\n", + "itemtype": "property", + "name": "isSettled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 157, + "description": "

Will become true if the proxied promise is rejected.

\n", + "itemtype": "property", + "name": "isRejected", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 166, + "description": "

Will become true if the proxied promise is fulfilled.

\n", + "itemtype": "property", + "name": "isFulfilled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 175, + "description": "

The promise whose fulfillment value is being proxied by this object.

\n

This property must be specified upon creation, and should not be\nchanged once created.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nObjectProxy.extend(PromiseProxyMixin).create({\n  promise: <thenable>\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "promise", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Registry-19a792ccc3.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Registry-19a792ccc3.json new file mode 100644 index 000000000..7822003ba --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Registry-19a792ccc3.json @@ -0,0 +1,407 @@ +{ + "data": { + "id": "ember-4.6.0-Registry", + "type": "class", + "attributes": { + "name": "Registry", + "shortname": "Registry", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 57, + "description": "

A registry used to store factory and option information keyed\nby type.

\n

A Registry stores the factory and option information needed by a\nContainer to instantiate and cache objects.

\n

The API for Registry is still in flux and should not be considered stable.

\n", + "access": "private", + "tagname": "", + "since": "1.11.0", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 146, + "description": "

Creates a container based on this registry.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "container", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "created container", + "type": "Container" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 158, + "description": "

Registers a factory for later injection.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let registry = new Registry();\n\nregistry.register('model:user', Person, {singleton: false });\nregistry.register('fruit:favorite', Orange);\nregistry.register('communication:main', Email, {singleton: false});
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "factory", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 195, + "description": "

Unregister a fullName

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.register('model:user', User);\n\nregistry.resolve('model:user').create() instanceof User //=> true\n\nregistry.unregister('model:user')\nregistry.resolve('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 223, + "description": "

Given a fullName return the corresponding factory.

\n

By default resolve will retrieve the factory from\nthe registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let registry = new Registry();\nregistry.register('api:twitter', Twitter);\n\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n

Optionally the registry can be provided with a custom resolver.\nIf provided, resolve will first provide the custom resolver\nthe opportunity to resolve the fullName, otherwise it will fallback\nto the registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.resolver = function(fullName) {\n   // lookup via the module system of choice\n };\n\n// the twitter factory is added to the module system\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 264, + "description": "

A hook that can be used to describe how the resolver will\nattempt to find the factory.

\n

For example, the default Ember .describe returns the full\nclass name (including namespace) where Ember's resolver expects\nto find the fullName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "describe", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "described fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 287, + "description": "

A hook to enable custom fullName normalization behavior

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalizeFullName", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 305, + "description": "

Normalize a fullName based on the application's conventions

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalize", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 320, + "itemtype": "method", + "name": "makeToString", + "access": "private", + "tagname": "", + "params": [ + { + "name": "factory", + "description": "", + "type": "Any" + }, + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "toString function", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 338, + "description": "

Given a fullName check if the container is aware of its factory\nor singleton instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "the fullname of the request source (used for local lookups)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 357, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let registry = new Registry();\nlet container = registry.container();\n\n// if all of type `connection` must not be singletons\nregistry.optionsForType('connection', { singleton: false });\n\nregistry.register('connection:twitter', TwitterConnection);\nregistry.register('connection:facebook', FacebookConnection);\n\nlet twitter = container.lookup('connection:twitter');\nlet twitter2 = container.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = container.lookup('connection:facebook');\nlet facebook2 = container.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "optionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 398, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "options", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 471, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "knownForType", + "params": [ + { + "name": "type", + "description": "the type to iterate over", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 96, + "description": "

A backup registry for resolving registrations when no matches can be found.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "fallback", + "type": "Registry", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 104, + "description": "

An object that has a resolve method that resolves a name.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "resolver", + "type": "Resolver", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 112, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registrations", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 118, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_normalizeCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 125, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_resolveCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 132, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_options", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 139, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_typeOptions", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-RegistryProxyMixin-bd359bd485.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-RegistryProxyMixin-bd359bd485.json new file mode 100644 index 000000000..54d4e7a41 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-RegistryProxyMixin-bd359bd485.json @@ -0,0 +1,285 @@ +{ + "data": { + "id": "ember-4.6.0-RegistryProxyMixin", + "type": "class", + "attributes": { + "name": "RegistryProxyMixin", + "shortname": "RegistryProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Engine", + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 37, + "description": "

RegistryProxyMixin is used to provide public access to specific\nregistry functionality.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 51, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "RegistryProxyMixin", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Route-59cb1471c7.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Route-59cb1471c7.json new file mode 100644 index 000000000..2cb143cf3 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Route-59cb1471c7.json @@ -0,0 +1,1706 @@ +{ + "data": { + "id": "ember-4.6.0-Route", + "type": "class", + "attributes": { + "name": "Route", + "shortname": "Route", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 84, + "description": "

The Route class is used to define individual routes. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented", + "ActionHandler" + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 310, + "description": "

A hook you can implement to convert the route's model into parameters\nfor the URL.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model({ post_id }) {\n    // the server returns `{ id: 12 }`\n    return fetch(`/posts/${post_id}`;\n  }\n\n  serialize(model) {\n    // this will make the URL `/posts/12`\n    return { post_id: model.id };\n  }\n}
\n
\n
\n \n

The default serialize method will insert the model's id into the\nroute's dynamic segment (in this case, :post_id) if the segment contains '_id'.\nIf the route has multiple dynamic segments or does not contain '_id', serialize\nwill return getProperties(model, params)

\n

This method is called when transitionTo is called with a context\nin order to populate the URL.

\n", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "model", + "description": "the routes model", + "type": "Object" + }, + { + "name": "params", + "description": "an Array of parameter names for the current\n route (in the example, `['post_id']`.", + "type": "Array" + } + ], + "return": { + "description": "the serialized parameters", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 547, + "description": "

Sets the name for this route, including a fully resolved name for routes\ninside engines.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_setRouteName", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 562, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_stashNames", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 605, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_updatingQPChanged", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 613, + "description": "

Returns a hash containing the parameters of an ancestor route.

\n

You may notice that this.paramsFor sometimes works when referring to a\nchild route, but this behavior should not be relied upon as only ancestor\nroutes are certain to be loaded in time.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('member', { path: ':name' }, function() {\n    this.route('interest', { path: ':interest' });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class MemberRoute extends Route {\n  queryParams = {\n    memberQp: { refreshModel: true }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member/interest.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default class MemberInterestRoute extends Route {\n  queryParams = {\n    interestQp: { refreshModel: true }\n  }\n\n  model() {\n    return this.paramsFor('member');\n  }\n}
\n
\n
\n \n

If we visit /turing/maths?memberQp=member&interestQp=interest the model for\nthe member.interest route is a hash with:

\n
    \n
  • name: turing
  • \n
  • memberQp: member
  • \n
\n", + "itemtype": "method", + "name": "paramsFor", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "return": { + "description": "hash containing the parameters of the route `name`", + "type": "Object" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 694, + "description": "

Serializes the query parameter key

\n", + "itemtype": "method", + "name": "serializeQueryParamKey", + "params": [ + { + "name": "controllerPropertyName", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 705, + "description": "

Serializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 721, + "description": "

Deserializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 753, + "description": "

A hook you can use to reset controller values either when the model\nchanges or the route is exiting.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/articles.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class ArticlesRoute extends Route {\n  resetController(controller, isExiting, transition) {\n    if (isExiting && transition.targetName !== 'error') {\n      controller.set('page', 1);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "resetController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "isExiting", + "description": "", + "type": "Boolean" + }, + { + "name": "transition", + "description": "", + "type": "Object" + } + ], + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 780, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "exit", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 791, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_internalReset", + "since": "3.6.0", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 805, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "enter", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 856, + "description": "

This hook is executed when the router completely exits this route. It is\nnot executed when the model for the route changes.

\n", + "itemtype": "method", + "name": "deactivate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 867, + "description": "

This hook is executed when the router enters the route. It is not executed\nwhen the model for the route changes.

\n", + "itemtype": "method", + "name": "activate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 878, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogPosts');\nthis.transitionTo('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('blogPost', { path:':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogComment', aPost, aComment);\nthis.transitionTo('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
this.transitionTo('/');\nthis.transitionTo('/blog/post/1/comment/13');\nthis.transitionTo('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
this.transitionTo('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\nthis.transitionTo({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceWith.

\n

Simple Transition Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n  this.route('fourOhFour', { path: '*:' });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToSecret(context) {\n    if (authorized()) {\n      this.transitionTo('secret', context);\n    } else {\n      this.transitionTo('fourOhFour');\n    }\n  }\n}
\n
\n
\n \n

Transition to a nested route

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('articles', { path: '/articles' }, function() {\n    this.route('new');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToNewArticle() {\n    this.transitionTo('articles.new');\n  }\n}
\n
\n
\n \n

Multiple Models Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n\n  this.route('breakfast', { path: ':breakfastId' }, function() {\n    this.route('cereal', { path: ':cerealId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToChocolateCereal() {\n    let cereal = { cerealId: 'ChocolateYumminess' };\n    let breakfast = { breakfastId: 'CerealAndMilk' };\n\n    this.transitionTo('breakfast.cereal', breakfast, cereal);\n  }\n}
\n
\n
\n \n

Nested Route with Query String Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('fruits', function() {\n    this.route('apples');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToApples() {\n    this.transitionTo('fruits.apples', { queryParams: { color: 'red' } });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL.", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1076, + "description": "

Perform a synchronous transition into another route without attempting\nto resolve promises, update the URL, or abort any currently active\nasynchronous transitions (i.e. regular transitions caused by\ntransitionTo or URL changes).

\n

This method is handy for performing intermediate transitions on the\nway to a final destination route, and is called internally by the\ndefault implementations of the error and loading handlers.

\n", + "itemtype": "method", + "name": "intermediateTransitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) to be used while transitioning\nto the route.", + "type": "...Object" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1098, + "description": "

Refresh the model on this route and any child routes, firing the\nbeforeModel, model, and afterModel hooks in a similar fashion\nto how routes are entered when transitioning in from other route.\nThe current route params (e.g. article_id) will be passed in\nto the respective model hooks, and if a different model is returned,\nsetupController and associated route hooks will re-fire as well.

\n

An example usage of this method is re-querying the server for the\nlatest information using the same parameters as when the route\nwas first entered.

\n

Note that this will cause model hooks to fire even on routes\nthat were provided a model object when the route was initially\nentered.

\n", + "itemtype": "method", + "name": "refresh", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1124, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionTo in all other respects. See\n'transitionTo' for additional information regarding multiple models.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/secret.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class SecretRoute Route {\n  afterModel() {\n    if (!authorized()){\n      this.replaceWith('index');\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1172, + "description": "

This hook is the entry point for router.js

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1247, + "description": "

This hook is the first of the route entry validation hooks\ncalled when an attempt is made to transition into a route\nor one of its children. It is called before model and\nafterModel, and is appropriate for cases when:

\n
    \n
  1. A decision can be made to redirect elsewhere without\nneeding to resolve the model first.
  2. \n
  3. Any async operations need to occur first before the\nmodel is attempted to be resolved.
  4. \n
\n

This hook is provided the current transition attempt\nas a parameter, which can be used to .abort() the transition,\nsave it for a later .retry(), or retrieve values set\non it from a previous hook. You can also just call\nthis.transitionTo to another route to implicitly\nabort the transition.

\n

You can return a promise from this hook to pause the\ntransition until the promise resolves (or rejects). This could\nbe useful, for instance, for retrieving async code from\nthe server that is required to enter a route.

\n", + "itemtype": "method", + "name": "beforeModel", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1282, + "description": "

This hook is called after this route's model has resolved.\nIt follows identical async/promise semantics to beforeModel\nbut is provided the route's resolved model in addition to\nthe transition, and is therefore suited to performing\nlogic that can only take place after the model has already\nresolved.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n  afterModel(posts, transition) {\n    if (posts.get('length') === 1) {\n      this.transitionTo('post.show', posts.get('firstObject'));\n    }\n  }\n}
\n
\n
\n \n

Refer to documentation for beforeModel for a description\nof transition-pausing semantics when a promise is returned\nfrom this hook.

\n", + "itemtype": "method", + "name": "afterModel", + "params": [ + { + "name": "resolvedModel", + "description": "the value returned from `model`,\n or its resolved value if it was a promise", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1320, + "description": "

A hook you can implement to optionally redirect to another route.

\n

Calling this.transitionTo from inside of the redirect hook will\nabort the current transition (into the route that has implemented redirect).

\n

redirect and afterModel behave very similarly and are\ncalled almost at the same time, but they have an important\ndistinction when calling this.transitionTo to a child route\nof the current route. From afterModel, this new transition\ninvalidates the current transition, causing beforeModel,\nmodel, and afterModel hooks to be called again. But the\nsame transition started from redirect does not invalidate\nthe current transition. In other words, by the time the redirect\nhook has been called, both the resolved model and the attempted\nentry into this route are considered fully validated.

\n", + "itemtype": "method", + "name": "redirect", + "params": [ + { + "name": "model", + "description": "the model for this route", + "type": "Object" + }, + { + "name": "transition", + "description": "the transition object associated with the current transition", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1345, + "description": "

Called when the context is changed by router.js.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "contextDidChange", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1355, + "description": "

A hook you can implement to convert the URL into the model for\nthis route.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

The model for the post route is store.findRecord('post', params.post_id).

\n

By default, if your route has a dynamic segment ending in _id:

\n
    \n
  • The model class is determined from the segment (post_id's\nclass is App.Post)
  • \n
  • The find method is called on the model class with the value of\nthe dynamic segment.
  • \n
\n

Note that for routes with dynamic segments, this hook is not always\nexecuted. If the route is entered through a transition (e.g. when\nusing the link-to Handlebars helper or the transitionTo method\nof routes), and a model context is already provided this hook\nis not called.

\n

A model context does not include a primitive string or number,\nwhich does cause the model hook to be called.

\n

Routes without dynamic segments will always execute the model hook.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
// no dynamic segment, model hook always called\nthis.transitionTo('posts');\n\n// model passed in, so model hook not called\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost);\n\n// integer passed in, model hook is called\nthis.transitionTo('post', 1);\n\n// model id passed in, model hook is called\n// useful for forcing the hook to execute\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost.id);
\n
\n
\n \n

This hook follows the asynchronous/promise semantics\ndescribed in the documentation for beforeModel. In particular,\nif a promise returned from model fails, the error will be\nhandled by the error hook on Route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model(params) {\n    return this.store.findRecord('post', params.post_id);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "model", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route. If\n a promise is returned, the transition will pause until\n the promise resolves, and the resolved value of the promise\n will be used as the model for this route.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1470, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "deserialize", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route.\n\nRouter.js hook.", + "type": "Any | Promise" + }, + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1483, + "itemtype": "method", + "name": "findModel", + "params": [ + { + "name": "type", + "description": "the model type", + "type": "String" + }, + { + "name": "value", + "description": "the value passed to find", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1494, + "description": "

A hook you can use to setup the controller for the current route.

\n

This method is called with the controller for the current route and the\nmodel supplied by the model hook.

\n

By default, the setupController hook sets the model property of\nthe controller to the specified model when it is not undefined.

\n

If you implement the setupController hook in your Route, it will\nprevent this default behavior. If you want to preserve that behavior\nwhen implementing your setupController function, make sure to call\nsuper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/photos.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PhotosRoute extends Route {\n  model() {\n    return this.store.findAll('photo');\n  }\n\n  setupController(controller, model) {\n    super.setupController(controller, model);\n\n    this.controllerFor('application').set('showingPhotos', true);\n  }\n}
\n
\n
\n \n

The provided controller will be one resolved based on the name\nof this route.

\n

If no explicit controller is defined, Ember will automatically create one.

\n

As an example, consider the router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

If you have defined a file for the post controller,\nthe framework will use it.\nIf it is not defined, a basic Controller instance would be used.

\n", + "example": [ + " Behavior of a basic Controller\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, model) {\n controller.set('model', model);\n }\n});\n```" + ], + "itemtype": "method", + "name": "setupController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "model", + "description": "", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition", + "optional": true + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1570, + "description": "

Returns the controller of the current route, or a parent (or any ancestor)\nroute in a route hierarchy.

\n

The controller instance must already have been created, either through entering the\nassociated route or using generateController.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.controllerFor('posts').set('currentPost', post);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "controllerFor", + "params": [ + { + "name": "name", + "description": "the name of the route or controller", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Controller | undefined" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1624, + "description": "

Generates a controller for a route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class Post extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.generateController('posts');\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "generateController", + "params": [ + { + "name": "name", + "description": "the name of the controller", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1652, + "description": "

Returns the resolved model of a parent (or any ancestor) route\nin a route hierarchy. During a transition, all routes\nmust resolve a model object, and if a route\nneeds access to a parent route's model in order to\nresolve a model (or just reuse the model from a parent),\nit can call this.modelFor(theNameOfParentRoute) to\nretrieve it. If the ancestor route's model was a promise,\nits resolved result is returned.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' }, function() {\n    this.route('comments');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post/comments.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostCommentsRoute extends Route {\n  model() {\n    let post = this.modelFor('post');\n\n    return post.comments;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "modelFor", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "the model object", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1724, + "description": "

this[RENDER] is used to render a template into a region of another template\n(indicated by an {{outlet}}).

\n", + "itemtype": "method", + "name": "this[RENDER]", + "params": [ + { + "name": "name", + "description": "the name of the template to render", + "type": "String" + }, + { + "name": "options", + "description": "the options", + "type": "Object", + "optional": true, + "props": [ + { + "name": "into", + "description": "the template to render into,\n referenced by name. Defaults to the parent template", + "type": "String", + "optional": true + }, + { + "name": "outlet", + "description": "the outlet inside `options.into` to render into.\n Defaults to 'main'", + "type": "String", + "optional": true + }, + { + "name": "controller", + "description": "the controller to use for this template,\n referenced by name or as a controller instance. Defaults to the Route's paired controller", + "type": "String|Object", + "optional": true + }, + { + "name": "model", + "description": "the model object to set on `options.controller`.\n Defaults to the return value of the Route's model hook", + "type": "Object", + "optional": true + } + ] + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1751, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "teardownViews", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1764, + "description": "

Allows you to produce custom metadata for the route.\nThe return value of this method will be attached to\nits corresponding RouteInfoWithAttributes object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostsIndexRoute extends Route {\n  buildRouteInfoMetadata() {\n    return { title: 'Posts Page' }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service router\n\n  constructor() {\n    super(...arguments);\n\n    this.router.on('routeDidChange', transition => {\n      document.title = transition.to.metadata.title;\n      // would update document's title to "Posts Page"\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "buildRouteInfoMetadata", + "return": { + "description": "any" + }, + "since": "3.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2020, + "description": "

Sends an action to the router, which will delegate it to the currently\nactive route hierarchy per the bubbling rules explained under actions.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  track(arg) {\n    console.log(arg, 'was clicked');\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  trackIfDebug(arg) {\n    if (debug) {\n      this.send('track', arg);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "name", + "description": "the name of the action to trigger", + "type": "String" + }, + { + "name": "args", + "description": "", + "type": "...*" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2436, + "description": "

This action is called when one or more query params have changed. Bubbles.

\n", + "itemtype": "method", + "name": "queryParamsDidChange", + "params": [ + { + "name": "changed", + "description": "Keys are names of query params that have changed.", + "type": "Object" + }, + { + "name": "totalPresent", + "description": "Keys are names of query params that are currently set.", + "type": "Object" + }, + { + "name": "removed", + "description": "Keys are names of query params that have been removed.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 95, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 121, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 142, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 165, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 180, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 96, + "description": "

The willTransition action 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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ContactFormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData')) {\n      this.controller.displayNavigationConfirm();\n      transition.abort();\n    }\n  }\n}
\n
\n
\n \n

You can also redirect elsewhere by calling\nthis.transitionTo('elsewhere') from within willTransition.\nNote that willTransition will not be fired for the\nredirecting transitionTo, since willTransition doesn't\nfire when there is already a transition underway. If you want\nsubsequent willTransition actions to fire for the redirecting\ntransition, you must first explicitly call\ntransition.abort().

\n

To allow the willTransition event to continue bubbling to the parent\nroute, use return true;. When the willTransition method has a\nreturn value of true then the parent route's willTransition method\nwill be fired, enabling "bubbling" behavior for the event.

\n", + "itemtype": "event", + "name": "willTransition", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 141, + "description": "

The didTransition action is fired after a transition has\nsuccessfully been completed. This occurs after the normal model\nhooks (beforeModel, model, afterModel, setupController)\nhave resolved. The didTransition action has no arguments,\nhowever, it can be useful for tracking page views or resetting\nstate on the controller.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/login.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class LoginRoute extends Route {\n  @action\n  didTransition() {\n    this.controller.get('errors.base').clear();\n    return true; // Bubble the didTransition event\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "didTransition", + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 168, + "description": "

The loading action is fired on the route when a route's model\nhook returns a promise that is not already resolved. The current\nTransition object is the first parameter and the route that\ntriggered the loading event is the second parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  loading(transition, route) {\n    let controller = this.controllerFor('foo');\n\n    // The controller may not be instantiated when initially loading\n    if (controller) {\n      controller.currentlyLoading = true;\n\n      transition.finally(function() {\n        controller.currentlyLoading = false;\n      });\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "loading", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + }, + { + "name": "route", + "description": "The route that triggered the loading event", + "type": "Route" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 203, + "description": "

When attempting to transition into a route, any of the hooks\nmay return a promise that rejects, at which point an error\naction will be fired on the partially-entered routes, allowing\nfor per-route error handling logic, or shared error handling\nlogic defined on a parent route.

\n

Here is an example of an error handler that will be invoked\nfor rejected promises from the various hooks on the route,\nas well as any unhandled errors from child routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/admin.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { reject } from 'rsvp';\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class AdminRoute extends Route {\n  beforeModel() {\n    return reject('bad things!');\n  }\n\n  @action\n  error(error, transition) {\n    // Assuming we got here due to the error in `beforeModel`,\n    // we can expect that error === "bad things!",\n    // but a promise model rejecting would also\n    // call this hook, as would any errors encountered\n    // in `afterModel`.\n\n    // The `error` hook is also provided the failed\n    // `transition`, which can be stored and later\n    // `.retry()`d if desired.\n\n    this.transitionTo('login');\n  }\n}
\n
\n
\n \n

error actions that bubble up all the way to ApplicationRoute\nwill fire a default error handler that logs the error. You can\nspecify your own global default error handler by overriding the\nerror handler on ApplicationRoute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  error(error, transition) {\n    this.controllerFor('banner').displayError(error.message);\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "error", + "params": [ + { + "name": "error", + "description": "", + "type": "Error" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 816, + "description": "

This event is triggered when the router enters the route. It is\nnot executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  collectAnalytics: on('activate', function(){\n    collectAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "activate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 836, + "description": "

This event is triggered when the router completely exits this\nroute. It is not executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  trackPageLeaveAnalytics: on('deactivate', function(){\n    trackPageLeaveAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "deactivate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 378, + "description": "

Configuration hash for this route's queryParams. The possible\nconfiguration options and their defaults are as follows\n(assuming a query param whose controller property is page):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
queryParams = {\n  page: {\n    // By default, controller query param properties don't\n    // cause a full transition when they are changed, but\n    // rather only cause the URL to update. Setting\n    // `refreshModel` to true will cause an "in-place"\n    // transition to occur, whereby the model hooks for\n    // this route (and any child routes) will re-fire, allowing\n    // you to reload models (e.g., from the server) using the\n    // updated query param values.\n    refreshModel: false,\n\n    // By default, changes to controller query param properties\n    // cause the URL to update via `pushState`, which means an\n    // item will be added to the browser's history, allowing\n    // you to use the back button to restore the app to the\n    // previous state before the query param property was changed.\n    // Setting `replace` to true will use `replaceState` (or its\n    // hash location equivalent), which causes no browser history\n    // item to be added. This options name and default value are\n    // the same as the `link-to` helper's `replace` option.\n    replace: false,\n\n    // By default, the query param URL key is the same name as\n    // the controller property name. Use `as` to specify a\n    // different URL key.\n    as: 'page'\n  }\n};
\n
\n
\n \n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 431, + "description": "

The name of the template to use by default when rendering this route's\ntemplate.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/list.js
1\n2\n3\n4\n5\n
import Route from '@ember/routing/route';\n\nexport default class PostsListRoute extends Route {\n  templateName = 'posts/list';\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n
import PostsListRoute from '../posts/list';\n\nexport default class PostsIndexRoute extends PostsListRoute {};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/archived.js
1\n2\n3\n
import PostsListRoute from '../posts/list';\n\nexport default class PostsArchivedRoute extends PostsListRoute {};
\n
\n
\n \n", + "itemtype": "property", + "name": "templateName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 464, + "description": "

The name of the controller to associate with this route.

\n

By default, Ember will lookup a route's controller that matches the name\nof the route (i.e. posts.new). However,\nif you would like to define a specific controller to use, you can do so\nusing this property.

\n

This is useful in many ways, as the controller specified will be:

\n
    \n
  • passed to the setupController method.
  • \n
  • used as the controller for the template being rendered by the route.
  • \n
  • returned from a call to controllerFor for the route.
  • \n
\n", + "itemtype": "property", + "name": "controllerName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 487, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 518, + "description": "

The name of the route, dot-delimited.

\n

For example, a route found at app/routes/posts/post.js will have\na routeName of posts.post.

\n", + "itemtype": "property", + "name": "routeName", + "type": "String", + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 532, + "description": "

The name of the route, dot-delimited, including the engine prefix\nif applicable.

\n

For example, a route found at addon/routes/posts/post.js within an\nengine named admin will have a fullRouteName of admin.posts.post.

\n", + "itemtype": "property", + "name": "fullRouteName", + "type": "String", + "since": "2.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 596, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_activeQPChanged", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 737, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_optionsForQueryParam", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1815, + "description": "

Store property provides a hook for data persistence libraries to inject themselves.

\n

By default, this store property provides the exact same functionality previously\nin the model hook.

\n

Currently, the required interface is:

\n

store.find(modelName, findArguments)

\n", + "itemtype": "property", + "name": "store", + "type": "{Object}", + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1881, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_qp", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2405, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-RouteInfo-99a9923366.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-RouteInfo-99a9923366.json new file mode 100644 index 000000000..ef22734e7 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-RouteInfo-99a9923366.json @@ -0,0 +1,171 @@ +{ + "data": { + "id": "ember-4.6.0-RouteInfo", + "type": "class", + "attributes": { + "name": "RouteInfo", + "shortname": "RouteInfo", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 124, + "description": "

A RouteInfo is an object that contains metadata\nabout a specific route within a Transition. It is\nread-only and internally immutable. It is also not\nobservable, because a Transition instance is never\nchanged after creation.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 198, + "description": "

Allows you to traverse through the linked list\nof RouteInfos from the topmost to leafmost.\nReturns the first RouteInfo in the linked list\nfor which the callback returns true.

\n

This method is similar to the find() method\n defined in ECMAScript 2015.

\n

The callback method you provide should have the\n following signature (all parameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in\n the results, false otherwise.

\n

Note that in addition to a callback, you can also\n pass an optional target object that will be set as\n this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 135, + "description": "

The dot-separated, fully-qualified name of the\nroute, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 142, + "description": "

The final segment of the fully-qualified name of\nthe route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 149, + "description": "

The values of the route's parameters. These are the\nsame params that are received as arguments to the\nroute's model hook. Contains only the parameters\nvalid for this route, if any (params for parent or\nchild routes are not merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 159, + "description": "

The ordered list of the names of the params\nrequired for this route. It will contain the same\nstrings as Object.keys(params), but here the order\nis significant. This allows users to correctly pass\nparams into routes programmatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 169, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 175, + "description": "

Will contain the result Route#buildRouteInfoMetadata\nfor the corresponding Route.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 182, + "description": "

A reference to the parent route's RouteInfo.\nThis can be used to traverse upward to the topmost\nRouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 190, + "description": "

A reference to the child route's RouteInfo.\nThis can be used to traverse downward to the\nleafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-RouteInfoWithAttributes-9e46f38d8b.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-RouteInfoWithAttributes-9e46f38d8b.json new file mode 100644 index 000000000..2630d466b --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-RouteInfoWithAttributes-9e46f38d8b.json @@ -0,0 +1,183 @@ +{ + "data": { + "id": "ember-4.6.0-RouteInfoWithAttributes", + "type": "class", + "attributes": { + "name": "RouteInfoWithAttributes", + "shortname": "RouteInfoWithAttributes", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 7, + "description": "

A RouteInfoWithAttributes is an object that contains\nmetadata, including the resolved value from the routes\nmodel hook. Like RouteInfo, a RouteInfoWithAttributes\nrepresents a specific route within a Transition.\nIt is read-only and internally immutable. It is also not\nobservable, because a Transition instance is never\nchanged after creation.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 90, + "description": "

Allows you to traverse through the linked list\nof RouteInfos from the topmost to leafmost.\nReturns the first RouteInfo in the linked list\nfor which the callback returns true.

\n

This method is similar to the find() method\n defined in ECMAScript 2015.

\n

The callback method you provide should have the\n following signature (all parameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in\n the results, false otherwise.

\n

Note that in addition to a callback, you can also\n pass an optional target object that will be set as\n this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 20, + "description": "

The dot-separated, fully-qualified name of the\nroute, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 27, + "description": "

The final segment of the fully-qualified name of\nthe route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 34, + "description": "

The values of the route's parameters. These are the\nsame params that are received as arguments to the\nroute's model hook. Contains only the parameters\nvalid for this route, if any (params for parent or\nchild routes are not merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 44, + "description": "

The ordered list of the names of the params\nrequired for this route. It will contain the same\nstrings as Object.keys(params), but here the order\nis significant. This allows users to correctly pass\nparams into routes programmatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 54, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 60, + "description": "

This is the resolved return value from the\nroute's model hook.

\n", + "itemtype": "property", + "name": "attributes", + "type": "Object|Array|String|undefined", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 67, + "description": "

Will contain the result Route#buildRouteInfoMetadata\nfor the corresponding Route.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 74, + "description": "

A reference to the parent route's RouteInfo.\nThis can be used to traverse upward to the topmost\nRouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 82, + "description": "

A reference to the child route's RouteInfo.\nThis can be used to traverse downward to the\nleafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-RouterService-21e3fbef62.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-RouterService-21e3fbef62.json new file mode 100644 index 000000000..0a02c3df8 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-RouterService-21e3fbef62.json @@ -0,0 +1,882 @@ +{ + "data": { + "id": "ember-4.6.0-RouterService", + "type": "class", + "attributes": { + "name": "RouterService", + "shortname": "RouterService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 24, + "description": "

The Router service is the public API that provides access to the router.

\n

The immediate benefit of the Router service is that you can inject it into components,\ngiving them a friendly way to initiate transitions and ask questions about the current\nglobal router state.

\n

In this example, the Router service is injected into a component to initiate a transition\nto a dedicated route:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class ExampleComponent extends Component {\n  @service router;\n\n  @action\n  next() {\n    this.router.transitionTo('other.route');\n  }\n}
\n
\n
\n \n

Like any service, it can also be injected into helpers, routes, etc.

\n", + "access": "public", + "tagname": "", + "extends": "Service", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 82, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n

Calling transitionTo from the Router service will cause default query parameter values to be included in the URL.\nThis behavior is different from calling transitionTo on a route or transitionToRoute on a controller.\nSee the Router Service RFC for more info.

\n

In the following example we use the Router service to navigate to a route with a\nspecific model from a Component in the first action, and in the second we trigger\na query-params only transition.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n  @service router;\n\n  @action\n  goToComments(post) {\n    this.router.transitionTo('comments', post);\n  }\n\n  @action\n  fetchMoreComments(latestComment) {\n    this.router.transitionTo({\n      queryParams: { commentsAfter: latestComment }\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 141, + "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

Calling 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 for more info.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class extends Route {\n  beforeModel() {\n    if (!authorized()){\n      this.replaceWith('unauthorized');\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL of the desired destination", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route i.e. an object of params to pass to the destination route", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 180, + "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

In this example, the URL for the author.books route for a given author\nis copied to the clipboard.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

Just like with transitionTo and replaceWith, urlFor can also handle\nquery parameters.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "urlFor", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) for the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the string representing the generated URL", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 253, + "description": "

Returns true if routeName/models/queryParams is the active route, where models and queryParams are optional.\nSee model and\nqueryParams for more information about these arguments.

\n

In the following example, isActive will return true if the current route is /posts.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

Where 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.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used when determining the active route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "true if the provided routeName/models/queryParams are active", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 357, + "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

See RouteInfo for more info.

\n

In the following example recognize is used to verify if a path belongs to our\napplication before transitioning to it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "recognize", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo | null" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 398, + "description": "

Takes a string URL and returns a promise that resolves to a\nRouteInfoWithAttributes 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.

\n", + "itemtype": "method", + "name": "recognizeAndLoad", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 420, + "description": "

You can register a listener for events emitted by this service with .on():

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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
\n \n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 447, + "description": "

You can unregister a listener for events emitted by this service with .off():

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 553, + "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.

\n", + "itemtype": "method", + "name": "refresh", + "params": [ + { + "name": "routeName", + "description": "the route to refresh (along with all child routes)", + "type": "String", + "optional": true + } + ], + "return": { + "description": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 479, + "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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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
\n \n

The 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.

\n", + "itemtype": "event", + "name": "routeWillChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 513, + "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

A good example is sending some analytics when the route has transitioned:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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 \n

routeDidChange will be called after any Route's\ndidTransition\naction has been fired.\nThe updates of properties\ncurrentURL,\ncurrentRouteName\nand\ncurrentRoute\nare completed at the time routeDidChange is called.

\n", + "itemtype": "event", + "name": "routeDidChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 583, + "description": "

Name of the current route.

\n

This property represents the logical name of the route,\n which is dot separated.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentRouteName", + "type": "{String | null}", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 613, + "description": "

Current URL for the application.

\n

This property represents the URL path for this route.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentURL", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 642, + "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

See Location for more information.

\n

To 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\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
\n \n

The following location types are available by default:\nauto, hash, history, none.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 682, + "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

If you change the rootURL in your environment configuration\nlike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\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
\n \n

This property will return /my-root.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 712, + "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

See RouteInfo for more info.

\n

This 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

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/header.js
1\n2\n3\n4\n5\n6\n7\n8\n9\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
\n
\n \n", + "itemtype": "property", + "name": "currentRoute", + "type": "RouteInfo", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-Service", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-Service-5824f3cac9.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-Service-5824f3cac9.json new file mode 100644 index 000000000..a32d4430b --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-Service-5824f3cac9.json @@ -0,0 +1,541 @@ +{ + "data": { + "id": "ember-4.6.0-Service", + "type": "class", + "attributes": { + "name": "Service", + "shortname": "Service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "file": "packages/@ember/service/index.ts", + "line": 87, + "extends": "EmberObject", + "since": "1.10.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.6.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.6.0-RouterService" + } + ] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-String-9cb497fc22.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-String-9cb497fc22.json new file mode 100644 index 000000000..4b6ff9cbe --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-String-9cb497fc22.json @@ -0,0 +1,200 @@ +{ + "data": { + "id": "ember-4.6.0-String", + "type": "class", + "attributes": { + "name": "String", + "shortname": "String", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/string", + "namespace": "", + "file": "packages/@ember/string/index.ts", + "line": 74, + "description": "

Defines string helper methods including string formatting and localization.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/string/index.ts", + "line": 81, + "description": "

Splits a string into separate units separated by spaces, eliminating any\nempty strings in the process.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { w } from '@ember/string';\n\nw("alpha beta gamma").forEach(function(key) {\n  console.log(key);\n});\n\n// > alpha\n// > beta\n// > gamma
\n
\n
\n \n", + "itemtype": "method", + "name": "w", + "params": [ + { + "name": "str", + "description": "The string to split", + "type": "String" + } + ], + "return": { + "description": "array containing the split strings", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 106, + "description": "

Converts a camelized string into all lower case separated by underscores.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { decamelize } from '@ember/string';\n\ndecamelize('innerHTML');          // 'inner_html'\ndecamelize('action_name');        // 'action_name'\ndecamelize('css-class-name');     // 'css-class-name'\ndecamelize('my favorite items');  // 'my favorite items'
\n
\n
\n \n", + "itemtype": "method", + "name": "decamelize", + "params": [ + { + "name": "str", + "description": "The string to decamelize.", + "type": "String" + } + ], + "return": { + "description": "the decamelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 127, + "description": "

Replaces underscores, spaces, or camelCase with dashes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { dasherize } from '@ember/string';\n\ndasherize('innerHTML');                // 'inner-html'\ndasherize('action_name');              // 'action-name'\ndasherize('css-class-name');           // 'css-class-name'\ndasherize('my favorite items');        // 'my-favorite-items'\ndasherize('privateDocs/ownerInvoice';  // 'private-docs/owner-invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "dasherize", + "params": [ + { + "name": "str", + "description": "The string to dasherize.", + "type": "String" + } + ], + "return": { + "description": "the dasherized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 149, + "description": "

Returns the lowerCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { camelize } from '@ember/string';\n\ncamelize('innerHTML');                   // 'innerHTML'\ncamelize('action_name');                 // 'actionName'\ncamelize('css-class-name');              // 'cssClassName'\ncamelize('my favorite items');           // 'myFavoriteItems'\ncamelize('My Favorite Items');           // 'myFavoriteItems'\ncamelize('private-docs/owner-invoice');  // 'privateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "camelize", + "params": [ + { + "name": "str", + "description": "The string to camelize.", + "type": "String" + } + ], + "return": { + "description": "the camelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 172, + "description": "

Returns the UpperCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { classify } from '@ember/string';\n\nclassify('innerHTML');                   // 'InnerHTML'\nclassify('action_name');                 // 'ActionName'\nclassify('css-class-name');              // 'CssClassName'\nclassify('my favorite items');           // 'MyFavoriteItems'\nclassify('private-docs/owner-invoice');  // 'PrivateDocs/OwnerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "classify", + "params": [ + { + "name": "str", + "description": "the string to classify", + "type": "String" + } + ], + "return": { + "description": "the classified string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 194, + "description": "

More general than decamelize. Returns the lower_case_and_underscored\nform of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { underscore } from '@ember/string';\n\nunderscore('innerHTML');                 // 'inner_html'\nunderscore('action_name');               // 'action_name'\nunderscore('css-class-name');            // 'css_class_name'\nunderscore('my favorite items');         // 'my_favorite_items'\nunderscore('privateDocs/ownerInvoice');  // 'private_docs/owner_invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "underscore", + "params": [ + { + "name": "str", + "description": "The string to underscore.", + "type": "String" + } + ], + "return": { + "description": "the underscored string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 217, + "description": "

Returns the Capitalized form of a string

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capitalize } from '@ember/string';\n\ncapitalize('innerHTML')                 // 'InnerHTML'\ncapitalize('action_name')               // 'Action_name'\ncapitalize('css-class-name')            // 'Css-class-name'\ncapitalize('my favorite items')         // 'My favorite items'\ncapitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "capitalize", + "params": [ + { + "name": "str", + "description": "The string to capitalize.", + "type": "String" + } + ], + "return": { + "description": "The capitalized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/string", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/classes/ember-4.6.0-rsvp-b3e736c36a.json b/json-docs/ember/4.6.0/classes/ember-4.6.0-rsvp-b3e736c36a.json new file mode 100644 index 000000000..8cfdd6948 --- /dev/null +++ b/json-docs/ember/4.6.0/classes/ember-4.6.0-rsvp-b3e736c36a.json @@ -0,0 +1,445 @@ +{ + "data": { + "id": "ember-4.6.0-rsvp", + "type": "class", + "attributes": { + "name": "rsvp", + "shortname": "rsvp", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/all-settled.js", + "line": 20, + "description": "

RSVP.allSettled is similar to RSVP.all, but instead of implementing\na fail-fast method, it waits until all the promises have returned and\nshows you all the results. This is useful if you want to handle multiple\npromises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled. The return promise is fulfilled with an array of the states of\nthe promises passed into the promises array argument.

\n

Each state object will either indicate fulfillment or rejection, and\nprovide the corresponding value or reason. The states will take one of\nthe following formats:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{ state: 'fulfilled', value: value }\n  or\n{ state: 'rejected', reason: reason }
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
let promise1 = RSVP.Promise.resolve(1);\nlet promise2 = RSVP.Promise.reject(new Error('2'));\nlet promise3 = RSVP.Promise.reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nRSVP.allSettled(promises).then(function(array){\n  // array == [\n  //   { state: 'fulfilled', value: 1 },\n  //   { state: 'rejected', reason: Error },\n  //   { state: 'rejected', reason: Error }\n  // ]\n  // Note that for the second item, reason.message will be '2', and for the\n  // third item, reason.message will be '3'.\n}, function(error) {\n  // Not run. (This block would only be called if allSettled had failed,\n  // for instance if passed an incorrect argument type.)\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "allSettled", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "entries", + "description": "", + "type": "Array" + }, + { + "name": "label", + "description": "- optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with an array of the settled\nstates of the constituent promises.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/all.js", + "line": 3, + "description": "

This is a convenient alias for Promise.all.

\n", + "itemtype": "method", + "name": "all", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/defer.js", + "line": 3, + "description": "

defer returns an object similar to jQuery's $.Deferred.\ndefer should be used when porting over code reliant on $.Deferred's\ninterface. New code should use the Promise constructor instead.

\n

The object returned from defer is a plain object with three properties:

\n
    \n
  • promise - an Promise.
  • \n
  • reject - a function that causes the promise property on this object to\nbecome rejected
  • \n
  • resolve - a function that causes the promise property on this object to\nbecome fulfilled.
  • \n
\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let deferred = defer();\n\ndeferred.resolve("Success!");\n\ndeferred.promise.then(function(value){\n  // value here is "Success!"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "defer", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 19, + "description": "

EventTarget.mixin extends an object with EventTarget methods. For\nExample:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import EventTarget from 'rsvp';\n\nlet object = {};\n\nEventTarget.mixin(object);\n\nobject.on('finished', function(event) {\n  // handle event\n});\n\nobject.trigger('finished', { detail: value });
\n
\n
\n \n

EventTarget.mixin also works with prototypes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EventTarget from 'rsvp';\n\nlet Person = function() {};\nEventTarget.mixin(Person.prototype);\n\nlet yehuda = new Person();\nlet tom = new Person();\n\nyehuda.on('poke', function(event) {\n  console.log('Yehuda says OW');\n});\n\ntom.on('poke', function(event) {\n  console.log('Tom says OW');\n});\n\nyehuda.trigger('poke');\ntom.trigger('poke');
\n
\n
\n \n", + "itemtype": "method", + "name": "mixin", + "access": "private", + "tagname": "", + "params": [ + { + "name": "object", + "description": "object to extend with EventTarget methods", + "type": "Object" + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 107, + "description": "

You can use off to stop firing a particular callback for an event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function doStuff() { // do stuff! }\nobject.on('stuff', doStuff);\n\nobject.trigger('stuff'); // doStuff will be called\n\n// Unregister ONLY the doStuff callback\nobject.off('stuff', doStuff);\nobject.trigger('stuff'); // doStuff will NOT be called
\n
\n
\n \n

If you don't pass a callback argument to off, ALL callbacks for the\nevent will not be executed when the event fires. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let callback1 = function(){};\nlet callback2 = function(){};\n\nobject.on('stuff', callback1);\nobject.on('stuff', callback2);\n\nobject.trigger('stuff'); // callback1 and callback2 will be executed.\n\nobject.off('stuff');\nobject.trigger('stuff'); // callback1 and callback2 will not be executed!
\n
\n
\n \n", + "itemtype": "method", + "name": "off", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "event to stop listening to", + "type": "String" + }, + { + "name": "callback", + "description": "optional argument. If given, only the function\ngiven will be removed from the event's callback queue. If no `callback`\nargument is given, all callbacks will be removed from the event's callback\nqueue.", + "type": "Function", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 162, + "description": "

Use trigger to fire custom events. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
object.on('foo', function(){\n  console.log('foo event happened!');\n});\nobject.trigger('foo');\n// 'foo event happened!' logged to the console
\n
\n
\n \n

You can also pass a value as a second argument to trigger that will be\npassed as an argument to all event listeners for the event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
object.on('foo', function(value){\n  console.log(value.name);\n});\n\nobject.trigger('foo', { name: 'bar' });\n// 'bar' logged to the console
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "name of the event to be triggered", + "type": "String" + }, + { + "name": "options", + "description": "optional value to be passed to any event handlers for\nthe given `eventName`", + "type": "*", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/filter.js", + "line": 42, + "description": "

filter is similar to JavaScript's native filter method.\nfilterFn is eagerly called meaning that as soon as any promise\n resolves its value will be passed to filterFn. filter returns\n a promise that will become fulfilled with the result of running\n filterFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { filter, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\n\nlet promises = [promise1, promise2, promise3];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(result){\n  // result is [ 2, 3 ]\n});
\n
\n
\n \n

If any of the promises given to filter are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { filter, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

filter will also wait for any promises returned from filterFn.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter, resolve } from 'rsvp';\n\nlet alice = { name: 'alice' };\nlet bob   = { name: 'bob' };\nlet users = [ alice, bob ];\n\nlet promises = users.map(function(user){\n  return resolve(user);\n});\n\nlet filterFn = function(user){\n  // Here, Alice has permissions to create a blog post, but Bob does not.\n  return getPrivilegesForUser(user).then(function(privs){\n    return privs.can_create_blog_post === true;\n  });\n};\nfilter(promises, filterFn).then(function(users){\n  // true, because the server told us only Alice can create a blog post.\n  users.length === 1;\n  // false, because Alice is the only user present in `users`\n  users[0] === bob;\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "filterFn", + "description": "- function to be called on each resolved value to\n filter the final results.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string describing the promise. Useful for\n tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash-settled.js", + "line": 16, + "description": "

hashSettled is similar to allSettled, but takes an object\ninstead of an array for its promises argument.

\n

Unlike all or hash, which implement a fail-fast method,\nbut like allSettled, hashSettled waits until all the\nconstituent promises have returned and then shows you all the results\nwith their states and values/reasons. This is useful if you want to\nhandle multiple promises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled, or rejected if the passed parameters are invalid.

\n

The returned promise is fulfilled with a hash that has the same key names as\nthe promises object argument. If any of the values in the object are not\npromises, they will be copied over to the fulfilled object and marked with state\n'fulfilled'.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: { state: 'fulfilled', value: 1 },\n  //   yourPromise: { state: 'fulfilled', value: 2 },\n  //   theirPromise: { state: 'fulfilled', value: 3 },\n  //   notAPromise: { state: 'fulfilled', value: 4 }\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the state will\nbe set to 'rejected' and the reason for rejection provided.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, reject, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejection')),\n  anotherRejectedPromise: reject(new Error('more rejection')),\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise:              { state: 'fulfilled', value: 1 },\n  //   rejectedPromise:        { state: 'rejected', reason: Error },\n  //   anotherRejectedPromise: { state: 'rejected', reason: Error },\n  // }\n  // Note that for rejectedPromise, reason.message == 'rejection',\n  // and for anotherRejectedPromise, reason.message == 'more rejection'.\n});
\n
\n
\n \n

An important note: hashSettled is intended for plain JavaScript objects that\nare just a set of keys and values. hashSettled will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import Promise, { hashSettled, resolve } from 'rsvp';\n\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: Promise.resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhashSettled(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: { state: 'fulfilled', value: 'Example' }\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hashSettled", + "access": "public", + "tagname": "", + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when when all properties of `promises`\nhave been settled.", + "type": "Promise" + }, + "static": 1, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash.js", + "line": 4, + "description": "

hash is similar to all, but takes an object instead of an array\nfor its promises argument.

\n

Returns a promise that is fulfilled when all the given promises have been\nfulfilled, or rejected if any of them become rejected. The returned promise\nis fulfilled with a hash that has the same key names as the promises object\nargument. If any of the values in the object are not promises, they will\nsimply be copied over to the fulfilled object.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhash(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: 1,\n  //   yourPromise: 2,\n  //   theirPromise: 3,\n  //   notAPromise: 4\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the first promise\nthat is rejected will be given as the reason to the rejection handler.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejectedPromise')),\n  anotherRejectedPromise: reject(new Error('anotherRejectedPromise')),\n};\n\nhash(promises).then(function(hash){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === 'rejectedPromise'\n});
\n
\n
\n \n

An important note: hash is intended for plain JavaScript objects that\nare just a set of keys and values. hash will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { hash, resolve } from 'rsvp';\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhash(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: 'Example'\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all properties of `promises`\nhave been fulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/map.js", + "line": 39, + "description": "

map is similar to JavaScript's native map method. mapFn is eagerly called\n meaning that as soon as any promise resolves its value will be passed to mapFn.\n map returns a promise that will become fulfilled with the result of running\n mapFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(result){\n  // result is [ 2, 3, 4 ]\n});
\n
\n
\n \n

If any of the promises given to map are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { map, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

map will also wait if a promise is returned from mapFn. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first because they contain a url to those comments.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map } from 'rsvp';\n\nlet mapFn = function(blogPost){\n  // getComments does some ajax and returns an Promise that is fulfilled\n  // with some comments data\n  return getComments(blogPost.comments_url);\n};\n\n// getBlogPosts does some ajax and returns an Promise that is fulfilled\n// with some blog post data\nmap(getBlogPosts(), mapFn).then(function(comments){\n  // comments is the result of asking the server for the comments\n  // of all blog posts returned from getBlogPosts()\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "mapFn", + "description": "function to be called on each fulfilled promise.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\n Useful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/node.js", + "line": 44, + "description": "

denodeify takes a 'node-style' function and returns a function that\nwill return an Promise. You can use denodeify in Node.js or the\nbrowser when you'd prefer to use promises over using callbacks. For example,\ndenodeify transforms the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) return handleError(err);\n  handleData(data);\n});
\n
\n
\n \n

into:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\n\nreadFile('myfile.txt').then(handleData, handleError);
\n
\n
\n \n

If the node function has multiple success parameters, then denodeify\njust returns the first one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let request = denodeify(require('request'));\n\nrequest('http://example.com').then(function(res) {\n  // ...\n});
\n
\n
\n \n

However, if you need all success parameters, setting denodeify's\nsecond parameter to true causes it to return all success parameters\nas an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), true);\n\nrequest('http://example.com').then(function(result) {\n  // result[0] -> res\n  // result[1] -> body\n});
\n
\n
\n \n

Or if you pass it an array with names it returns the parameters as a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), ['res', 'body']);\n\nrequest('http://example.com').then(function(result) {\n  // result.res\n  // result.body\n});
\n
\n
\n \n

Sometimes you need to retain the this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let app = require('express')();\nlet render = denodeify(app.render.bind(app));
\n
\n
\n \n

The denodified function inherits from the original function. It works in all\nenvironments, except IE 10 and below. Consequently all properties of the original\nfunction are available to you. However, any properties you change on the\ndenodeified function won't be changed on the original function. Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request')),\n    cookieJar = request.jar(); // <- Inheritance is used here\n\nrequest('http://example.com', {jar: cookieJar}).then(function(res) {\n  // cookieJar.cookies holds now the cookies returned by example.com\n});
\n
\n
\n \n

Using denodeify makes it easier to compose asynchronous operations instead\nof using callbacks. For example, instead of:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) { ... } // Handle error\n  fs.writeFile('myfile2.txt', data, function(err){\n    if (err) { ... } // Handle error\n    console.log('done')\n  });\n});
\n
\n
\n \n

you can chain the operations together using then from the returned promise:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\nlet writeFile = denodeify(fs.writeFile);\n\nreadFile('myfile.txt').then(function(data){\n  return writeFile('myfile2.txt', data);\n}).then(function(){\n  console.log('done')\n}).catch(function(error){\n  // Handle error\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "denodeify", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "nodeFunc", + "description": "a 'node-style' function that takes a callback as\nits last argument. The callback expects an error to be passed as its first\nargument (if an error occurred, otherwise null), and the value from the\noperation as its second argument ('function(err, value){ }').", + "type": "Function" + }, + { + "name": "options", + "description": "An optional paramter that if set\nto `true` causes the promise to fulfill with the callback's success arguments\nas an array. This is useful if the node function has multiple success\nparamters. If you set this paramter to an array with names, the promise will\nfulfill with a hash with these names as keys and the success parameters as\nvalues.", + "type": "Boolean|Array", + "optional": true + } + ], + "return": { + "description": "a function that wraps `nodeFunc` to return a `Promise`", + "type": "Function" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/race.js", + "line": 3, + "description": "

This is a convenient alias for Promise.race.

\n", + "itemtype": "method", + "name": "race", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/reject.js", + "line": 3, + "description": "

This is a convenient alias for Promise.reject.

\n", + "itemtype": "method", + "name": "reject", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/resolve.js", + "line": 3, + "description": "

This is a convenient alias for Promise.resolve.

\n", + "itemtype": "method", + "name": "resolve", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "value", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/rethrow.js", + "line": 1, + "description": "

rethrow will rethrow an error on the next turn of the JavaScript event\nloop in order to aid debugging.

\n

Promises A+ specifies that any exceptions that occur with a promise must be\ncaught by the promises implementation and bubbled to the last handler. For\nthis reason, it is recommended that you always specify a second rejection\nhandler function to then. However, rethrow will throw the exception\noutside of the promise, so it bubbles up to your console if in the browser,\nor domain/cause uncaught exception in Node. rethrow will also throw the\nerror again so the error can be handled by the promise per the spec.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { rethrow } from 'rsvp';\n\nfunction throws(){\n  throw new Error('Whoops!');\n}\n\nlet promise = new Promise(function(resolve, reject){\n  throws();\n});\n\npromise.catch(rethrow).then(function(){\n  // Code here doesn't run because the promise became rejected due to an\n  // error!\n}, function (err){\n  // handle the error here\n});
\n
\n
\n \n

The 'Whoops' error will be thrown on the next turn of the event loop\nand you can watch for it in your console. You can also handle it using a\nrejection handler given to .then or .catch on the returned promise.

\n", + "itemtype": "method", + "name": "rethrow", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "reason the promise became rejected.", + "type": "Error" + } + ], + "throws": { + "description": "Error" + }, + "class": "rsvp", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/modules/ember-4.6.0-@ember/component-0a38d32f9f.json b/json-docs/ember/4.6.0/modules/ember-4.6.0-@ember/component-0a38d32f9f.json new file mode 100644 index 000000000..21621ad25 --- /dev/null +++ b/json-docs/ember/4.6.0/modules/ember-4.6.0-@ember/component-0a38d32f9f.json @@ -0,0 +1,89 @@ +{ + "data": { + "id": "ember-4.6.0-@ember/component", + "type": "module", + "attributes": { + "name": "@ember/component", + "submodules": {}, + "elements": {}, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/component": 1, + "Ember.Templates.components": 1, + "@ember/component/helper": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 47, + "description": "

Glimmer is a templating engine used by Ember.js that is compatible with a subset of the Handlebars syntax.

\n

Showing a property

\n

Templates manage the flow of an application's UI, and display state (through\nthe DOM) to a user. For example, given a component with the property "name",\nthat component's template can use the name in several ways:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  name: 'Jill'\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
{{this.name}}\n<div>{{this.name}}</div>\n<span data-name={{this.name}}></span>
\n
\n
\n \n

Any time the "name" property on the component changes, the DOM will be\nupdated.

\n

Properties can be chained as well:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{@aUserModel.name}}\n<div>{{@listOfUsers.firstObject.name}}</div>
\n
\n
\n \n

Using Ember helpers

\n

When content is passed in mustaches {{}}, Ember will first try to find a helper\nor component with that name. For example, the if helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
{{if this.name "I have a name" "I have no name"}}\n<span data-has-name={{if this.name true}}></span>
\n
\n
\n \n

The returned value is placed where the {{}} is called. The above style is\ncalled "inline". A second style of helper usage is called "block". For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#if this.name}}\n  I have a name\n{{else}}\n  I have no name\n{{/if}}
\n
\n
\n \n

The block form of helpers allows you to control how the UI is created based\non the values of properties.\nA third form of helper is called "nested". For example here the concat\nhelper will add " Doe" to a displayed name if the person has no last name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<span data-name={{concat this.firstName (\n  if this.lastName (concat " " this.lastName) "Doe"\n)}}></span>
\n
\n
\n \n

Ember's built-in helpers are described under the Ember.Templates.helpers\nnamespace. Documentation on creating custom helpers can be found under\nhelper (or\nunder Helper if a helper requires access to\ndependency injection).

\n

Invoking a Component

\n

Ember components represent state to the UI of an application. Further\nreading on components can be found under Component.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "Component", + "Helper" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 269, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "allstaticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 269, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "version": "4.6.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/modules/ember-4.6.0-@glimmer/component-1f8506b268.json b/json-docs/ember/4.6.0/modules/ember-4.6.0-@glimmer/component-1f8506b268.json new file mode 100644 index 000000000..149fe44e9 --- /dev/null +++ b/json-docs/ember/4.6.0/modules/ember-4.6.0-@glimmer/component-1f8506b268.json @@ -0,0 +1,36 @@ +{ + "data": { + "id": "ember-4.6.0-@glimmer/component", + "type": "module", + "attributes": { + "name": "@glimmer/component", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts", + "line": 1, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault components for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Template-only and Glimmer components. If you\nare looking for the API documentation for Classic components, it is\navailable here. The source code for\nGlimmer components can be found in @glimmer/component.

\n

Defining a Template-only Component

\n

The simplest way to create a component is to create a template file in\napp/templates/components. For example, if you name a template\napp/templates/components/person-profile.hbs:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
<h1>{{@person.name}}</h1>\n<img src={{@person.avatar}}>\n<p class='signature'>{{@person.signature}}</p>
\n
\n
\n \n

You will be able to use <PersonProfile /> to invoke this component elsewhere\nin your application:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<PersonProfile @person={{this.currentUser}} />
\n
\n
\n \n

Note that component names are capitalized here in order to distinguish them\nfrom regular HTML elements, but they are dasherized in the file system.

\n

While the angle bracket invocation form is generally preferred, it is also\npossible to invoke the same component with the {{person-profile}} syntax:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person-profile person=this.currentUser}}
\n
\n
\n \n

Note that with this syntax, you use dashes in the component name and\narguments are passed without the @ sign.

\n

In both cases, Ember will render the content of the component template we\ncreated above. The end result will be something like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\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 \n

File System Nesting

\n

Components can be nested inside sub-folders for logical groupping. For\nexample, if we placed our template in\napp/templates/components/person/short-profile.hbs, we can invoke it as\n<Person::ShortProfile />:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Person::ShortProfile @person={{this.currentUser}} />
\n
\n
\n \n

Or equivalently, {{person/short-profile}}:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person/short-profile person=this.currentUser}}
\n
\n
\n \n

Using Blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield}}
\n
\n
\n \n

We could then invoke it like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}}>\n  <p>Admin mode</p>\n</PersonProfile>
\n
\n
\n \n

or with curly syntax like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-profile person=this.currentUser}}\n  <p>Admin mode</p>\n{{/person-profile}}
\n
\n
\n \n

And 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

Blocks are executed in their original context, meaning they have access to the\nscope and any in-scope variables where they were defined.

\n

Passing parameters to blocks

\n

You can also pass positional parameters to {{yield}}, which are then made\navailable in the block:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

We can then use this value in the block like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}} as |signature|>\n  {{signature}}\n</PersonProfile>
\n
\n
\n \n

Passing multiple blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield to="title"}}</h1>\n{{yield}}
\n
\n
\n \n

This component could then be invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title>{{this.currentUser.name}}</:title>\n  <:default>{{this.currentUser.signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

When 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

Passing parameters to named blocks

\n

You can also pass parameters to named blocks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield @person.name to="title"}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

These parameters can then be used like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title as |name|>{{name}}</:title>\n  <:default as |signature|>{{signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

Checking to see if a block exists

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\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
\n \n

With this template, we can then optionally pass in one block, both blocks, or\nnone at all:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\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 \n

Checking to see if a block has parameters

\n

We can also check if a block receives parameters using the (has-block-params)\nkeyword, and conditionally yield different values if so.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
{{#if (has-block-params)}}\n  {{yield @person.signature}}\n{{else}}\n  {{yield}}\n{{/if}}
\n
\n
\n \n

Customizing Components With JavaScript

\n

To 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\nPersonProfile component which we defined above, we would create\napp/components/person-profile.js and export our class as the default, like\nso:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n \n

You 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\ndisplayName property of our PersonProfile component instance in the\ntemplate like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

constructor

\n

params: owner object and args object

\n

Constructs 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import 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
\n \n

Service injections and arguments are available in the constructor.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import 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 \n

willDestroy

\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import 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 \n

args

\n

The args property of Glimmer components is an object that contains the\narguments that are passed to the component. For instance, the\nfollowing component usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @fadeIn={{true}} />
\n
\n
\n \n

Would result in the following args object to be passed to the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ fadeIn: true }
\n
\n
\n \n

args can be accessed at any point in the component lifecycle, including\nconstructor and willDestroy. They are also automatically marked as tracked\nproperties, and they can be depended on as computed property dependencies:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import 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 \n

isDestroying

\n

A boolean flag to tell if the component is in the process of destroying. This is set to\ntrue before willDestroy is called.

\n

isDestroyed

\n

A boolean to tell if the component has been fully destroyed. This is set to true\nafter willDestroy is called.

\n", + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "4.6.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/namespaces/ember-4.6.0-AutoLocation-10efd26d10.json b/json-docs/ember/4.6.0/namespaces/ember-4.6.0-AutoLocation-10efd26d10.json new file mode 100644 index 000000000..7dd369c2f --- /dev/null +++ b/json-docs/ember/4.6.0/namespaces/ember-4.6.0-AutoLocation-10efd26d10.json @@ -0,0 +1,129 @@ +{ + "data": { + "id": "ember-4.6.0-AutoLocation", + "type": "namespace", + "attributes": { + "name": "AutoLocation", + "shortname": "AutoLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 22, + "description": "

AutoLocation will select the best location option based off browser\nsupport with the priority order: history, hash, none.

\n

Clean pushState paths accessed by hashchange-only browsers will be redirected\nto the hash-equivalent and vice versa so future transitions are consistent.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n

Browsers that support the history API will use HistoryLocation, those that\ndo not, but still support the hashchange event will use HashLocation, and\nin the rare case neither is supported will use NoneLocation.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'auto'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new for modern browsers that\nsupport the history api or /#/posts/new for older ones, like Internet\nExplorer 9 and below.

\n

When a user visits a link to your application, they will be automatically\nupgraded or downgraded to the appropriate Location class, with the URL\ntransformed accordingly, if needed.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n", + "static": 1, + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 354, + "access": "private", + "tagname": "Returns the current path as it should appear for HashLocation supported\nbrowsers. This may very well differ from the real current path.", + "itemtype": "method", + "name": "_getHashPath", + "class": "AutoLocation", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 80, + "access": "private", + "tagname": "Will be pre-pended to path upon state change.", + "since": "1.5.1", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 92, + "access": "private", + "tagname": "The browser's `location` object. This is typically equivalent to\n`window.location`, but may be overridden for testing.", + "itemtype": "property", + "name": "location", + "default": "environment.location", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 104, + "access": "private", + "tagname": "The browser's `history` object. This is typically equivalent to\n`window.history`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "history", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 117, + "access": "private", + "tagname": "The user agent's global variable. In browsers, this will be `window`.", + "since": "1.11", + "itemtype": "property", + "name": "global", + "default": "window", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 129, + "access": "private", + "tagname": "The browser's `userAgent`. This is typically equivalent to\n`navigator.userAgent`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "userAgent", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 142, + "access": "private", + "tagname": "This property is used by the router to know whether to cancel the routing\nsetup process, which is needed while we redirect the browser.", + "since": "1.5.1", + "itemtype": "property", + "name": "cancelRouterSetup", + "default": "false", + "class": "AutoLocation", + "module": "@ember/routing" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.6.0/namespaces/ember-4.6.0-Instrumentation-caf86426c0.json b/json-docs/ember/4.6.0/namespaces/ember-4.6.0-Instrumentation-caf86426c0.json new file mode 100644 index 000000000..a3a2dd6f1 --- /dev/null +++ b/json-docs/ember/4.6.0/namespaces/ember-4.6.0-Instrumentation-caf86426c0.json @@ -0,0 +1,46 @@ +{ + "data": { + "id": "ember-4.6.0-Instrumentation", + "type": "namespace", + "attributes": { + "name": "Instrumentation", + "shortname": "Instrumentation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/instrumentation", + "namespace": "", + "file": "packages/@ember/instrumentation/index.ts", + "line": 40, + "description": "

The purpose of the Ember Instrumentation module is\nto provide efficient, general-purpose instrumentation\nfor Ember.

\n

Subscribe to a listener by using subscribe:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { subscribe } from '@ember/instrumentation';\n\nsubscribe("render", {\n  before(name, timestamp, payload) {\n\n  },\n\n  after(name, timestamp, payload) {\n\n  }\n});
\n
\n
\n \n

If you return a value from the before callback, that same\nvalue will be passed as a fourth parameter to the after\ncallback.

\n

Instrument a block of code by using instrument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { instrument } from '@ember/instrumentation';\n\ninstrument("render.handlebars", payload, function() {\n  // rendering logic\n}, binding);
\n
\n
\n \n

Event names passed to instrument are namespaced\nby periods, from more general to more specific. Subscribers\ncan listen for events by whatever level of granularity they\nare interested in.

\n

In the above example, the event is render.handlebars,\nand the subscriber listened for all events beginning with\nrender. It would receive callbacks for events named\nrender, render.handlebars, render.container, or\neven render.handlebars.layout.

\n", + "static": 1, + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.6.0-@ember/instrumentation", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.6.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/application-d1527389fe.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/application-d1527389fe.json new file mode 100644 index 000000000..36357b3bb --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/application-d1527389fe.json @@ -0,0 +1,138 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/application", + "type": "class", + "attributes": { + "name": "@ember/application", + "shortname": "@ember/application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 31, + "description": "

Framework objects in an Ember application (components, services, routes, etc.)\nare created via a factory and dependency injection system. Each of these\nobjects is the responsibility of an "owner", which handled its\ninstantiation and manages its lifetime.

\n

getOwner fetches the owner object responsible for an instance. This can\nbe used to lookup or resolve other class instances, or register new factories\ninto the owner.

\n

For example, this component dynamically looks up a service based on the\naudioType passed as an argument:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
audio.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getOwner } from '@ember/application';\n\n// Usage:\n//\n//   <PlayAudio @audioType={{@model.audioType}} @audioFile={{@model.file}}/>\n//\nexport default class extends Component {\n  get audioService() {\n    let owner = getOwner(this);\n    return owner.lookup(`service:${this.args.audioType}`);\n  }\n\n  @action\n  onPlay() {\n    let player = this.audioService;\n    player.play(this.args.audioFile);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "getOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object with an owner.", + "type": "Object" + } + ], + "return": { + "description": "An owner object.", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 79, + "description": "

setOwner forces a new owner on a given object instance. This is primarily\nuseful in some testing cases.

\n", + "itemtype": "method", + "name": "setOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object instance.", + "type": "Object" + }, + { + "name": "object", + "description": "The new owner object of the object instance.", + "type": "Object" + } + ], + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 14, + "description": "

Detects when a specific package of Ember (e.g. 'Application')\nhas fully loaded and is available for extension.

\n

The provided callback will be called with the name passed\nresolved from a string into the object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { onLoad } from '@ember/application';\n\nonLoad('Ember.Application' function(hbars) {\n  hbars.registerHelper(...);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "onLoad", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "callback", + "description": "callback to be called", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 47, + "description": "

Called when an Ember.js package (e.g Application) has finished\nloading. Triggers any callbacks registered for this event.

\n", + "itemtype": "method", + "name": "runLoadHooks", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "object", + "description": "object to pass to callbacks", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/component/helper-85fc6a8f92.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/component/helper-85fc6a8f92.json new file mode 100644 index 000000000..c91da2442 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/component/helper-85fc6a8f92.json @@ -0,0 +1,61 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/component/helper", + "type": "class", + "attributes": { + "name": "@ember/component/helper", + "shortname": "@ember/component/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 269, + "description": "

In many cases it is not necessary to use the full Helper class.\nThe helper method create pure-function helpers without instances.\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n
import { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n  return `${currency}${cents * 0.01}`;\n});
\n
\n
\n \n", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/controller-c5c17907f3.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/controller-c5c17907f3.json new file mode 100644 index 000000000..39c688bba --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/controller-c5c17907f3.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/controller", + "type": "class", + "attributes": { + "name": "@ember/controller", + "shortname": "@ember/controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 20, + "description": "

Creates a property that lazily looks up another controller in the container.\nCan only be used when defining another controller.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default class PostController extends Controller {\n  @controller posts;\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default Controller.extend({\n  posts: controller()\n});
\n
\n
\n \n

This example will create a posts property on the post controller that\nlooks up the posts controller in the container, making it easy to reference\nother controllers.

\n", + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the controller to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/controller", + "module": "@ember/controller" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/debug-63466a1e39.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/debug-63466a1e39.json new file mode 100644 index 000000000..c6efbf295 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/debug-63466a1e39.json @@ -0,0 +1,310 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/debug", + "type": "class", + "attributes": { + "name": "@ember/debug", + "shortname": "@ember/debug", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 918, + "description": "

Allows checking if a given property on an object is a computed property. For the most part,\nthis doesn't matter (you would normally just access the property directly and use its value),\nbut for some tooling specific scenarios (e.g. the ember-inspector) it is important to\ndifferentiate if a property is a computed property or a "normal" property.

\n

This will work on either a class's prototype or an instance itself.

\n", + "static": 1, + "itemtype": "method", + "name": "isComputed", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/object" + }, + { + "file": "packages/@ember/debug/lib/capture-render-tree.ts", + "line": 9, + "description": "

Ember Inspector calls this function to capture the current render tree.

\n

In production mode, this requires turning on ENV._DEBUG_RENDER_TREE\nbefore loading Ember.

\n", + "access": "private", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "captureRenderTree", + "params": [ + { + "name": "app", + "description": "An `ApplicationInstance`.", + "type": "ApplicationInstance" + } + ], + "since": "3.14.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 37, + "description": "

Allows for runtime registration of handler functions that override the default deprecation behavior.\nDeprecations are invoked by calls to @ember/debug/deprecate.\nThe following example demonstrates its usage by registering a handler that throws an error if the\nmessage contains the word "should", otherwise defers to the default handler.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { registerDeprecationHandler } from '@ember/debug';\n\nregisterDeprecationHandler((message, options, next) => {\n  if (message.indexOf('should') !== -1) {\n    throw new Error(`Deprecation message with should: ${message}`);\n  } else {\n    // defer to whatever handler was registered before this one\n    next(message, options);\n  }\n});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the deprecation call.
  • \n
  • options - An object passed in with the deprecation call containing additional information including:
  • \n
      \n
    • id - An id of the deprecation in the form of package-name.specific-deprecation.
    • \n
    • until - The Ember version number the feature and deprecation will be removed in.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerDeprecationHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle deprecation calls.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 182, + "description": "

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only).

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n", + "itemtype": "method", + "name": "deprecate", + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "test", + "description": "A boolean. If falsy, the deprecation will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "", + "type": "Object", + "props": [ + { + "name": "id", + "description": "A unique id for this deprecation. The id can be\n used by Ember debugging tools to change the behavior (raise, log or silence)\n for that specific deprecation. The id should be namespaced by dots, e.g.\n \"view.helper.select\".", + "type": "String" + }, + { + "name": "until", + "description": "The version of Ember when this deprecation\n warning will be removed.", + "type": "String" + }, + { + "name": "for", + "description": "A namespace for the deprecation, usually the package name", + "type": "String" + }, + { + "name": "since", + "description": "Describes when the deprecation became available and enabled.", + "type": "Object" + }, + { + "name": "url", + "description": "An optional url to the transition guide on the\n emberjs.com website.", + "type": "String", + "optional": true + } + ] + } + ], + "static": 1, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 24, + "description": "

Allows for runtime registration of handler functions that override the default warning behavior.\nWarnings are invoked by calls made to @ember/debug/warn.\nThe following example demonstrates its usage by registering a handler that does nothing overriding Ember's\ndefault warning behavior.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { registerWarnHandler } from '@ember/debug';\n\n// next is not called, so no warnings get the default behavior\nregisterWarnHandler(() => {});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the warn call.
  • \n
  • options - An object passed in with the warn call containing additional information including:
  • \n
      \n
    • id - An id of the warning in the form of package-name.specific-warning.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWarnHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle warnings.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 71, + "description": "

Display a warning with the provided message.

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { warn } from '@ember/debug';\nimport tomsterCount from './tomster-counter'; // a module in my project\n\n// Log a warning if we have more than 3 tomsters\nwarn('Too many tomsters!', tomsterCount <= 3, {\n  id: 'ember-debug.too-many-tomsters'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "warn", + "static": 1, + "params": [ + { + "name": "message", + "description": "A warning to display.", + "type": "String" + }, + { + "name": "test", + "description": "An optional boolean. If falsy, the warning\n will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "An object that can be used to pass a unique\n `id` for this warning. The `id` can be used by Ember debugging tools\n to change the behavior (raise, log, or silence) for that specific warning.\n The `id` should be namespaced by dots, e.g. \"ember-debug.feature-flag-with-features-stripped\"", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 136, + "description": "

Verify that a certain expectation is met, or throw a exception otherwise.

\n

This is useful for communicating assumptions in the code to other human\nreaders as well as catching bugs that accidentally violates these\nexpectations.

\n

Assertions are removed from production builds, so they can be freely added\nfor documentation and debugging purposes without worries of incuring any\nperformance penalty. However, because of that, they should not be used for\nchecks that could reasonably fail during normal usage. Furthermore, care\nshould be taken to avoid accidentally relying on side-effects produced from\nevaluating the condition itself, since the code will not run in production.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assert } from '@ember/debug';\n\n// Test for truthiness\nassert('Must pass a string', typeof str === 'string');\n\n// Fail unconditionally\nassert('This code path should never be run');
\n
\n
\n \n", + "itemtype": "method", + "name": "assert", + "static": 1, + "params": [ + { + "name": "description", + "description": "Describes the expectation. This will become the\n text of the Error thrown if the assertion fails.", + "type": "String" + }, + { + "name": "condition", + "description": "Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.", + "type": "Any" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 176, + "description": "

Display a debug notice.

\n

Calls to this function are not invoked in production builds.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { debug } from '@ember/debug';\n\ndebug('I\\'m a debug notice!');
\n
\n
\n \n", + "itemtype": "method", + "name": "debug", + "static": 1, + "params": [ + { + "name": "message", + "description": "A debug message to display.", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 203, + "description": "

Display an info notice.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n", + "itemtype": "method", + "name": "info", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 222, + "description": "

Alias an old, deprecated method with its new counterpart.

\n

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only) when the assigned method is called.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { deprecateFunc } from '@ember/debug';\n\nEmber.oldMethod = deprecateFunc('Please use the new, updated method', options, Ember.newMethod);
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecateFunc", + "static": 1, + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "options", + "description": "The options object for `deprecate`.", + "type": "Object", + "optional": true + }, + { + "name": "func", + "description": "The new function called to replace its deprecated counterpart.", + "type": "Function" + } + ], + "return": { + "description": "A new function that wraps the original function with a deprecation warning", + "type": "Function" + }, + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 267, + "description": "

Run a function meant for debugging.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport { runInDebug } from '@ember/debug';\n\nrunInDebug(() => {\n  Component.reopen({\n    didInsertElement() {\n      console.log("I'm happy");\n    }\n  });\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "runInDebug", + "static": 1, + "params": [ + { + "name": "func", + "description": "The function to be executed.", + "type": "Function" + } + ], + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/destroyable-bc9e6d5a2f.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/destroyable-bc9e6d5a2f.json new file mode 100644 index 000000000..8f26d0536 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/destroyable-bc9e6d5a2f.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/destroyable", + "type": "class", + "attributes": { + "name": "@ember/destroyable", + "shortname": "@ember/destroyable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/destroyable", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/destroyable/index.ts", + "line": 31, + "description": "

This function is used to associate a destroyable object with a parent. When the parent\nis destroyed, all registered children will also be destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
class CustomSelect extends Component {\n  constructor(...args) {\n    super(...args);\n\n    // obj is now a child of the component. When the component is destroyed,\n    // obj will also be destroyed, and have all of its destructors triggered.\n    this.obj = associateDestroyableChild(this, {});\n  }\n}
\n
\n
\n \n

Returns the associated child for convenience.

\n", + "itemtype": "method", + "name": "associateDestroyableChild", + "params": [ + { + "name": "parent", + "description": "the destroyable to entangle the child destroyables lifetime with", + "type": "Object|Function" + }, + { + "name": "child", + "description": "the destroyable to be entangled with the parents lifetime", + "type": "Object|Function" + } + ], + "return": { + "description": "the child argument", + "type": "Object|Function" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 58, + "description": "

Receives a destroyable, and returns true if the destroyable has begun destroying. Otherwise returns\nfalse.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let obj = {};\nisDestroying(obj); // false\ndestroy(obj);\nisDestroying(obj); // true\n// ...sometime later, after scheduled destruction\nisDestroyed(obj); // true\nisDestroying(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroying", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 80, + "description": "

Receives a destroyable, and returns true if the destroyable has finished destroying. Otherwise\nreturns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let obj = {};\n\nisDestroyed(obj); // false\ndestroy(obj);\n\n// ...sometime later, after scheduled destruction\n\nisDestroyed(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroyed", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 103, + "description": "

Initiates the destruction of a destroyable object. It runs all associated destructors, and then\ndestroys all children recursively.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let obj = {};\n\nregisterDestructor(obj, () => console.log('destroyed!'));\n\ndestroy(obj); // this will schedule the destructor to be called\n\n// ...some time later, during scheduled destruction\n\n// destroyed!
\n
\n
\n \n

Destruction via destroy() follows these steps:

\n

1, Mark the destroyable such that isDestroying(destroyable) returns true\n2, Call destroy() on each of the destroyable's associated children\n3, Schedule calling the destroyable's destructors\n4, Schedule setting destroyable such that isDestroyed(destroyable) returns true

\n

This results in the entire tree of destroyables being first marked as destroying,\nthen having all of their destructors called, and finally all being marked as isDestroyed.\nThere won't be any in between states where some items are marked as isDestroying while\ndestroying, while others are not.

\n", + "itemtype": "method", + "name": "destroy", + "params": [ + { + "name": "destroyable", + "description": "the object to destroy", + "type": "Object|Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 138, + "description": "

This function asserts that all objects which have associated destructors or associated children\nhave been destroyed at the time it is called. It is meant to be a low level hook that testing\nframeworks can use to hook into and validate that all destroyables have in fact been destroyed.

\n

This function requires that enableDestroyableTracking was called previously, and is only\navailable in non-production builds.

\n", + "itemtype": "method", + "name": "assertDestroyablesDestroyed", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 152, + "description": "

This function instructs the destroyable system to keep track of all destroyables (their\nchildren, destructors, etc). This enables a future usage of assertDestroyablesDestroyed\nto be used to ensure that all destroyable tasks (registered destructors and associated children)\nhave completed when assertDestroyablesDestroyed is called.

\n", + "itemtype": "method", + "name": "enableDestroyableTracking", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 164, + "description": "

Receives a destroyable object and a destructor function, and associates the\nfunction with it. When the destroyable is destroyed with destroy, or when its\nparent is destroyed, the destructor function will be called.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, () => this.resize.unregister(this));\n  }\n}
\n
\n
\n \n

Multiple destructors can be associated with a given destroyable, and they can be\nassociated over time, allowing libraries to dynamically add destructors as needed.\nregisterDestructor also returns the associated destructor function, for convenience.

\n

The destructor function is passed a single argument, which is the destroyable itself.\nThis allows the function to be reused multiple times for many destroyables, rather\nthan creating a closure function per destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nfunction unregisterResize(instance) {\n  instance.resize.unregister(instance);\n}\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, unregisterResize);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "registerDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to register the destructor function with", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to run when the destroyable object is destroyed", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 229, + "description": "

Receives a destroyable and a destructor function, and de-associates the destructor\nfrom the destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor, unregisterDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service modals;\n\n  constructor(...args) {\n    super(...args);\n\n    this.modals.add(this);\n\n    this.modalDestructor = registerDestructor(this, () => this.modals.remove(this));\n  }\n\n  @action pinModal() {\n    unregisterDestructor(this, this.modalDestructor);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "unregisterDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to unregister the destructor function from", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to remove from the destroyable", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/destroyable", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/helper-4a647914fa.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/helper-4a647914fa.json new file mode 100644 index 000000000..2a74c3656 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/helper-4a647914fa.json @@ -0,0 +1,128 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/helper", + "type": "class", + "attributes": { + "name": "@ember/helper", + "shortname": "@ember/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/helper", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/helper/index.ts", + "line": 5, + "description": "

capabilities returns a capabilities configuration which can be used to modify\nthe behavior of the manager. Manager capabilities must be provided using the\ncapabilities function, as the underlying implementation can change over time.

\n

The first argument to capabilities is a version string, which is the version of\nEmber that the capabilities were defined in. Ember can add new versions at any\ntime, and these may have entirely different behaviors, but it will not remove\nold versions until the next major version.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
capabilities('3.23');
\n
\n
\n \n

The second argument is an object of capabilities and boolean values indicating\nwhether they are enabled or disabled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
capabilities('3.23', {\n  hasValue: true,\n  hasDestructor: true,\n});
\n
\n
\n \n

If no value is specified, then the default value will be used.

\n

3.23 capabilities

\n

hasDestroyable

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a destroyable to include in the destructor\nhierarchy. If enabled, the getDestroyable hook will be called, and its result\nwill be associated with the destroyable parent block.

\n

hasValue

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a value which can be used externally. The helper's\ngetValue hook will be run whenever the value of the helper is accessed if this\ncapability is enabled.

\n", + "itemtype": "method", + "name": "capabilities", + "static": 1, + "params": [ + { + "name": "managerApiVersion", + "description": "The version of capabilities that are being used", + "type": "String" + }, + { + "name": "options", + "description": "The capabilities values" + } + ], + "return": { + "description": "The capabilities object instance", + "type": "Capabilities" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 58, + "description": "

Sets the helper manager for an object or function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
setHelperManager((owner) => new ClassHelperManager(owner), Helper)
\n
\n
\n \n

When a value is used as a helper in a template, the helper manager is looked up\non the object by walking up its prototype chain and finding the first helper\nmanager. This manager then receives the value and can create and manage an\ninstance of a helper from it. This provides a layer of indirection that allows\nusers to design high-level helper APIs, without Ember needing to worry about the\ndetails. High-level APIs can be experimented with and iterated on while the\ncore of Ember helpers remains stable, and new APIs can be introduced gradually\nover time to existing code bases.

\n

setHelperManager receives two arguments:

\n
    \n
  1. A factory function, which receives the owner and returns an instance of a\n helper manager.
  2. \n
  3. A helper definition, which is the object or function to associate the factory function with.
  4. \n
\n

The first time the object is looked up, the factory function will be called to\ncreate the helper manager. It will be cached, and in subsequent lookups the\ncached helper manager will be used instead.

\n

Only one helper manager is guaranteed to exist per owner and per usage of\nsetHelperManager, so many helpers will end up using the same instance of the\nhelper manager. As such, you should only store state that is related to the\nmanager itself. If you want to store state specific to a particular helper\ndefinition, you should assign a unique helper manager to that helper. In\ngeneral, most managers should either be stateless, or only have the owner they\nwere created with as state.

\n

Helper managers must fulfill the following interface (This example uses\nTypeScript interfaces\nfor precision, you do not need to write helper managers using TypeScript):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
interface HelperManager<HelperStateBucket> {\n  capabilities: HelperCapabilities;\n\n  createHelper(definition: HelperDefinition, args: TemplateArgs): HelperStateBucket;\n\n  getValue?(bucket: HelperStateBucket): unknown;\n\n  runEffect?(bucket: HelperStateBucket): void;\n\n  getDestroyable?(bucket: HelperStateBucket): object;\n}
\n
\n
\n \n

The capabilities property must be provided using the capabilities() function\nimported from the same module as setHelperManager:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capabilities } from '@ember/helper';\n\nclass MyHelperManager {\n  capabilities = capabilities('3.21.0', { hasValue: true });\n\n  // ...snip...\n}
\n
\n
\n \n

Below is a description of each of the methods on the interface and their\nfunctions.

\n

createHelper

\n

createHelper is a required hook on the HelperManager interface. The hook is\npassed the definition of the helper that is currently being created, and is\nexpected to return a state bucket. This state bucket is what represents the\ncurrent state of the helper, and will be passed to the other lifecycle hooks at\nappropriate times. It is not necessarily related to the definition of the\nhelper itself - for instance, you could return an object containing an\ninstance of the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
class MyManager {\n  createHelper(Definition, args) {\n    return {\n      instance: new Definition(args);\n    };\n  }\n}
\n
\n
\n \n

This allows the manager to store metadata that it doesn't want to expose to the\nuser.

\n

This hook is not autotracked - changes to tracked values used within this hook\nwill not result in a call to any of the other lifecycle hooks. This is because\nit is unclear what should happen if it invalidates, and rather than make a\ndecision at this point, the initial API is aiming to allow as much expressivity\nas possible. This could change in the future with changes to capabilities and\ntheir behaviors.

\n

If users do want to autotrack some values used during construction, they can\neither create the instance of the helper in runEffect or getValue, or they\ncan use the cache API to autotrack the createHelper hook themselves. This\nprovides maximum flexibility and expressiveness to manager authors.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called as discovered during DOM construction
  • \n
  • called in definition order in the template
  • \n
\n

getValue

\n

getValue is an optional hook that should return the value of the helper. This\nis the value that is returned from the helper and passed into the template.

\n

This hook is called when the value is requested from the helper (e.g. when the\ntemplate is rendering and the helper value is needed). The hook is autotracked,\nand will rerun whenever any tracked values used inside of it are updated.\nOtherwise it does not rerun.

\n
\n

Note: This means that arguments which are not consumed within the hook will\nnot trigger updates.

\n
\n

This hook is only called for helpers with the hasValue capability enabled.\nThis hook has the following timing semantics:

\n

Always

\n
    \n
  • called the first time the helper value is requested
  • \n
  • called after autotracked state has changed
  • \n
\n

Never

\n
    \n
  • called if the hasValue capability is disabled
  • \n
\n

runEffect

\n

runEffect is an optional hook that should run the effect that the helper is\napplying, setting it up or updating it.

\n

This hook is scheduled to be called some time after render and prior to paint.\nThere is not a guaranteed, 1-to-1 relationship between a render pass and this\nhook firing. For instance, multiple render passes could occur, and the hook may\nonly trigger once. It may also never trigger if it was dirtied in one render\npass and then destroyed in the next.

\n

The hook is autotracked, and will rerun whenever any tracked values used inside\nof it are updated. Otherwise it does not rerun.

\n

The hook is also run during a time period where state mutations are disabled\nin Ember. Any tracked state mutation will throw an error during this time,\nincluding changes to tracked properties, changes made using Ember.set, updates\nto computed properties, etc. This is meant to prevent infinite rerenders and\nother antipatterns.

\n

This hook is only called for helpers with the hasScheduledEffect capability\nenabled. This hook is also not called in SSR currently, though this could be\nadded as a capability in the future. It has the following timing semantics:

\n

Always

\n
    \n
  • called after the helper was first created, if the helper has not been\ndestroyed since creation
  • \n
  • called after autotracked state has changed, if the helper has not been\ndestroyed during render
  • \n
\n

Never

\n
    \n
  • called if the hasScheduledEffect capability is disabled
  • \n
  • called in SSR
  • \n
\n

getDestroyable

\n

getDestroyable is an optional hook that users can use to register a\ndestroyable object for the helper. This destroyable will be registered to the\ncontaining block or template parent, and will be destroyed when it is destroyed.\nSee the Destroyables RFC\nfor more details.

\n

getDestroyable is only called if the hasDestroyable capability is enabled.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called immediately after the createHelper hook is called
  • \n
\n

Never

\n
    \n
  • called if the hasDestroyable capability is disabled
  • \n
\n", + "itemtype": "method", + "name": "setHelperManager", + "static": 1, + "params": [ + { + "name": "factory", + "description": "A factory function which receives an optional owner, and returns a helper manager", + "type": "Function" + }, + { + "name": "definition", + "description": "The definition to associate the manager factory with", + "type": "Object" + } + ], + "return": { + "description": "The definition passed into setHelperManager", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 251, + "description": "

The invokeHelper function can be used to create a helper instance in\nJavaScript.

\n

To access a helper's value you have to use getValue from\n@glimmer/tracking/primitives/cache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
// app/components/data-loader.js\nimport Component from '@glimmer/component';\nimport { getValue } from '@glimmer/tracking/primitives/cache';\nimport Helper from '@ember/component/helper';\nimport { invokeHelper } from '@ember/helper';\n\nclass PlusOne extends Helper {\n  compute([number]) {\n    return number + 1;\n  }\n}\n\nexport default class PlusOneComponent extends Component {\n  plusOne = invokeHelper(this, PlusOne, () => {\n    return {\n      positional: [this.args.number],\n    };\n  });\n\n  get value() {\n    return getValue(this.plusOne);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{this.value}}
\n
\n
\n \n

It receives three arguments:

\n
    \n
  • context: The parent context of the helper. When the parent is torn down and\nremoved, the helper will be as well.
  • \n
  • definition: The definition of the helper.
  • \n
  • computeArgs: An optional function that produces the arguments to the helper.\nThe function receives the parent context as an argument, and must return an\nobject with a positional property that is an array and/or a named\nproperty that is an object.
  • \n
\n

And it returns a Cache instance that contains the most recent value of the\nhelper. You can access the helper using getValue() like any other cache. The\ncache is also destroyable, and using the destroy() function on it will cause\nthe helper to be torn down.

\n

Note that using getValue() on helpers that have scheduled effects will not\ntrigger the effect early. Effects will continue to run at their scheduled time.

\n", + "itemtype": "method", + "name": "invokeHelper", + "static": 1, + "params": [ + { + "name": "context", + "description": "The parent context of the helper", + "type": "Object" + }, + { + "name": "definition", + "description": "The helper definition", + "type": "Object" + }, + { + "name": "computeArgs", + "description": "An optional function that produces args", + "type": "Function" + } + ], + "return": { + "description": "" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/helper", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/object-7da375607e.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/object-7da375607e.json new file mode 100644 index 000000000..2504def69 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/object-7da375607e.json @@ -0,0 +1,521 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/object", + "type": "class", + "attributes": { + "name": "@ember/object", + "shortname": "@ember/object", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 730, + "description": "

This helper returns a new property descriptor that wraps the passed\ncomputed property function. You can use this helper to define properties with\nnative decorator syntax, mixins, or via defineProperty().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', function() {\n    return `${this.get('firstName')} ${this.get('lastName')}`;\n  })\n});\n\nlet client = Person.create();\n\nclient.get('fullName'); // 'Betty Jones'\n\nclient.set('lastName', 'Fuller');\nclient.get('fullName'); // 'Betty Fuller'
\n
\n
\n \n

You can also provide a setter, either directly on the class using native class\nsyntax, or by passing a hash with get and set functions.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(/\\s+/);\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n\n    return value;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', {\n    get(key) {\n      return `${this.get('firstName')} ${this.get('lastName')}`;\n    },\n    set(key, value) {\n      let [firstName, lastName] = value.split(/\\s+/);\n      this.setProperties({ firstName, lastName });\n      return value;\n    }\n  })\n});\n\nlet client = Person.create();\nclient.get('firstName'); // 'Betty'\n\nclient.set('fullName', 'Carroll Fuller');\nclient.get('firstName'); // 'Carroll'
\n
\n
\n \n

When passed as an argument, the set function should accept two parameters,\nkey and value. The value returned from set will be the new value of the\nproperty.

\n

Note: This is the preferred way to define computed properties when writing third-party\nlibraries that depend on or use Ember, since there is no guarantee that the user\nwill have prototype Extensions enabled.

\n", + "itemtype": "method", + "name": "computed", + "static": 1, + "params": [ + { + "name": "dependentKeys*", + "description": "Optional dependent keys that trigger this computed property.", + "type": "String", + "optional": true + }, + { + "name": "func", + "description": "The computed property function.", + "type": "Function" + } + ], + "return": { + "description": "property decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/get_properties.ts", + "line": 6, + "description": "

To get multiple properties at once, call getProperties\nwith an object followed by a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, 'firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, ['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + }, + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 772, + "description": "

Specify a method that observes property changes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nimport { observer } from '@ember/object';\n\nexport default EmberObject.extend({\n  valueObserver: observer('value', function() {\n    // Executes whenever the "value" property changes\n  })\n});
\n
\n
\n \n

Also available as Function.prototype.observes if prototype extensions are\nenabled.

\n", + "itemtype": "method", + "name": "observer", + "params": [ + { + "name": "propertyNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "func" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/properties.ts", + "line": 13, + "description": "

NOTE: This is a low-level method used by other parts of the API. You almost\nnever want to call this method directly. Instead you should use\nmixin() to define new properties.

\n

Defines a property on an object. This method works much like the ES5\nObject.defineProperty() method except that it can also accept computed\nproperties and other special descriptors.

\n

Normally this method takes only three parameters. However if you pass an\ninstance of Descriptor as the third param then you can pass an\noptional value as the fourth parameter. This is often more efficient than\ncreating new descriptor hashes for each property.

\n

Examples

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { defineProperty, computed } from '@ember/object';\n\n// ES5 compatible mode\ndefineProperty(contact, 'firstName', {\n  writable: true,\n  configurable: false,\n  enumerable: true,\n  value: 'Charles'\n});\n\n// define a simple property\ndefineProperty(contact, 'lastName', undefined, 'Jolley');\n\n// define a computed property\ndefineProperty(contact, 'fullName', computed('firstName', 'lastName', function() {\n  return this.firstName+' '+this.lastName;\n}));
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "defineProperty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "the object to define this property on. This may be a prototype.", + "type": "Object" + }, + { + "name": "keyName", + "description": "the name of the property", + "type": "String" + }, + { + "name": "desc", + "description": "an instance of `Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.", + "type": "Descriptor", + "optional": true + }, + { + "name": "data", + "description": "something other than a descriptor, that will\n become the explicit value of this property.", + "type": "*", + "optional": true + } + ], + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 32, + "description": "

This function is called just after an object property has changed.\nIt will notify any observers and clear caches among other things.

\n

Normally you will not need to call this method directly but if for some\nreason you can't directly watch a property you can invoke this method\nmanually.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "obj", + "description": "The object with the property that will change", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key (or path) that will change.", + "type": "String" + }, + { + "name": "_meta", + "description": "The objects meta.", + "type": "Meta", + "optional": true + }, + { + "name": "value", + "description": "The new value to set for the property", + "type": "Unknown", + "optional": true + } + ], + "return": { + "description": "", + "type": "Void" + }, + "since": "3.1.0", + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 83, + "itemtype": "method", + "name": "beginPropertyChanges", + "chainable": 1, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 93, + "itemtype": "method", + "name": "endPropertyChanges", + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 105, + "description": "

Make a series of property changes together in an\nexception-safe way.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
Ember.changeProperties(function() {\n  obj1.set('foo', mayBlowUpWhenSet);\n  obj2.set('bar', baz);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "changeProperties", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_get.ts", + "line": 50, + "description": "

Gets the value of a property on an object. If the property is computed,\nthe function will be invoked. If the property is not defined but the\nobject implements the unknownProperty method then that will be invoked.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { get } from '@ember/object';\nget(obj, "name");
\n
\n
\n \n

If you plan to run on IE8 and older browsers then you should use this\nmethod anytime you want to retrieve a property on an object that you don't\nknow for sure is private. (Properties beginning with an underscore '_'\nare considered private.)

\n

On all newer browsers, you only need to use this method to retrieve\nproperties if the property might not be defined on the object and you want\nto respect the unknownProperty handler. Otherwise you can ignore this\nmethod.

\n

Note that if the object itself is undefined, this method will throw\nan error.

\n", + "itemtype": "method", + "name": "get", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to retrieve from.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to retrieve", + "type": "String" + } + ], + "return": { + "description": "the property value or `null`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 18, + "description": "

Sets the value of a property on an object, respecting computed properties\nand notifying observers and other listeners of the change.\nIf the specified property is not defined on the object and the object\nimplements the setUnknownProperty method, then instead of setting the\nvalue of the property on the object, its setUnknownProperty handler\nwill be invoked with the two parameters keyName and value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { set } from '@ember/object';\nset(obj, "name", value);
\n
\n
\n \n", + "itemtype": "method", + "name": "set", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "return": { + "description": "the passed value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 124, + "description": "

Error-tolerant form of set. Will not blow up if any part of the\nchain is undefined, null, or destroyed.

\n

This is primarily used when syncing bindings, which may try to update after\nan object has been destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { trySet } from '@ember/object';\n\nlet obj = { name: "Zoey" };\ntrySet(obj, "contacts.twitter", "@emberjs");
\n
\n
\n \n", + "itemtype": "method", + "name": "trySet", + "static": 1, + "params": [ + { + "name": "root", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "path", + "description": "The property path to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/set_properties.ts", + "line": 6, + "description": "

Set a list of properties on an object. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nlet anObject = EmberObject.create();\n\nanObject.setProperties({\n  firstName: 'Stanley',\n  lastName: 'Stuart',\n  age: 21\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "properties", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "properties" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 618, + "description": "

Creates a new subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(thing);\n   }\n});
\n
\n
\n \n

This defines a new subclass of EmberObject: Person. It contains one method: say().

\n

You can also create a subclass from any existing class by calling its extend() method.\nFor example, you might want to create a subclass of Ember's built-in Component class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nconst PersonComponent = Component.extend({\n  tagName: 'li',\n  classNameBindings: ['isAdministrator']\n});
\n
\n
\n \n

When defining a subclass, you can override methods but still access the\nimplementation of your parent class by calling the special _super() method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    let name = this.get('name');\n    alert(`${name} says: ${thing}`);\n  }\n});\n\nconst Soldier = Person.extend({\n  say(thing) {\n    this._super(`${thing}, sir!`);\n  },\n  march(numberOfHours) {\n    alert(`${this.get('name')} marches for ${numberOfHours} hours.`);\n  }\n});\n\nlet yehuda = Soldier.create({\n  name: 'Yehuda Katz'\n});\n\nyehuda.say('Yes');  // alerts "Yehuda Katz says: Yes, sir!"
\n
\n
\n \n

The create() on line #17 creates an instance of the Soldier class.\nThe extend() on line #8 creates a subclass of Person. Any instance\nof the Person class will not have the march() method.

\n

You can also pass Mixin classes to add additional properties to the subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import EmberObject from '@ember/object';\nimport Mixin from '@ember/object/mixin';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(`${this.get('name')} says: ${thing}`);\n  }\n});\n\nconst SingingMixin = Mixin.create({\n  sing(thing) {\n    alert(`${this.get('name')} sings: la la la ${thing}`);\n  }\n});\n\nconst BroadwayStar = Person.extend(SingingMixin, {\n  dance() {\n    alert(`${this.get('name')} dances: tap tap tap tap `);\n  }\n});
\n
\n
\n \n

The BroadwayStar class contains three methods: say(), sing(), and dance().

\n", + "itemtype": "method", + "name": "extend", + "static": 1, + "params": [ + { + "name": "mixins", + "description": "One or more Mixin classes", + "type": "Mixin", + "optional": true, + "multiple": true + }, + { + "name": "arguments", + "description": "Object containing values to use within the new class", + "type": "Object", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 722, + "description": "

Creates an instance of a class. Accepts either no arguments, or an object\ncontaining values to initialize the newly instantiated object with.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  helloWorld() {\n    alert(`Hi, my name is ${this.get('name')}`);\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\n\ntom.helloWorld(); // alerts "Hi, my name is Tom Dale".
\n
\n
\n \n

create will call the init function if defined during\nAnyObject.extend

\n

If no arguments are passed to create, it will not set values to the new\ninstance during initialization:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let noName = Person.create();\nnoName.helloWorld(); // alerts undefined
\n
\n
\n \n

NOTE: For performance reasons, you cannot declare methods or computed\nproperties during create. You should instead declare methods and computed\nproperties when using extend.

\n", + "itemtype": "method", + "name": "create", + "static": 1, + "params": [ + { + "name": "arguments", + "description": "", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 787, + "description": "

Augments a constructor's prototype with additional\nproperties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\no = MyObject.create();\no.get('name'); // 'an object'\n\nMyObject.reopen({\n  say(msg) {\n    console.log(msg);\n  }\n});\n\no2 = MyObject.create();\no2.say('hello'); // logs "hello"\n\no.say('goodbye'); // logs "goodbye"
\n
\n
\n \n

To add functions and properties to the constructor itself,\nsee reopenClass

\n", + "itemtype": "method", + "name": "reopen", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 841, + "description": "

Augments a constructor's own properties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\nMyObject.reopenClass({\n  canBuild: false\n});\n\nMyObject.canBuild; // false\no = MyObject.create();
\n
\n
\n \n

In other words, this creates static properties and functions for the class.\nThese are only available on the class and not on any instance of that class.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  name: '',\n  sayHello() {\n    alert(`Hello. My name is ${this.get('name')}`);\n  }\n});\n\nPerson.reopenClass({\n  species: 'Homo sapiens',\n\n  createPerson(name) {\n    return Person.create({ name });\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\nlet yehuda = Person.createPerson('Yehuda Katz');\n\ntom.sayHello(); // "Hello. My name is Tom Dale"\nyehuda.sayHello(); // "Hello. My name is Yehuda Katz"\nalert(Person.species); // "Homo sapiens"
\n
\n
\n \n

Note that species and createPerson are not valid on the tom and yehuda\nvariables. They are only valid on Person.

\n

To add functions and properties to instances of\na constructor by extending the constructor's prototype\nsee reopen

\n", + "itemtype": "method", + "name": "reopenClass", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 924, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For\nexample, computed property functions may close over variables that are then\nno longer available for introspection.

\n

You can pass a hash of these values to a computed property like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { computed } from '@ember/object';\n\nperson: computed(function() {\n  let personId = this.get('personId');\n  return Person.create({ id: personId });\n}).meta({ type: Person })
\n
\n
\n \n

Once you've done this, you can retrieve the values saved to the computed\nproperty from your class like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyClass.metaForProperty('person');
\n
\n
\n \n

This will return the original hash that was passed to meta().

\n", + "static": 1, + "itemtype": "method", + "name": "metaForProperty", + "params": [ + { + "name": "key", + "description": "property name", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 967, + "description": "

Iterate over each computed property for the class, passing its name\nand any associated metadata (see metaForProperty) to the callback.

\n", + "static": 1, + "itemtype": "method", + "name": "eachComputedProperty", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "binding", + "description": "", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 1059, + "description": "

Provides lookup-time type validation for injected properties.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_onLookup", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 1080, + "description": "

Returns a hash of property names and container names that injected\nproperties will lookup on the container lazily.

\n", + "itemtype": "method", + "name": "_lazyInjections", + "return": { + "description": "Hash of all lazy injected property keys to container names", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/index.ts", + "line": 19, + "description": "

Decorator that turns the target function into an Action which can be accessed\ndirectly by reference.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action this.toggleShowing}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

Decorated actions also interop with the string style template actions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action "toggleShowing"}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

It also binds the function directly to the instance, so it can be used in any\ncontext and will correctly refer to the class it came from:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert this.toggleShowing}}\n  {{on "click" this.toggleShowing}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

This can also be used in JavaScript code directly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  constructor() {\n    super(...arguments);\n\n    // this.toggleShowing is still bound correctly when added to\n    // the event listener\n    document.addEventListener('click', this.toggleShowing);\n  }\n\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n

This is considered best practice, since it means that methods will be bound\ncorrectly no matter where they are used. By contrast, the {{action}} helper\nand modifier can also be used to bind context, but it will be required for\nevery usage of the method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert (action this.toggleShowing)}}\n  {{on "click" (action this.toggleShowing)}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

They also do not have equivalents in JavaScript directly, so they cannot be\nused for other situations where binding would be useful.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "action", + "static": 1, + "params": [ + { + "name": "callback", + "description": "The function to turn into an action,\n when used in classic classes", + "type": "Function|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/object/compat-ec72b45317.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/object/compat-ec72b45317.json new file mode 100644 index 000000000..d1532295e --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/object/compat-ec72b45317.json @@ -0,0 +1,64 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/object/compat", + "type": "class", + "attributes": { + "name": "@ember/object/compat", + "shortname": "@ember/object/compat", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/object/compat.ts", + "line": 40, + "description": "

@dependentKeyCompat is decorator that can be used on native getters that\nuse tracked properties. It exposes the getter to Ember's classic computed\nproperty and observer systems, so they can watch it for changes. It can be\nused in both native and classic classes.

\n

Native Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { computed, set } from '@ember/object';\n\nclass Person {\n  @tracked firstName;\n  @tracked lastName;\n\n  @dependentKeyCompat\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nclass Profile {\n  constructor(person) {\n    set(this, 'person', person);\n  }\n\n  @computed('person.fullName')\n  get helloMessage() {\n    return `Hello, ${this.person.fullName}!`;\n  }\n}
\n
\n
\n \n

Classic Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport EmberObject, { computed, observer, set } from '@ember/object';\n\nconst Person = EmberObject.extend({\n  firstName: tracked(),\n  lastName: tracked(),\n\n  fullName: dependentKeyCompat(function() {\n    return `${this.firstName} ${this.lastName}`;\n  }),\n});\n\nconst Profile = EmberObject.extend({\n  person: null,\n\n  helloMessage: computed('person.fullName', function() {\n    return `Hello, ${this.person.fullName}!`;\n  }),\n\n  onNameUpdated: observer('person.fullName', function() {\n    console.log('person name updated!');\n  }),\n});
\n
\n
\n \n

dependentKeyCompat() can receive a getter function or an object containing\nget/set methods when used in classic classes, like computed properties.

\n

In general, only properties which you expect to be watched by older,\nuntracked clases should be marked as dependency compatible. The decorator is\nmeant as an interop layer for parts of Ember's older classic APIs, and should\nnot be applied to every possible getter/setter in classes. The number of\ndependency compatible getters should be minimized wherever possible. New\napplication code should not need to use @dependentKeyCompat, since it is\nonly for interoperation with older code.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "dependentKeyCompat", + "static": 1, + "params": [ + { + "name": "desc", + "description": "A property descriptor containing\n the getter and setter (when used in\n classic classes)", + "type": "PropertyDescriptor|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object/compat", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/object/computed-73eef52e37.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/object/computed-73eef52e37.json new file mode 100644 index 000000000..65a2812dd --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/object/computed-73eef52e37.json @@ -0,0 +1,903 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/object/computed", + "type": "class", + "attributes": { + "name": "@ember/object/computed", + "shortname": "@ember/object/computed", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/expand_properties.ts", + "line": 9, + "description": "

Expands pattern, invoking callback for each expansion.

\n

The only pattern supported is brace-expansion, anything else will be passed\nonce to callback directly.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { expandProperties } from '@ember/object/computed';\n\nfunction echo(arg){ console.log(arg); }\n\nexpandProperties('foo.bar', echo);              //=> 'foo.bar'\nexpandProperties('{foo,bar}', echo);            //=> 'foo', 'bar'\nexpandProperties('foo.{bar,baz}', echo);        //=> 'foo.bar', 'foo.baz'\nexpandProperties('{foo,bar}.baz', echo);        //=> 'foo.baz', 'bar.baz'\nexpandProperties('foo.{bar,baz}.[]', echo)      //=> 'foo.bar.[]', 'foo.baz.[]'\nexpandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs'\nexpandProperties('{foo}.bar.{baz}')             //=> 'foo.bar.baz'
\n
\n
\n \n", + "itemtype": "method", + "name": "expandProperties", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "pattern", + "description": "The property pattern to expand.", + "type": "String" + }, + { + "name": "callback", + "description": "The callback to invoke. It is invoked once per\nexpansion, and is passed the expansion.", + "type": "Function" + } + ], + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 67, + "description": "

A computed property macro that returns true if the value of the dependent\nproperty is null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { empty } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  @empty('todos') isDone;\n}\n\nlet todoList = new ToDoList(\n  ['Unit Test', 'Documentation', 'Release']\n);\n\ntodoList.isDone; // false\nset(todoList, 'todos', []);\ntodoList.isDone; // true
\n
\n
\n \n", + "since": "1.6.0", + "itemtype": "method", + "name": "empty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if the value\nof the dependent property is null, an empty string, empty array, or empty\nfunction and false if the underlying value is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 116, + "description": "

A computed property that returns true if the value of the dependent property\nis NOT null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { notEmpty } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(backpack) {\n    set(this, 'backpack', backpack);\n  }\n\n  @notEmpty('backpack') hasStuff\n}\n\nlet hamster = new Hamster(\n  ['Food', 'Sleeping Bag', 'Tent']\n);\n\nhamster.hasStuff; // true\nset(hamster, 'backpack', []);\nhamster.hasStuff; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "notEmpty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 162, + "description": "

A computed property that returns true if the value of the dependent property\nis null or undefined. This avoids errors from JSLint complaining about use of\n==, which can be technically confusing.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { none } from '@ember/object/computed';\n\nclass Hamster {\n  @none('food') isHungry;\n}\n\nlet hamster = new Hamster();\n\nhamster.isHungry; // true\n\nset(hamster, 'food', 'Banana');\nhamster.isHungry; // false\n\nset(hamster, 'food', null);\nhamster.isHungry; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "none", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is null or undefined.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 205, + "description": "

A computed property that returns the inverse boolean value of the original\nvalue for the dependent property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { not } from '@ember/object/computed';\n\nclass User {\n  loggedIn = false;\n\n  @not('loggedIn') isAnonymous;\n}\n\nlet user = new User();\n\nuser.isAnonymous; // true\nset(user, 'loggedIn', true);\nuser.isAnonymous; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "not", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns inverse of the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 247, + "description": "

A computed property that converts the provided dependent property into a\nboolean value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { bool } from '@ember/object/computed';\n\n\nclass Hamster {\n  @bool('numBananas') hasBananas\n}\n\nlet hamster = new Hamster();\n\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 0);\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 1);\nhamster.hasBananas; // true\n\nset(hamster, 'numBananas', null);\nhamster.hasBananas; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "bool", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which converts to boolean the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 295, + "description": "

A computed property which matches the original value for the dependent\nproperty against a given RegExp, returning true if the value matches the\nRegExp and false if it does not.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { match } from '@ember/object/computed';\n\nclass User {\n  @match('email', /^.+@.+\\..+$/) hasValidEmail;\n}\n\nlet user = new User();\n\nuser.hasValidEmail; // false\n\nset(user, 'email', '');\nuser.hasValidEmail; // false\n\nset(user, 'email', 'ember_hamster@example.com');\nuser.hasValidEmail; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "match", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "regexp", + "description": "", + "type": "RegExp" + } + ], + "return": { + "description": "computed property which match the original value\nfor property against a given RegExp", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 342, + "description": "

A computed property that returns true if the provided dependent property is\nequal to the given value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { equal } from '@ember/object/computed';\n\nclass Hamster {\n  @equal('percentCarrotsEaten', 100) satisfied;\n}\n\nlet hamster = new Hamster();\n\nhamster.satisfied; // false\n\nset(hamster, 'percentCarrotsEaten', 100);\nhamster.satisfied; // true\n\nset(hamster, 'percentCarrotsEaten', 50);\nhamster.satisfied; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "equal", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "String|Number|Object" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is equal to the given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 387, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gt } from '@ember/object/computed';\n\nclass Hamster {\n  @gt('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 11);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 432, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gte } from '@ember/object/computed';\n\nclass Hamster {\n  @gte('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 10);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater or equal then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 477, + "description": "

A computed property that returns true if the provided dependent property is\nless than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lt } from '@ember/object/computed';\n\nclass Hamster {\n  @lt('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 2);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 522, + "description": "

A computed property that returns true if the provided dependent property is\nless than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lte } from '@ember/object/computed';\n\nclass Hamster {\n  @lte('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 5);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less or equal than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 567, + "description": "

A computed property that performs a logical and on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first falsy value or last\ntruthy value just like JavaScript's && operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { and } from '@ember/object/computed';\n\nclass Hamster {\n  @and('hasTent', 'hasBackpack') readyForCamp;\n  @and('hasWalkingStick', 'hasBackpack') readyForHike;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForCamp; // false\n\nset(tomster, 'hasTent', true);\ntomster.readyForCamp; // false\n\nset(tomster, 'hasBackpack', true);\ntomster.readyForCamp; // true\n\nset(tomster, 'hasBackpack', 'Yes');\ntomster.readyForCamp; // 'Yes'\n\nset(tomster, 'hasWalkingStick', null);\ntomster.readyForHike; // null
\n
\n
\n \n", + "itemtype": "method", + "name": "and", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `and` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 613, + "description": "

A computed property which performs a logical or on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first truthy value or last\nfalsy value just like JavaScript's || operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { or } from '@ember/object/computed';\n\nclass Hamster {\n  @or('hasJacket', 'hasUmbrella') readyForRain;\n  @or('hasSunscreen', 'hasUmbrella') readyForBeach;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForRain; // undefined\n\nset(tomster, 'hasUmbrella', true);\ntomster.readyForRain; // true\n\nset(tomster, 'hasJacket', 'Yes');\ntomster.readyForRain; // 'Yes'\n\nset(tomster, 'hasSunscreen', 'Check');\ntomster.readyForBeach; // 'Check'
\n
\n
\n \n", + "itemtype": "method", + "name": "or", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `or` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 656, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { alias } from '@ember/object/computed';\n\nclass Person {\n  name = 'Alex Matchneer';\n\n  @alias('name') nomen;\n}\n\nlet alex = new Person();\n\nalex.nomen; // 'Alex Matchneer'\nalex.name;  // 'Alex Matchneer'\n\nset(alex, 'nomen', '@machty');\nalex.name;  // '@machty'
\n
\n
\n \n", + "itemtype": "method", + "name": "alias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates an alias to the\noriginal value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 691, + "description": "

Where the alias computed macro aliases get and set, and allows for\nbidirectional data flow, the oneWay computed macro only provides an aliased\nget. The set will not mutate the upstream property, rather causes the\ncurrent property to become the value set. This causes the downstream property\nto permanently diverge from the upstream property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { oneWay }from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @oneWay('firstName') nickName;\n}\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear');\nteddy.firstName; // 'Teddy'\nteddy.nickName; // 'TeddyBear'
\n
\n
\n \n", + "itemtype": "method", + "name": "oneWay", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 739, + "description": "

This is a more semantically meaningful alias of the oneWay computed macro,\nwhose name is somewhat ambiguous as to which direction the data flows.

\n", + "itemtype": "method", + "name": "reads", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\n property to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 752, + "description": "

Where oneWay computed macro provides oneWay bindings, the readOnly\ncomputed macro provides a readOnly one way binding. Very often when using\nthe oneWay macro one does not also want changes to propagate back up, as\nthey will replace the value.

\n

This prevents the reverse flow, and also throws an exception when it occurs.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { readOnly } from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @readOnly('firstName') nickName;\n});\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear'); // throws Exception\n// throw new EmberError('Cannot Set: nickName on: <User:ember27288>' );`\n\nteddy.firstName; // 'Teddy'
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 803, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property, but also print a deprecation warning.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { set } from '@ember/object';\nimport { deprecatingAlias } from '@ember/object/computed';\n\nclass Hamster {\n  @deprecatingAlias('cavendishCount', {\n    id: 'hamster.deprecate-banana',\n    until: '3.0.0'\n  })\n  bananaCount;\n}\n\nlet hamster = new Hamster();\n\nset(hamster, 'bananaCount', 5); // Prints a deprecation warning.\nhamster.cavendishCount; // 5
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecatingAlias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "Options for `deprecate`.", + "type": "Object" + } + ], + "return": { + "description": "computed property which creates an alias with a\ndeprecation to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 75, + "description": "

A computed property that returns the sum of the values in the dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { sum } from '@ember/object/computed';\n\nclass Invoice {\n  lineItems = [1.00, 2.50, 9.99];\n\n  @sum('lineItems') total;\n}\n\nlet invoice = new Invoice();\n\ninvoice.total; // 13.49
\n
\n
\n \n", + "itemtype": "method", + "name": "sum", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the sum of all values in the\ndependentKey's array", + "type": "ComputedProperty" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 112, + "description": "

A computed property that calculates the maximum value in the dependent array.\nThis will return -Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, max } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @max('childAges') maxChildAge;\n}\n\nlet lordByron = new Person();\n\nlordByron.maxChildAge; // -Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.maxChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.maxChildAge; // 8
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe max of a list of Date objects will be the highest timestamp as a Number.\nThis behavior is consistent with Math.max.

\n", + "itemtype": "method", + "name": "max", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the largest value in the dependentKey's\narray", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 176, + "description": "

A computed property that calculates the minimum value in the dependent array.\nThis will return Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, min } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @min('childAges') minChildAge;\n}\n\nlet lordByron = Person.create({ children: [] });\n\nlordByron.minChildAge; // Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.minChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.minChildAge; // 5
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe min of a list of Date objects will be the lowest timestamp as a Number.\nThis behavior is consistent with Math.min.

\n", + "itemtype": "method", + "name": "min", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the smallest value in the dependentKey's array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 239, + "description": "

Returns an array mapped via the callback

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function mapCallback(item, index);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', function(chore, index) {\n    return `${chore.toUpperCase()}!`;\n  })\n  excitingChores;\n});\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n

You can optionally pass an array of additional dependent keys as the second\nparameter to the macro, if your map function relies on any external values:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  shouldUpperCase = false;\n\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', ['shouldUpperCase'], function(chore, index) {\n    if (this.shouldUpperCase) {\n      return `${chore.toUpperCase()}!`;\n    } else {\n      return `${chore}!`;\n    }\n  })\n  excitingChores;\n}\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['clean!', 'write more unit tests!']\n\nset(hamster, 'shouldUpperCase', true);\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional\ndependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "an array mapped via the callback", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 363, + "description": "

Returns an array mapped to the specified key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import { set } from '@ember/object';\nimport { mapBy } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n}\n\nlet lordByron = new Person();\n\nlordByron.childAges; // []\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.childAges; // [7]\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.childAges; // [7, 5, 8]
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "an array mapped to the specified key", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 430, + "description": "

Filters the array by the callback.

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
  • array is the dependant array itself.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function filterCallback(item, index, array);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = Hamster.create([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]
\n
\n
\n \n

You can also use @each.property in your dependent key, the callback will\nstill use the underlying array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores.@each.done', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n\nset(hamster.chores[2], 'done', true);\nhamster.remainingChores; // []
\n
\n
\n \n

Finally, you can optionally pass an array of additional dependent keys as the\nsecond parameter to the macro, if your filter function relies on any external\nvalues:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  doneKey = 'finished';\n\n  @filter('chores', ['doneKey'], function(chore, index, array) {\n    return !chore[this.doneKey];\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', finished: true },\n  { name: 'clean', finished: true },\n  { name: 'write more unit tests', finished: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', finished: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional dependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 597, + "description": "

Filters the array by the property and value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { filterBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filterBy('chores', 'done', false) remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{ name: 'write more unit tests', done: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "*" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 653, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniq } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniq('fruits') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  'banana',\n  'grape',\n  'kale',\n  'banana'\n]);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale']
\n
\n
\n \n", + "itemtype": "method", + "name": "uniq", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 724, + "description": "

A computed property which returns a new array with all the unique elements\nfrom an array, with uniqueness determined by specific key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniqBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniqBy('fruits', 'id') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  { id: 1, 'banana' },\n  { id: 2, 'grape' },\n  { id: 3, 'peach' },\n  { id: 1, 'banana' }\n]);\n\nhamster.uniqueFruits; // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 778, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { union } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits, vegetables) {\n    set(this, 'fruits', fruits);\n    set(this, 'vegetables', vegetables);\n  }\n\n  @union('fruits', 'vegetables') uniqueFruits;\n});\n\nlet hamster = new, Hamster(\n  [\n    'banana',\n    'grape',\n    'kale',\n    'banana',\n    'tomato'\n  ],\n  [\n    'tomato',\n    'carrot',\n    'lettuce'\n  ]\n);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale', 'tomato', 'carrot', 'lettuce']
\n
\n
\n \n", + "itemtype": "method", + "name": "union", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the unique elements\nfrom one or more dependent arrays.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 825, + "description": "

A computed property which returns a new array with all the elements\ntwo or more dependent arrays have in common.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { intersect } from '@ember/object/computed';\n\nclass FriendGroups {\n  constructor(adaFriends, charlesFriends) {\n    set(this, 'adaFriends', adaFriends);\n    set(this, 'charlesFriends', charlesFriends);\n  }\n\n  @intersect('adaFriends', 'charlesFriends') friendsInCommon;\n}\n\nlet groups = new FriendGroups(\n  ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n  ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock']\n);\n\ngroups.friendsInCommon; // ['William King', 'Mary Somerville']
\n
\n
\n \n", + "itemtype": "method", + "name": "intersect", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the duplicated\nelements from the dependent arrays", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 906, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array that are not in the second dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { setDiff } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(likes, fruits) {\n    set(this, 'likes', likes);\n    set(this, 'fruits', fruits);\n  }\n\n  @setDiff('likes', 'fruits') wants;\n}\n\nlet hamster = new Hamster(\n  [\n    'banana',\n    'grape',\n    'kale'\n  ],\n  [\n    'grape',\n    'kale',\n  ]\n);\n\nhamster.wants; // ['banana']
\n
\n
\n \n", + "itemtype": "method", + "name": "setDiff", + "static": 1, + "params": [ + { + "name": "setAProperty", + "description": "", + "type": "String" + }, + { + "name": "setBProperty", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the items from the\nfirst dependent array that are not in the second dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 976, + "description": "

A computed property that returns the array of values for the provided\ndependent properties.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { collect } from '@ember/object/computed';\n\nclass Hamster {\n  @collect('hat', 'shirt') clothes;\n}\n\nlet hamster = new Hamster();\n\nhamster.clothes; // [null, null]\n\nset(hamster, 'hat', 'Camp Hat');\nset(hamster, 'shirt', 'Camp Shirt');\nhamster.clothes; // ['Camp Hat', 'Camp Shirt']
\n
\n
\n \n", + "itemtype": "method", + "name": "collect", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which maps values of all passed\nin properties to an array.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 1031, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array sorted based on a property or sort function. The sort\nmacro can be used in two different ways:

\n
    \n
  1. By providing a sort callback function
  2. \n
  3. By providing an array of keys to sort the array
  4. \n
\n

In the first form, the callback method you provide should have the following\nsignature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function sortCallback(itemA, itemB);
\n
\n
\n \n
    \n
  • itemA the first item to compare.
  • \n
  • itemB the second item to compare.
  • \n
\n

This function should return negative number (e.g. -1) when itemA should\ncome before itemB. It should return positive number (e.g. 1) when itemA\nshould come after itemB. If the itemA and itemB are equal this function\nshould return 0.

\n

Therefore, if this function is comparing some numeric values, simple itemA - itemB or itemA.get( 'foo' ) - itemB.get( 'foo' ) can be used instead of\nseries of if.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', function(a, b){\n    if (a.priority > b.priority) {\n      return 1;\n    } else if (a.priority < b.priority) {\n      return -1;\n    }\n\n    return 0;\n  })\n  priorityTodos;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

You can also optionally pass an array of additional dependent keys as the\nsecond parameter, if your sort function is dependent on additional values that\ncould changes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n
import EmberObject, { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  sortKey = 'priority';\n\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', ['sortKey'], function(a, b){\n    if (a[this.sortKey] > b[this.sortKey]) {\n      return 1;\n    } else if (a[this.sortKey] < b[this.sortKey]) {\n      return -1;\n    }\n\n    return 0;\n  })\n  sortedTodos;\n});\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

In the second form, you should provide the key of the array of sort values as\nthe second parameter:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using standard ascending sort\n  todosSorting = ['name'];\n  @sort('todos', 'todosSorting') sortedTodos;\n\n  // using descending sort\n  todosSortingDesc = ['name:desc'];\n  @sort('todos', 'todosSortingDesc') sortedTodosDesc;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.sortedTodos; // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\ntodoList.sortedTodosDesc; // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n", + "itemtype": "method", + "name": "sort", + "static": 1, + "params": [ + { + "name": "itemsKey", + "description": "", + "type": "String" + }, + { + "name": "sortDefinitionOrDependentKeys", + "description": "The key of the sort definition (an array of sort properties),\nthe sort function, or an array of additional dependent keys", + "type": "String|Function|Array" + }, + { + "name": "sortDefinition", + "description": "the sort function (when used with additional dependent keys)", + "type": "Function?" + } + ], + "return": { + "description": "computes a new sorted array based on the sort\nproperty array or callback function", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/object/evented-2a59cd9c1b.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/object/evented-2a59cd9c1b.json new file mode 100644 index 000000000..b80b84398 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/object/evented-2a59cd9c1b.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/object/evented", + "type": "class", + "attributes": { + "name": "@ember/object/evented", + "shortname": "@ember/object/evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 180, + "description": "

Define a property as a function that should be executed when\na specified event or events are triggered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\nimport { on } from '@ember/object/evented';\nimport { sendEvent } from '@ember/object/events';\n\nlet Job = EmberObject.extend({\n  logCompleted: on('completed', function() {\n    console.log('Job completed!');\n  })\n});\n\nlet job = Job.create();\n\nsendEvent(job, 'completed'); // Logs 'Job completed!'
\n
\n
\n \n", + "itemtype": "method", + "name": "on", + "static": 1, + "params": [ + { + "name": "eventNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the listener function, passed as last argument to on(...)", + "type": "Function" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/polyfills-e663722a81.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/polyfills-e663722a81.json new file mode 100644 index 000000000..9f5d79c89 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/polyfills-e663722a81.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/polyfills", + "type": "class", + "attributes": { + "name": "@ember/polyfills", + "shortname": "@ember/polyfills", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/polyfills", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/polyfills/lib/assign.ts", + "line": 11, + "description": "

Copy properties from a source object to a target object. Source arguments remain unchanged.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assign } from '@ember/polyfills';\n\nvar a = { first: 'Yehuda' };\nvar b = { last: 'Katz' };\nvar c = { company: 'Other Company' };\nvar d = { company: 'Tilde Inc.' };\nassign(a, b, c, d); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' };
\n
\n
\n \n", + "itemtype": "method", + "name": "assign", + "params": [ + { + "name": "target", + "description": "The object to assign into", + "type": "Object" + }, + { + "name": "args", + "description": "The objects to copy properties from", + "type": "Object", + "multiple": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/polyfills", + "module": "@ember/polyfills" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/polyfills", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/runloop-979bbb1333.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/runloop-979bbb1333.json new file mode 100644 index 000000000..a27d9c09f --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/runloop-979bbb1333.json @@ -0,0 +1,497 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/runloop", + "type": "class", + "attributes": { + "name": "@ember/runloop", + "shortname": "@ember/runloop", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/runloop", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 105, + "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

Normally 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { run } from '@ember/runloop';\n\nrun(function() {\n  // code to be executed within a RunLoop\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "run", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "return value from invoking the passed function.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 150, + "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

Please note: This is not for normal usage, and should be used sparingly.

\n

If invoked when not within a run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { join } from '@ember/runloop';\n\njoin(function() {\n  // creates a new run-loop\n});
\n
\n
\n \n

Alternatively, if called within an existing run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "join", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Return value from invoking the passed function. Please note,\nwhen called within an existing loop, no return value is possible.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 209, + "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

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

Let'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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import 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
\n \n

In 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.

\n", + "itemtype": "method", + "name": "bind", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "returns a new function that will always have a particular context", + "type": "Function" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 323, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "begin", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 346, + "description": "

Ends a RunLoop. This must be called sometime after you call\nbegin() to flush any deferred actions. This is a lower-level way\nto use a RunLoop instead of using run().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "end", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 369, + "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

At 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "schedule", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'", + "type": "String" + }, + { + "name": "target", + "description": "target object to use as the context when invoking a method.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.", + "type": "String|Function" + }, + { + "name": "arguments*", + "description": "Optional arguments to be passed to the queued method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 442, + "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

You 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "later", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 490, + "description": "

Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling scheduleOnce with the "actions" queue.

\n", + "itemtype": "method", + "name": "once", + "static": 1, + "params": [ + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 521, + "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

Note that although you can pass optional arguments these will not be\nconsidered when looking for duplicates. New arguments will replace previous\ncalls.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Also note that for scheduleOnce to prevent additional calls, you need to\npass the same function instance. The following case works as expected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
function log() {\n  console.log('Logging only once');\n}\n\nfunction scheduleIt() {\n  scheduleOnce('actions', myContext, log);\n}\n\nscheduleIt();\nscheduleIt();
\n
\n
\n \n

But this other case will schedule the function multiple times:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { 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
\n \n

Available queues, and their order, can be found at queues

\n", + "itemtype": "method", + "name": "scheduleOnce", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'.", + "type": "String", + "optional": true + }, + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 615, + "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\nlater with a wait time of 1ms.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { 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
\n \n

Multiple 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

Note 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

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

One 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

The 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.

\n", + "itemtype": "method", + "name": "next", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 700, + "description": "

Cancels a scheduled item. Must be a value returned by later(),\nonce(), scheduleOnce(), next(), debounce(), or\nthrottle().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n
import {\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
\n
\n \n", + "itemtype": "method", + "name": "cancel", + "static": 1, + "params": [ + { + "name": "timer", + "description": "Timer object to cancel", + "type": "Object" + } + ], + "return": { + "description": "true if canceled or false/undefined if it wasn't found", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 771, + "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

This 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n \n

Immediate allows you to run the function immediately, but debounce\nother calls for this function until the wait time has elapsed. If\ndebounce 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "debounce", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to false.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 868, + "description": "

Ensure that the target method is never called more frequently than\nthe specified spacing period. The target method is called immediately.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "throttle", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "spacing", + "description": "Number of milliseconds to space out requests.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to true.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 62, + "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.

\n", + "itemtype": "property", + "name": "queues", + "type": "Array", + "default": "['actions', 'destroy']", + "access": "private", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/renderer" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/runloop", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/service-3b19215466.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/service-3b19215466.json new file mode 100644 index 000000000..3e285383e --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/service-3b19215466.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/service", + "type": "class", + "attributes": { + "name": "@ember/service", + "shortname": "@ember/service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/service/index.ts", + "line": 10, + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + }, + { + "file": "packages/@ember/service/index.ts", + "line": 30, + "description": "

Creates a property that lazily looks up a service in the container. There are\nno restrictions as to what objects a service can be injected into.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service('auth') authManager;\n\n  model() {\n    return this.authManager.findCurrentUser();\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default Route.extend({\n  authManager: service('auth'),\n\n  model() {\n    return this.get('authManager').findCurrentUser();\n  }\n});
\n
\n
\n \n

This example will create an authManager property on the application route\nthat looks up the auth service in the container, making it easily accessible\nin the model hook.

\n", + "itemtype": "method", + "name": "service", + "static": 1, + "since": "4.1.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/template-fc5428f28d.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/template-fc5428f28d.json new file mode 100644 index 000000000..9da76c8bf --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/template-fc5428f28d.json @@ -0,0 +1,100 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/template", + "type": "class", + "attributes": { + "name": "@ember/template", + "shortname": "@ember/template", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/template", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/utils/managers.ts", + "line": 9, + "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).

\n", + "itemtype": "method", + "name": "setComponentManager", + "params": [ + { + "name": "factory", + "description": "a function to create the owner for an object", + "type": "Function" + }, + { + "name": "obj", + "description": "the object to associate with the componetn manager", + "type": "Object" + } + ], + "return": { + "description": "the same object passed in", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 61, + "description": "

Use this method to indicate that a string should be rendered as HTML\nwhen the string is used in a template. To say this another way,\nstrings marked with htmlSafe will not be HTML escaped.

\n

A word of warning - The htmlSafe method does not make the string safe;\nit only tells the framework to treat the string as if it is safe to render\nas HTML. If a string contains user inputs or other untrusted\ndata, you must sanitize the string before using the htmlSafe method.\nOtherwise your code is vulnerable to\nCross-Site Scripting.\nThere are many open source sanitization libraries to choose from,\nboth for front end and server-side sanitization.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { htmlSafe } from '@ember/template';\n\nconst someTrustedOrSanitizedString = "<div>Hello!</div>"\n\nhtmlSafe(someTrustedorSanitizedString)
\n
\n
\n \n", + "itemtype": "method", + "name": "htmlSafe", + "static": 1, + "return": { + "description": "A string that will not be HTML escaped by Handlebars.", + "type": "SafeString" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 98, + "description": "

Detects if a string was decorated using htmlSafe.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { htmlSafe, isHTMLSafe } from '@ember/template';\n\nvar plainString = 'plain string',\n    safeString = htmlSafe('<div>someValue</div>');\n\nisHTMLSafe(plainString); // false\nisHTMLSafe(safeString);  // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isHTMLSafe", + "static": 1, + "return": { + "description": "`true` if the string was decorated with `htmlSafe`, `false` otherwise.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/template", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/test-21b861fae7.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/test-21b861fae7.json new file mode 100644 index 000000000..6c8a76184 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/test-21b861fae7.json @@ -0,0 +1,395 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/test", + "type": "class", + "attributes": { + "name": "@ember/test", + "shortname": "@ember/test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/test", + "namespace": "", + "methods": [ + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 64, + "description": "

This hook defers the readiness of the application, so that you can start\nthe app when your tests are ready to run. It also sets the router's\nlocation to 'none', so that the window's location will not be modified\n(preventing both accidental leaking of state between tests and interference\nwith your testing framework). setupForTesting should only be called after\nsetting a custom router class (for example App.Router = Router.extend().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.setupForTesting();
\n
\n
\n \n", + "itemtype": "method", + "name": "setupForTesting", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 103, + "description": "

This injects the test helpers into the helperContainer object. If an object is provided\nit will be used as the helperContainer. If helperContainer is not set it will default\nto window. If a function of the same name has already been defined it will be cached\n(so that it can be reset if the helper is removed with unregisterHelper or\nremoveTestHelpers).

\n

Any callbacks registered with onInjectHelpers will be called once the\nhelpers have been injected.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.injectTestHelpers();
\n
\n
\n \n", + "itemtype": "method", + "name": "injectTestHelpers", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 148, + "description": "

This removes all helpers that have been registered, and resets and functions\nthat were overridden by the helpers.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.removeTestHelpers();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "removeTestHelpers", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/helpers/current_path.ts", + "line": 9, + "description": "

Returns the current path.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentPath(), 'some.path.index', "correct path was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentPath", + "return": { + "description": "The currently active path.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_route_name.ts", + "line": 8, + "description": "

Returns the currently active route name.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
function validateRouteName() {\nequal(currentRouteName(), 'some.path', "correct route was transitioned into.");\n}\nvisit('/some/path').then(validateRouteName)
\n
\n
\n \n", + "itemtype": "method", + "name": "currentRouteName", + "return": { + "description": "The name of the currently active route.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_url.ts", + "line": 9, + "description": "

Returns the current URL.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentURL(), '/some/path', "correct URL was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentURL", + "return": { + "description": "The currently active URL.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.ts", + "line": 9, + "description": "

Resumes a test paused by pauseTest.

\n", + "itemtype": "method", + "name": "resumeTest", + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.ts", + "line": 22, + "description": "

Pauses the current test - this is useful for debugging while testing or for test-driving.\nIt allows you to inspect the state of your application at any point.\nExample (The test will pause before clicking the button):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('/')\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

You may want to turn off the timeout before pausing.

\n

qunit (timeout available to use as of 2.4.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nassert.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

mocha (timeout happens automatically as of ember-mocha v0.14.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nthis.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n", + "since": "1.9.0", + "itemtype": "method", + "name": "pauseTest", + "return": { + "description": "A promise that will never resolve", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/visit.ts", + "line": 6, + "description": "

Loads a route, sets up any controllers, and renders any templates associated\nwith the route as though a real user had triggered the route change while\nusing your app.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('posts/index').then(function() {\n  // assert something\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/wait.ts", + "line": 12, + "description": "

Causes the run loop to process any pending events. This is used to ensure that\nany async operations from other helpers (or your assertions) have been processed.

\n

This is most often used as the return value for the helper functions (see 'click',\n'fillIn','visit',etc). However, there is a method to register a test helper which\nutilizes this method without the need to actually call wait() in your helpers.

\n

The wait helper is built into registerAsyncHelper by default. You will not need\nto return app.testHelpers.wait(); - the wait behavior is provided for you.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('loginUser', function(app, username, password) {\n  visit('secured/path/here')\n    .fillIn('#username', username)\n    .fillIn('#password', password)\n    .click('.submit');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "wait", + "params": [ + { + "name": "value", + "description": "The value to be returned.", + "type": "Object" + } + ], + "return": { + "description": "Promise that resolves to the passed value.", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 15, + "description": "

registerHelper is used to register a test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

This helper can later be called without arguments because it will be\ncalled with app as the first parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nApp = Application.create();\nApp.injectTestHelpers();\nboot();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 59, + "description": "

registerAsyncHelper is used to register an async test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerAsyncHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterAsyncHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

The advantage of an async helper is that it will not run\nuntil the last async helper has completed. All async helpers\nafter it will wait for it complete before running.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('deletePost', function(app, postId) {\n  click('.delete-' + postId);\n});\n\n// ... in your test\nvisit('/post/2');\ndeletePost(2);\nvisit('/post/3');\ndeletePost(3);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerAsyncHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 112, + "description": "

Remove a previously added helper method.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { unregisterHelper } from '@ember/test';\n\nunregisterHelper('wait');
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregisterHelper", + "static": 1, + "params": [ + { + "name": "name", + "description": "The helper to remove.", + "type": "String" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 7, + "description": "

This allows ember-testing to play nicely with other asynchronous\nevents, such as an application that is waiting for a CSS3\ntransition or an IndexDB transaction. The waiter runs periodically\nafter each async helper (i.e. click, andThen, visit, etc) has executed,\nuntil the returning result is truthy. After the waiters finish, the next async helper\nis executed and the process repeats.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(function() {\n  return myPendingTransactions() === 0;\n});
\n
\n
\n \n

The context argument allows you to optionally specify the this\nwith which your callback will be invoked.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(MyDB, MyDB.hasPendingTransactions);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 66, + "description": "

unregisterWaiter is used to unregister a callback that was\nregistered with registerWaiter.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "unregisterWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 94, + "description": "

Iterates through each registered test waiter, and invokes\nits callback. If any waiter returns false, this method will return\ntrue indicating that the waiters have not settled yet.

\n

This is generally used internally from the acceptance/integration test\ninfrastructure.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "checkWaiters", + "class": "@ember/test", + "module": "@ember/test" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 23, + "description": "

This property contains the testing helpers for the current application. These\nare created once you call injectTestHelpers on your Application\ninstance. The included helpers are also available on the window object by\ndefault, but can be used from this object on the individual application also.

\n", + "itemtype": "property", + "name": "testHelpers", + "type": "{Object}", + "default": "{}", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 36, + "description": "

This property will contain the original methods that were registered\non the helperContainer before injectTestHelpers is called.

\n

When removeTestHelpers is called, these methods are restored to the\nhelperContainer.

\n", + "itemtype": "property", + "name": "originalMethods", + "type": "{Object}", + "default": "{}", + "access": "private", + "tagname": "", + "since": "1.3.0", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 51, + "description": "

This property indicates whether or not this application is currently in\ntesting mode. This is set when setupForTesting is called on the current\napplication.

\n", + "itemtype": "property", + "name": "testing", + "type": "{Boolean}", + "default": "false", + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 91, + "description": "

This will be used as the container to inject the test helpers into. By\ndefault the helpers are injected into window.

\n", + "itemtype": "property", + "name": "helperContainer", + "type": "{Object} The object to be used for test helpers.", + "default": "window", + "since": "1.2.0", + "access": "private", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/test", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/utils-8e1603069f.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/utils-8e1603069f.json new file mode 100644 index 000000000..70e136c26 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@ember/utils-8e1603069f.json @@ -0,0 +1,213 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/utils", + "type": "class", + "attributes": { + "name": "@ember/utils", + "shortname": "@ember/utils", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/utils", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/is_blank.ts", + "line": 5, + "description": "

A value is blank if it is empty or a whitespace string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "isBlank", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_empty.ts", + "line": 5, + "description": "

Verifies that a value is null or undefined, an empty string, or an empty\narray.

\n

Constrains the rules on isNone by returning true for empty strings and\nempty arrays.

\n

If the value is an object with a size property of type number, it is used\nto check emptiness.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
isEmpty(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
\n
\n \n", + "itemtype": "method", + "name": "isEmpty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_none.ts", + "line": 4, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
isNone(null);          // true\nisNone(undefined);     // true\nisNone('');            // false\nisNone([]);            // false\nisNone(function() {}); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isNone", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/metal/lib/is_present.ts", + "line": 5, + "description": "

A value is present if it not isBlank.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
isPresent(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
\n
\n \n", + "itemtype": "method", + "name": "isPresent", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.8.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/compare.ts", + "line": 53, + "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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { compare } from '@ember/utils';\n\ncompare('hello', 'hello');  // 0\ncompare('abc', 'dfg');      // -1\ncompare(2, 1);              // 1
\n
\n
\n \n

If 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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { compare } from '@ember/utils';\n\ncompare('hello', 50);       // 1\ncompare(50, 'hello');       // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "compare", + "static": 1, + "params": [ + { + "name": "v", + "description": "First value to compare", + "type": "Object" + }, + { + "name": "w", + "description": "Second value to compare", + "type": "Object" + } + ], + "return": { + "description": "-1 if v < w, 0 if v = w and 1 if v > w.", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/is-equal.ts", + "line": 4, + "description": "

Compares two objects, returning true if they are equal.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { isEqual } from '@ember/utils';\n\nisEqual('hello', 'hello');                   // true\nisEqual(1, 2);                               // false
\n
\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Due 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { isEqual } from '@ember/utils';\n\nisEqual([4, 2], [4, 2]);                     // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEqual", + "static": 1, + "params": [ + { + "name": "a", + "description": "first object to compare", + "type": "Object" + }, + { + "name": "b", + "description": "second object to compare", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/runtime/lib/type-of.ts", + "line": 40, + "description": "

Returns a consistent type for the passed object.

\n

Use 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\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
\n
\n \n

Examples:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "typeOf", + "params": [ + { + "name": "item", + "description": "the item to check" + } + ], + "return": { + "description": "the type", + "type": "String" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/utils", + "module": "@ember/utils" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/utils", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@glimmer/tracking-84c6c4ff55.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@glimmer/tracking-84c6c4ff55.json new file mode 100644 index 000000000..c26e35a05 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@glimmer/tracking-84c6c4ff55.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.7.1-@glimmer/tracking", + "type": "class", + "attributes": { + "name": "@glimmer/tracking", + "shortname": "@glimmer/tracking", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 22, + "description": "

Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are static, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>Count: {{this.count}}</div>\n<div>Times Ten: {{this.timesTen}}</div>\n<div>\n  <button {{on "click" this.plusOne}}>\n    Plus One\n  </button>\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class CounterComponent extends Component {\n  @tracked count = 0;\n\n  get timesTen() {\n    return this.count * 10;\n  }\n\n  @action\n  plusOne() {\n    this.count += 1;\n  }\n}
\n
\n
\n \n

Both the {{this.count}} and the {{this.timesTen}} properties in the\ntemplate will update whenever the button is clicked. Any tracked properties\nthat are used in any way to calculate a value that is used in the template\nwill cause a rerender when updated - this includes through method calls and\nother means:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nclass Entry {\n  @tracked name;\n  @tracked phoneNumber;\n\n  constructor(name, phoneNumber) {\n    this.name = name;\n    this.phoneNumber = phoneNumber;\n  }\n}\n\nexport default class PhoneBookComponent extends Component {\n  entries = [\n    new Entry('Pizza Palace', 5551234),\n    new Entry('1st Street Cleaners', 5554321),\n    new Entry('Plants R Us', 5552468),\n  ];\n\n  // Any usage of this property will update whenever any of the names in the\n  // entries arrays are updated\n  get names() {\n    return this.entries.map(e => e.name);\n  }\n\n  // Any usage of this property will update whenever any of the numbers in the\n  // entries arrays are updated\n  get numbers() {\n    return this.getFormattedNumbers();\n  }\n\n  getFormattedNumbers() {\n    return this.entries\n      .map(e => e.phoneNumber)\n      .map(number => {\n        let numberString = '' + number;\n\n        return numberString.slice(0, 3) + '-' + numberString.slice(3);\n      });\n  }\n}
\n
\n
\n \n

It's important to note that setting tracked properties will always trigger an\nupdate, even if the property is set to the same value as it was before.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let entry = new Entry('Pizza Palace', 5551234);\n\n// if entry was used when rendering, this would cause a rerender, even though\n// the name is being set to the same value as it was before\nentry.name = entry.name;
\n
\n
\n \n

tracked can also be used with the classic Ember object model in a similar\nmanner to classic computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked(),\n  phoneNumber: tracked()\n});
\n
\n
\n \n

Often this is unnecessary, but to ensure robust auto-tracking behavior it is\nadvisable to mark tracked state appropriately wherever possible.

\n

This form of tracked also accepts an optional configuration object\ncontaining either an initial value or an initializer function (but not\nboth).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked({ value: 'Zoey' }),\n  favoriteSongs: tracked({\n    initializer: () => ['Raspberry Beret', 'Time After Time']\n  })\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "tracked", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 158, + "description": "

Gives the getter a caching behavior. The return value of the getter\nwill be cached until any of the properties it is entangled with\nare invalidated. This is useful when a getter is expensive and\nused very often.

\n

For instance, in this GuestList class, we have the sortedGuests\ngetter that sorts the guests alphabetically:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
  import { tracked } from '@glimmer/tracking';\n\n  class GuestList {\n    @tracked guests = ['Zoey', 'Tomster'];\n\n    get sortedGuests() {\n      return this.guests.slice().sort()\n    }\n  }
\n
\n
\n \n

Every time sortedGuests is accessed, a new array will be created and sorted,\nbecause JavaScript getters do not cache by default. When the guest list\nis small, like the one in the example, this is not a problem. However, if\nthe guest list were to grow very large, it would mean that we would be doing\na large amount of work each time we accessed sortedGetters. With @cached,\nwe can cache the value instead:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
  import { tracked, cached } from '@glimmer/tracking';\n\n  class GuestList {\n    @tracked guests = ['Zoey', 'Tomster'];\n\n    @cached\n    get sortedGuests() {\n      return this.guests.slice().sort()\n    }\n  }
\n
\n
\n \n

Now the sortedGuests getter will be cached based on autotracking.\nIt will only rerun and create a new sorted array when the guests tracked\nproperty is updated.

\n

Tradeoffs

\n

Overuse is discouraged.

\n

In general, you should avoid using @cached unless you have confirmed that\nthe getter you are decorating is computationally expensive. @cached adds\na small amount of overhead to the getter, making it more expensive.\nWhile this overhead is small, if @cached is overused it can add up to a\nlarge impact overall in your app. Many getters and tracked properties\nare only accessed once, rendered, and then never rerendered, so adding\n@cached when it is unnecessary can negatively impact performance.

\n

Also, @cached may rerun even if the values themselves have not changed,\nsince tracked properties will always invalidate even if their underlying\nvalue did not change.\nFor example updating an integer value from 5 to an other 5.

\n

Avoiding a cache invalidation in this case is not something that can\nbe achieved on the @cached decorator itself, but rather when updating\nthe underlying values, by applying a diff checking mecanism:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
if (newValue !== this.trackedProp) {\n  this.trackedProp = newValue;\n}
\n
\n
\n \n

Here equal values won't update the property, therefore not triggering a\ncache invalidation.

\n

The cost of these edge-guards adds up to the tradoff calculation of using\na caching strategy, hence requiring a very sensitive approach regarding\nperformance.

\n", + "itemtype": "method", + "name": "cached", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@glimmer/tracking", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-@glimmer/tracking/primitives/cache-d7f839e797.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-@glimmer/tracking/primitives/cache-d7f839e797.json new file mode 100644 index 000000000..98f61f4d9 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-@glimmer/tracking/primitives/cache-d7f839e797.json @@ -0,0 +1,77 @@ +{ + "data": { + "id": "ember-4.7.1-@glimmer/tracking/primitives/cache", + "type": "class", + "attributes": { + "name": "@glimmer/tracking/primitives/cache", + "shortname": "@glimmer/tracking/primitives/cache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking/primitives/cache", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 14, + "description": "

Receives a function, and returns a wrapped version of it that memoizes based on\nautotracking. The function will only rerun whenever any tracked values used\nwithin it have changed. Otherwise, it will return the previous value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state. Now, `counter` will\n  // only rerun if `state.value` changes.\n  state.value;\n\n  return ++computeCount;\n});\n\ngetValue(counter); // 1\n\n// returns the same value because no tracked state has changed\ngetValue(counter); // 1\n\nstate.value = 'foo';\n\n// reruns because a tracked value used in the function has changed,\n// incermenting the counter\ngetValue(counter); // 2
\n
\n
\n \n", + "itemtype": "method", + "name": "createCache", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 56, + "description": "

Gets the value of a cache created with createCache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  return ++computeCount;\n});\n\ngetValue(counter); // 1
\n
\n
\n \n", + "itemtype": "method", + "name": "getValue", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 78, + "description": "

Can be used to check if a memoized function is constant. If no tracked state\nwas used while running a memoized function, it will never rerun, because nothing\ncan invalidate its result. isConst can be used to determine if a memoized\nfunction is constant or not, in order to optimize code surrounding that\nfunction.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue, isConst } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state\n  state.value;\n\n  return computeCount++;\n});\n\nlet constCounter = createCache(() => {\n  return computeCount++;\n});\n\ngetValue(counter);\ngetValue(constCounter);\n\nisConst(counter); // false\nisConst(constCounter); // true
\n
\n
\n \n

If called on a cache that hasn't been accessed yet, it will throw an\nerror. This is because there's no way to know if the function will be constant\nor not yet, and so this helps prevent missing an optimization opportunity on\naccident.

\n", + "itemtype": "method", + "name": "isConst", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@glimmer/tracking/primitives/cache", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Application-e17b29180b.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Application-e17b29180b.json new file mode 100644 index 000000000..fc09129ed --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Application-e17b29180b.json @@ -0,0 +1,799 @@ +{ + "data": { + "id": "ember-4.7.1-Application", + "type": "class", + "attributes": { + "name": "Application", + "shortname": "Application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/lib/application.ts", + "line": 34, + "description": "

An instance of Application is the starting point for every Ember\napplication. It instantiates, initializes and coordinates the\nobjects that make up your app.

\n

Each Ember app has one and only one Application object. Although\nEmber CLI creates this object implicitly, the Application class\nis defined in the app/app.js. You can define a ready method on the\nApplication class, which will be run by Ember when the application is\ninitialized.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
export default class App extends Application {\n  ready() {\n    // your code here\n  }\n}
\n
\n
\n \n

Because Application ultimately inherits from Ember.Namespace, any classes\nyou create will have useful string representations when calling toString().\nSee the Ember.Namespace documentation for more information.

\n

While you can think of your Application as a container that holds the\nother classes in your application, there are several other responsibilities\ngoing on under-the-hood that you may want to understand. It is also important\nto understand that an Application is different from an ApplicationInstance.\nRefer to the Guides to understand the difference between these.

\n

Event Delegation

\n

Ember uses a technique called event delegation. This allows the framework\nto set up a global, shared event listener instead of requiring each view to\ndo it manually. For example, instead of each view registering its own\nmousedown listener on its associated element, Ember sets up a mousedown\nlistener on the body.

\n

If a mousedown event occurs, Ember will look at the target of the event and\nstart walking up the DOM node tree, finding corresponding views and invoking\ntheir mouseDown method as it goes.

\n

Application has a number of default events that it listens for, as\nwell as a mapping from lowercase events to camel-cased view method names. For\nexample, the keypress event causes the keyPress method on the view to be\ncalled, the dblclick event causes doubleClick to be called, and so on.

\n

If there is a bubbling browser event that Ember does not listen for by\ndefault, you can specify custom events and their corresponding view method\nnames by setting the application's customEvents property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nexport default class App extends Application {\n  customEvents = {\n    // add support for the paste event\n    paste: 'paste'\n  }\n}
\n
\n
\n \n

To prevent Ember from setting up a listener for a default event,\nspecify the event name with a null value in the customEvents\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nexport default class App extends Application {\n  customEvents = {\n    // prevent listeners for mouseenter/mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n}
\n
\n
\n \n

By default, the application sets up these event listeners on the document\nbody. However, in cases where you are embedding an Ember application inside\nan existing page, you may want it to set up the listeners on an element\ninside the body.

\n

For example, if only events inside a DOM element with the ID of ember-app\nshould be delegated, set your application's rootElement property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nexport default class App extends Application {\n  rootElement = '#ember-app'\n}
\n
\n
\n \n

The rootElement can be either a DOM element or a CSS selector\nstring. Note that views appended to the DOM outside the root element will\nnot receive events. If you specify a custom root element, make sure you only\nappend views inside it!

\n

To learn more about the events Ember components use, see

\n

components/handling-events.

\n

Initializers

\n

To add behavior to the Application's boot process, you can define initializers in\nthe app/initializers directory, or with ember generate initializer using Ember CLI.\nThese files should export a named initialize function which will receive the created application\nobject as its first argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
export function initialize(application) {\n  // application.inject('route', 'foo', 'service:foo');\n}
\n
\n
\n \n

Application initializers can be used for a variety of reasons including:

\n
    \n
  • setting up external libraries
  • \n
  • injecting dependencies
  • \n
  • setting up event listeners in embedded apps
  • \n
  • deferring the boot process using the deferReadiness and advanceReadiness APIs.
  • \n
\n

Routing

\n

In addition to creating your application's router, Application is\nalso responsible for telling the router when to start routing. Transitions\nbetween routes can be logged with the LOG_TRANSITIONS flag, and more\ndetailed intra-transition logging can be logged with\nthe LOG_TRANSITIONS_INTERNAL flag:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  LOG_TRANSITIONS: true, // basic logging of successful transitions\n  LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n});
\n
\n
\n \n

By default, the router will begin trying to translate the current URL into\napplication state once the browser emits the DOMContentReady event. If you\nneed to defer routing, you can call the application's deferReadiness()\nmethod. Once routing can begin, call the advanceReadiness() method.

\n

If there is any setup required before routing begins, you can implement a\nready() method on your app that will be invoked immediately before routing\nbegins.

\n", + "extends": "Engine", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/application/lib/application.ts", + "line": 188, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 435, + "description": "

Create an ApplicationInstance for this application.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the application instance", + "type": "ApplicationInstance" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 460, + "description": "

Start tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is created.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_watchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 471, + "description": "

Stop tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is about to be destroyed.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_unwatchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 484, + "description": "

Enable the legacy globals mode by allowing this application to act\nas a global namespace. See the docs on the _globalsMode property\nfor details.

\n

Most of these features are already deprecated in 1.x, so we can\nstop using them internally and try to remove them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareForGlobalsMode", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 531, + "description": "

Automatically kick-off the boot process for the application once the\nDOM has become ready.

\n

The initialization itself is scheduled on the actions queue which\nensures that code-loading finishes before booting.

\n

If you are asynchronously loading code, you should call deferReadiness()\nto defer booting, and then call advanceReadiness() once all of your code\nhas finished loading.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "waitForDOMReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 571, + "description": "

This is the autoboot flow:

\n
    \n
  1. Boot the app by calling this.boot()
  2. \n
  3. Create an instance (or use the __deprecatedInstance__ in globals mode)
  4. \n
  5. Boot the instance by calling instance.boot()
  6. \n
  7. Invoke the App.ready() callback
  8. \n
  9. Kick-off routing on the instance
  10. \n
\n

Ideally, this is all we would need to do:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
_autoBoot() {\n  this.boot().then(() => {\n    let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance();\n    return instance.boot();\n  }).then((instance) => {\n    App.ready();\n    instance.startRouting();\n  });\n}
\n
\n
\n \n

Unfortunately, we cannot actually write this because we need to participate\nin the "synchronous" boot process. While the code above would work fine on\nthe initial boot (i.e. DOM ready), when App.reset() is called, we need to\nboot a new instance synchronously (see the documentation on _bootSync()\nfor details).

\n

Because of this restriction, the actual logic of this method is located\ninside didBecomeReady().

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "domReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 616, + "description": "

Use this to defer readiness until some condition is true.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Application from '@ember/application';\n\nlet App = Application.create();\n\nApp.deferReadiness();\n\nfetch('/auth-token')\n.then(response => response.json())\n.then(data => {\n  App.token = data.token;\n  App.advanceReadiness();\n});
\n
\n
\n \n

This allows you to perform asynchronous setup logic and defer\nbooting your application until the setup has finished.

\n

However, if the setup requires a loading UI, it might be better\nto use the router for this purpose.

\n", + "itemtype": "method", + "name": "deferReadiness", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 666, + "description": "

Call advanceReadiness after any asynchronous setup logic has completed.\nEach call to deferReadiness must be matched by a call to advanceReadiness\nor the application will never become ready and routing will not begin.

\n", + "itemtype": "method", + "name": "advanceReadiness", + "see": [ + "{Application#deferReadiness}" + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 705, + "description": "

Initialize the application and return a promise that resolves with the Application\nobject when the boot process is complete.

\n

Run any application initializers and run the application load hook. These hooks may\nchoose to defer readiness. For example, an authentication hook might want to defer\nreadiness until the auth token has been retrieved.

\n

By default, this method is called automatically on "DOM ready"; however, if autoboot\nis disabled, this is automatically called when the first application instance is\ncreated via visit.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 786, + "description": "

Reset the application. This is typically used only in tests. It cleans up\nthe application in the following order:

\n
    \n
  1. Deactivate existing routes
  2. \n
  3. Destroy all objects in the container
  4. \n
  5. Create a new application container
  6. \n
  7. Re-route to the existing url
  8. \n
\n

Typical Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    App.reset();\n  }\n});\n\ntest('first test', function() {\n  // App is freshly reset\n});\n\ntest('second test', function() {\n  // App is again freshly reset\n});
\n
\n
\n \n

Advanced Example:

\n

Occasionally you may want to prevent the app from initializing during\nsetup. This could enable extra configuration, or enable asserting prior\nto the app becoming ready.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    run(function() {\n      App.reset();\n      App.deferReadiness();\n    });\n  }\n});\n\ntest('first test', function() {\n  ok(true, 'something before app is initialized');\n\n  run(function() {\n    App.advanceReadiness();\n  });\n\n  ok(true, 'something after app is initialized');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reset", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 890, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "didBecomeReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 968, + "description": "

Boot a new instance of ApplicationInstance for the current\napplication and navigate it to the given url. Returns a Promise that\nresolves with the instance when the initial routing and rendering is\ncomplete, or rejects with any error that occurred during the boot process.

\n

When autoboot is disabled, calling visit would first cause the\napplication to boot, which runs the application initializers.

\n

This method also takes a hash of boot-time configuration options for\ncustomizing the instance's behavior. See the documentation on\nApplicationInstance.BootOptions for details.

\n

ApplicationInstance.BootOptions is an interface class that exists\npurely to document the available options; you do not need to construct it\nmanually. Simply pass a regular JavaScript object containing of the\ndesired options:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Supported Scenarios

\n

While the BootOptions class exposes a large number of knobs, not all\ncombinations of them are valid; certain incompatible combinations might\nresult in unexpected behavior.

\n

For example, booting the instance in the full browser environment\nwhile specifying a foreign document object (e.g. { isBrowser: true, document: iframe.contentDocument }) does not work correctly today,\nlargely due to Ember's jQuery dependency.

\n

Currently, there are three officially supported scenarios/configurations.\nUsages outside of these scenarios are not guaranteed to work, but please\nfeel free to file bug reports documenting your experience and any issues\nyou encountered to help expand support.

\n

Browser Applications (Manual Boot)

\n

The setup is largely similar to how Ember works out-of-the-box. Normally,\nEmber will boot a default instance for your Application on "DOM ready".\nHowever, you can customize this behavior by disabling autoboot.

\n

For example, this allows you to render a miniture demo of your application\ninto a specific area on your marketing website:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let options = {\n    // Override the router's location adapter to prevent it from updating\n    // the URL in the address bar\n    location: 'none',\n\n    // Override the default `rootElement` on the app to render into a\n    // specific `div` on the page\n    rootElement: '#demo'\n  };\n\n  // Start the app at the special demo URL\n  App.visit('/demo', options);\n});
\n
\n
\n \n

Or perhaps you might want to boot two instances of your app on the same\npage for a split-screen multiplayer experience:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let sessionId = MyApp.generateSessionID();\n\n  let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' });\n  let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' });\n\n  Promise.all([player1, player2]).then(() => {\n    // Both apps have completed the initial render\n    $('#loading').fadeOut();\n  });\n});
\n
\n
\n \n

Do note that each app instance maintains their own registry/container, so\nthey will run in complete isolation by default.

\n

Server-Side Rendering (also known as FastBoot)

\n

This setup allows you to run your Ember app in a server environment using\nNode.js and render its content into static HTML for SEO purposes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap);\n\nfunction renderURL(url) {\n  let dom = new SimpleDOM.Document();\n  let rootElement = dom.body;\n  let options = { isBrowser: false, document: dom, rootElement: rootElement };\n\n  return MyApp.visit(options).then(instance => {\n    try {\n      return HTMLSerializer.serialize(rootElement.firstChild);\n    } finally {\n      instance.destroy();\n    }\n  });\n}
\n
\n
\n \n

In this scenario, because Ember does not have access to a global document\nobject in the Node.js environment, you must provide one explicitly. In practice,\nin the non-browser environment, the stand-in document object only needs to\nimplement a limited subset of the full DOM API. The SimpleDOM library is known\nto work.

\n

Since there is no DOM access in the non-browser environment, you must also\nspecify a DOM Element object in the same document for the rootElement option\n(as opposed to a selector string like "body").

\n

See the documentation on the isBrowser, document and rootElement properties\non ApplicationInstance.BootOptions for details.

\n

Server-Side Resource Discovery

\n

This setup allows you to run the routing layer of your Ember app in a server\nenvironment using Node.js and completely disable rendering. This allows you\nto simulate and discover the resources (i.e. AJAX requests) needed to fulfill\na given request and eagerly "push" these resources to the client.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
service.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import BrowserNetworkService from 'app/services/network/browser';\nimport NodeNetworkService from 'app/services/network/node';\n\n// Inject a (hypothetical) service for abstracting all AJAX calls and use\n// the appropriate implementation on the client/server. This also allows the\n// server to log all the AJAX calls made during a particular request and use\n// that for resource-discovery purpose.\n\nexport function initialize(application) {\n  if (window) { // browser\n    application.register('service:network', BrowserNetworkService);\n  } else { // node\n    application.register('service:network', NodeNetworkService);\n  }\n};\n\nexport default {\n  name: 'network-service',\n  initialize: initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\n// An example of how the (hypothetical) service is used in routes.\n\nexport default class IndexRoute extends Route {\n  @service network;\n\n  model(params) {\n    return this.network.fetch(`/api/posts/${params.post_id}.json`);\n  }\n\n  afterModel(post) {\n    if (post.isExternalContent) {\n      return this.network.fetch(`/api/external/?url=${post.externalURL}`);\n    } else {\n      return post;\n    }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
// Finally, put all the pieces together\n\nfunction discoverResourcesFor(url) {\n  return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => {\n    let networkService = instance.lookup('service:network');\n    return networkService.requests; // => { "/api/posts/123.json": "..." }\n  });\n}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "The initial URL to navigate to", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "ApplicationInstance.BootOptions" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 62, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 209, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 285, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 346, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 359, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 371, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 384, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 392, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 400, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 414, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 448, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Enginer" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 51, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + } + ], + "events": [ + { + "file": "packages/@ember/application/lib/application.ts", + "line": 943, + "description": "

Called when the Application has become ready, immediately before routing\nbegins. The call will be delayed until the DOM has become ready.

\n", + "itemtype": "event", + "name": "ready", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + } + ], + "properties": [ + { + "file": "packages/@ember/application/lib/application.ts", + "line": 233, + "description": "

The root DOM element of the Application. This can be specified as an\nelement or a selector string.

\n

This is the element that will be passed to the Application's,\neventDispatcher, which sets up the listeners for event delegation. Every\nview in your application should be a child of the element you specify here.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 248, + "itemtype": "property", + "name": "_document", + "type": "Document | null", + "default": "'window.document'", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 257, + "description": "

The Ember.EventDispatcher responsible for delegating events to this\napplication's views.

\n

The event dispatcher is created by the application at initialization time\nand sets up event listeners on the DOM element described by the\napplication's rootElement property.

\n

See the documentation for Ember.EventDispatcher for more information.

\n", + "itemtype": "property", + "name": "eventDispatcher", + "type": "Ember.EventDispatcher", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 274, + "description": "

The DOM events for which the event dispatcher should listen.

\n

By default, the application's Ember.EventDispatcher listens\nfor a set of standard DOM events, such as mousedown and\nkeyup, and delegates them to your application's Ember.View\ninstances.

\n

If you would like additional bubbling events to be delegated to your\nviews, set your Application's customEvents property\nto a hash containing the DOM event name as the key and the\ncorresponding view method name as the value. Setting an event to\na value of null will prevent a default event listener from being\nadded for that event.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // add support for the paste event\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // remove support for mouseenter / mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "customEvents", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 322, + "description": "

Whether the application should automatically start routing and render\ntemplates to the rootElement on DOM ready. While default by true,\nother environments such as FastBoot or a testing harness can set this\nproperty to false and control the precise timing and behavior of the boot\nprocess.

\n", + "itemtype": "property", + "name": "autoboot", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 336, + "description": "

Whether the application should be configured for the legacy "globals mode".\nUnder this mode, the Application object serves as a global namespace for all\nclasses.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Application from '@ember/application';\nimport Component from '@ember/component';\n\nlet App = Application.create({\n  ...\n});\n\nApp.Router.reopen({\n  location: 'none'\n});\n\nApp.Router.map({\n  ...\n});\n\nApp.MyComponent = Component.extend({\n  ...\n});
\n
\n
\n \n

This flag also exposes other internal APIs that assumes the existence of\na special "default instance", like App.__container__.lookup(...).

\n

This option is currently not configurable, its value is derived from\nthe autoboot flag – disabling autoboot also implies opting-out of\nglobals mode support, although they are ultimately orthogonal concerns.

\n

Some of the global modes features are already deprecated in 1.x. The\nexistence of this flag is to untangle the globals mode code paths from\nthe autoboot code paths, so that these legacy features can be reviewed\nfor deprecation/removal separately.

\n

Forcing the (autoboot=true, _globalsMode=false) here and running the tests\nwould reveal all the places where we are still relying on these legacy\nbehavior internally (mostly just tests).

\n", + "itemtype": "property", + "name": "_globalsMode", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/application.ts", + "line": 385, + "description": "

An array of application instances created by buildInstance(). Used\ninternally to ensure that all instances get destroyed.

\n", + "itemtype": "property", + "name": "_applicationInstances", + "type": "Array", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 325, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 338, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-Engine", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-ApplicationInstance-25b4f1b8b7.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-ApplicationInstance-25b4f1b8b7.json new file mode 100644 index 000000000..d0c0b61a5 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-ApplicationInstance-25b4f1b8b7.json @@ -0,0 +1,1052 @@ +{ + "data": { + "id": "ember-4.7.1-ApplicationInstance", + "type": "class", + "attributes": { + "name": "ApplicationInstance", + "shortname": "ApplicationInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/instance.ts", + "line": 29, + "description": "

The ApplicationInstance encapsulates all of the stateful aspects of a\nrunning Application.

\n

At a high-level, we break application boot into two distinct phases:

\n
    \n
  • Definition time, where all of the classes, templates, and other\ndependencies are loaded (typically in the browser).
  • \n
  • Run time, where we begin executing the application once everything\nhas loaded.
  • \n
\n

Definition time can be expensive and only needs to happen once since it is\nan idempotent operation. For example, between test runs and FastBoot\nrequests, the application stays the same. It is only the state that we want\nto reset.

\n

That state is what the ApplicationInstance manages: it is responsible for\ncreating the container that contains all application state, and disposing of\nit once the particular test run or FastBoot request has finished.

\n", + "access": "public", + "tagname": "", + "extends": "EngineInstance", + "methods": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 306, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 39, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 86, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 152, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 169, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 199, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 39, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 65, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 126, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 51, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 55, + "description": "

The Application for which this is an instance.

\n", + "itemtype": "property", + "name": "application", + "type": "Application", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 63, + "description": "

The root DOM element of the Application as an element or a\nCSS selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "String|DOMElement", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 47, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 31, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-EngineInstance", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-ApplicationInstance.BootOptions-e527a192b8.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-ApplicationInstance.BootOptions-e527a192b8.json new file mode 100644 index 000000000..e79e56e9b --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-ApplicationInstance.BootOptions-e527a192b8.json @@ -0,0 +1,143 @@ +{ + "data": { + "id": "ember-4.7.1-ApplicationInstance.BootOptions", + "type": "class", + "attributes": { + "name": "ApplicationInstance.BootOptions", + "shortname": "ApplicationInstance.BootOptions", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "ApplicationInstance", + "file": "packages/@ember/application/instance.ts", + "line": 326, + "description": "

A list of boot-time configuration options for customizing the behavior of\nan ApplicationInstance.

\n

This is an interface class that exists purely to document the available\noptions; you do not need to construct it manually. Simply pass a regular\nJavaScript object containing the desired options into methods that require\none of these options object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Not all combinations of the supported options are valid. See the documentation\non Application#visit for the supported configurations.

\n

Internal, experimental or otherwise unstable flags are marked as private.

\n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 349, + "description": "

Interactive mode: whether we need to set up event delegation and invoke\nlifecycle callbacks on Components.

\n", + "itemtype": "property", + "name": "isInteractive", + "type": "boolean", + "default": "auto-detected", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 360, + "itemtype": "property", + "name": "_renderMode", + "type": "string", + "default": "undefined", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 368, + "description": "

Run in a full browser environment.

\n

When this flag is set to false, it will disable most browser-specific\nand interactive features. Specifically:

\n
    \n
  • It does not use jQuery to append the root view; the rootElement\n(either specified as a subsequent option or on the application itself)\nmust already be an Element in the given document (as opposed to a\nstring selector).

    \n
  • \n
  • It does not set up an EventDispatcher.

    \n
  • \n
  • It does not run any Component lifecycle hooks (such as didInsertElement).

    \n
  • \n
  • It sets the location option to "none". (If you would like to use\nthe location adapter specified in the app's router instead, you can also\nspecify { location: null } to specifically opt-out.)

    \n
  • \n
\n", + "itemtype": "property", + "name": "isBrowser", + "type": "boolean", + "default": "auto-detected", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 394, + "description": "

If present, overrides the router's location property with this\nvalue. This is useful for environments where trying to modify the\nURL would be inappropriate.

\n", + "itemtype": "property", + "name": "location", + "type": "string", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 406, + "description": "

Disable rendering completely.

\n

When this flag is set to false, it will disable the entire rendering\npipeline. Essentially, this puts the app into "routing-only" mode. No\ntemplates will be rendered, and no Components will be created.

\n", + "itemtype": "property", + "name": "shouldRender", + "type": "boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 420, + "description": "

If present, render into the given Document object instead of the\nglobal window.document object.

\n

In practice, this is only useful in non-browser environment or in\nnon-interactive mode, because Ember's jQuery dependency is\nimplicitly bound to the current document, causing event delegation\nto not work properly when the app is rendered into a foreign\ndocument object (such as an iframe's contentDocument).

\n

In non-browser mode, this could be a "Document-like" object as\nEmber only interact with a small subset of the DOM API in non-\ninteractive mode. While the exact requirements have not yet been\nformalized, the SimpleDOM library's implementation is known to\nwork.

\n", + "itemtype": "property", + "name": "document", + "type": "Document", + "default": "the global `document` object", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 443, + "description": "

If present, overrides the application's rootElement property on\nthe instance. This is useful for testing environment, where you\nmight want to append the root view to a fixture area.

\n

In non-browser mode, because Ember does not have access to jQuery,\nthis options must be specified as a DOM Element object instead of\na selector string.

\n

See the documentation on Application's rootElement for\ndetails.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "String|Element", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-ArrayProxy-64ffe4ae7e.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-ArrayProxy-64ffe4ae7e.json new file mode 100644 index 000000000..e8aacd2b0 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-ArrayProxy-64ffe4ae7e.json @@ -0,0 +1,1834 @@ +{ + "data": { + "id": "ember-4.7.1-ArrayProxy", + "type": "class", + "attributes": { + "name": "ArrayProxy", + "shortname": "ArrayProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.ts", + "line": 51, + "description": "

An ArrayProxy wraps any other object that implements Array and/or\nMutableArray, forwarding all requests. This makes it very useful for\na number of binding use cases or other cases where being able to swap\nout the underlying array is useful.

\n

A simple example of usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({ content: A(pets) });\n\nap.get('firstObject');                        // 'dog'\nap.set('content', ['amoeba', 'paramecium']);\nap.get('firstObject');                        // 'amoeba'
\n
\n
\n \n

This class can also be useful as a layer to transform the contents of\nan array, as they are accessed. This can be done by overriding\nobjectAtContent:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({\n    content: A(pets),\n    objectAtContent: function(idx) {\n        return this.get('content').objectAt(idx).toUpperCase();\n    }\n});\n\nap.get('firstObject'); // . 'DOG'
\n
\n
\n \n

When overriding this class, it is important to place the call to\n_super after setting content so the internal observers have\na chance to fire properly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nexport default ArrayProxy.extend({\n  init() {\n    this.set('content', A(['dog', 'cat', 'fish']));\n    this._super(...arguments);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.ts", + "line": 176, + "description": "

Should actually retrieve the object at the specified index from the\ncontent. You can override this method in subclasses to transform the\ncontent item to something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "objectAtContent", + "params": [ + { + "name": "idx", + "description": "The index to retrieve.", + "type": "Number" + } + ], + "return": { + "description": "the value or undefined if none found", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.ts", + "line": 204, + "description": "

Should actually replace the specified objects on the content array.\nYou can override this method in subclasses to transform the content item\ninto something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "replaceContent", + "params": [ + { + "name": "idx", + "description": "The starting index", + "type": "Number" + }, + { + "name": "amt", + "description": "The number of items to remove from the content.", + "type": "Number" + }, + { + "name": "objects", + "description": "Optional array of objects to insert.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1496, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1515, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1541, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1563, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1588, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1608, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1628, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1654, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1679, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1699, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1720, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1739, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1766, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1794, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1812, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1838, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 329, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 354, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 438, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 481, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 523, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 577, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 637, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 660, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 683, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 731, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 752, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 829, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 881, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 906, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 934, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 981, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1015, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1057, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1101, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1145, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1175, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1246, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1285, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1297, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1313, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1346, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1390, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1409, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1431, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.ts", + "line": 164, + "description": "

The content array. Must be an object that implements Array and/or\nMutableArray.

\n", + "itemtype": "property", + "name": "content", + "type": "EmberArray", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/array_proxy.ts", + "line": 393, + "description": "

The array that the proxy pretends to be. In the default ArrayProxy\nimplementation, this and content are the same. Subclasses of ArrayProxy\ncan override this property to provide things like sorting and filtering.

\n", + "itemtype": "property", + "name": "arrangedContent", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 319, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 373, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 401, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 426, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Component-baee620d1f.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Component-baee620d1f.json new file mode 100644 index 000000000..256afb866 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Component-baee620d1f.json @@ -0,0 +1,1587 @@ +{ + "data": { + "id": "ember-4.7.1-Component", + "type": "class", + "attributes": { + "name": "Component", + "shortname": "Component", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 39, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault component's for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Classic components. If you are looking for the\nAPI documentation for Template-only or Glimmer components, it is\navailable here.

\n

Defining a Classic Component

\n

If you want to customize the component in order to handle events, transform\narguments or maintain internal state, you implement a subclass of Component.

\n

One example is to add computed properties to your component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  displayName: computed('person.title', 'person.firstName', 'person.lastName', function() {\n    let { title, firstName, lastName } = this.person;\n\n    if (title) {\n      return `${title} ${lastName}`;\n    } else {\n      return `${firstName} ${lastName}`;\n    }\n  })\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

Customizing a Classic Component's HTML Element in JavaScript

\n

HTML Tag

\n

The default HTML tag name used for a component's HTML representation is div.\nThis can be customized by setting the tagName property.

\n

Consider the following component class:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
paragraph.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'em'\n});
\n
\n
\n \n

When invoked, this component would produce output that looks something like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<em id="ember1" class="ember-view"></em>
\n
\n
\n \n

HTML class Attribute

\n

The HTML class attribute of a component's tag can be set by providing a\nclassNames property that is set to an array of strings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class']\n});
\n
\n
\n \n

Invoking this component will produce output that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class"></div>
\n
\n
\n \n

class attribute values can also be set by providing a classNameBindings\nproperty set to an array of properties names for the component. The return\nvalue of these properties will be added as part of the value for the\ncomponents's class attribute. These properties can be computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class'],\n  classNameBindings: ['propertyA', 'propertyB'],\n\n  propertyA: 'from-a',\n  propertyB: computed(function() {\n    if (someLogic) { return 'from-b'; }\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

Note that classNames and classNameBindings is in addition to the class\nattribute passed with the angle bracket invocation syntax. Therefore, if this\ncomponent was invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyWidget class="from-invocation" />
\n
\n
\n \n

The resulting HTML will look similar to this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="from-invocation ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

If the value of a class name binding returns a boolean the property name\nitself will be used as the class name if the property is true. The class name\nwill not be added if the value is false or undefined.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['hovered'],\n\n  hovered: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view hovered"></div>
\n
\n
\n \n

Custom Class Names for Boolean Values

\n

When using boolean class name bindings you can supply a string value other\nthan the property name for use as the class HTML attribute by appending the\npreferred value after a ":" character when defining the binding:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['awesome:so-very-cool'],\n\n  awesome: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view so-very-cool"></div>
\n
\n
\n \n

Boolean value class name bindings whose property names are in a\ncamelCase-style format will be converted to a dasherized format:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isUrgent'],\n\n  isUrgent: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view is-urgent"></div>
\n
\n
\n \n

Class name bindings can also refer to object values that are found by\ntraversing a path relative to the component itself:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport EmberObject from '@ember/object';\n\nexport default Component.extend({\n  classNameBindings: ['messages.empty'],\n\n  messages: EmberObject.create({\n    empty: true\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view empty"></div>
\n
\n
\n \n

If you want to add a class name for a property which evaluates to true and\nand a different class name if it evaluates to false, you can pass a binding\nlike this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isEnabled:enabled:disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view enabled"></div>
\n
\n
\n \n

When isEnabled is false, the resulting HTML representation looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

This syntax offers the convenience to add a class if a property is false:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\n// Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\nexport default Component.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component when the isEnabled property is true will produce\nHTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view"></div>
\n
\n
\n \n

Invoking it when the isEnabled property on the component is false will\nproduce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

Updates to the value of a class name binding will result in automatic update\nof the HTML class attribute in the component's rendered HTML\nrepresentation. If the value becomes false or undefined the class name\nwill be removed.

\n

Both classNames and classNameBindings are concatenated properties. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Other HTML Attributes

\n

The HTML attribute section of a component's tag can be set by providing an\nattributeBindings property set to an array of property names on the component.\nThe return value of these properties will be used as the value of the component's\nHTML associated attribute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['href'],\n\n  href: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

One property can be mapped on to another by placing a ":" between\nthe source property and the destination property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['url:href'],\n\n  url: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

HTML attributes passed with angle bracket invocations will take precedence\nover those specified in attributeBindings. Therefore, if this component was\ninvoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyAnchor href="http://bing.com" @url="http://google.com" />
\n
\n
\n \n

The resulting HTML will looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://bing.com"></a>
\n
\n
\n \n

Note that the href attribute is ultimately set to http://bing.com,\ndespite it having attribute binidng to the url property, which was\nset to http://google.com.

\n

Namespaced attributes (e.g. xlink:href) are supported, but have to be\nmapped, since : is not a valid character for properties in Javascript:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
use.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'use',\n  attributeBindings: ['xlinkHref:xlink:href'],\n\n  xlinkHref: '#triangle'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<use xlink:href="#triangle"></use>
\n
\n
\n \n

If the value of a property monitored by attributeBindings is a boolean, the\nattribute will be present or absent depending on the value:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: false\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id="ember1" class="ember-view" />
\n
\n
\n \n

attributeBindings can refer to computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: computed(function() {\n    if (someLogic) {\n      return true;\n    } else {\n      return false;\n    }\n  })\n});
\n
\n
\n \n

To prevent setting an attribute altogether, use null or undefined as the\nvalue of the property used in attributeBindings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'form',\n  attributeBindings: ['novalidate'],\n  novalidate: null\n});
\n
\n
\n \n

Updates to the property of an attribute binding will result in automatic\nupdate of the HTML attribute in the component's HTML output.

\n

attributeBindings is a concatenated property. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Layouts

\n

The layout property can be used to dynamically specify a template associated\nwith a component class, instead of relying on Ember to link together a\ncomponent class and a template based on file names.

\n

In general, applications should not use this feature, but it's commonly used\nin addons for historical reasons.

\n

The layout property should be set to the default export of a template\nmodule, which is the name of a template file without the .hbs extension.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>Person's Title</h1>\n<div class='details'>{{yield}}</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n
  import Component from '@ember/component';\n  import layout from '../templates/components/person-profile';\n\n  export default Component.extend({\n    layout\n  });
\n
\n
\n \n

If you invoke the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile>\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</PersonProfile>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#person-profile}}\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n{{/person-profile}}
\n
\n
\n \n

It will result in the following HTML output:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<h1>Person's Title</h1>\n  <div class="details">\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</div>
\n
\n
\n \n

Handling Browser Events

\n

Components can respond to user-initiated events in one of three ways: passing\nactions with angle bracket invocation, adding event handler methods to the\ncomponent's class, or adding actions to the component's template.

\n

Passing Actions With Angle Bracket Invocation

\n

For one-off events specific to particular instance of a component, it is possible\nto pass actions to the component's element using angle bracket invocation syntax.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyWidget {{action 'firstWidgetClicked'}} />\n\n<MyWidget {{action 'secondWidgetClicked'}} />
\n
\n
\n \n

In this case, when the first component is clicked on, Ember will invoke the\nfirstWidgetClicked action. When the second component is clicked on, Ember\nwill invoke the secondWidgetClicked action instead.

\n

Besides {{action}}, it is also possible to pass any arbitrary element modifiers\nusing the angle bracket invocation syntax.

\n

Event Handler Methods

\n

Components can also respond to user-initiated events by implementing a method\nthat matches the event name. This approach is appropriate when the same event\nshould be handled by all instances of the same component.

\n

An event object will be passed as the argument to the event handler method.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click(event) {\n    // `event.target` is either the component's element or one of its children\n    let tag = event.target.tagName.toLowerCase();\n    console.log('clicked on a `<${tag}>` HTML element!');\n  }\n});
\n
\n
\n \n

In this example, whenever the user clicked anywhere inside the component, it\nwill log a message to the console.

\n

It is possible to handle event types other than click by implementing the\nfollowing event handler methods. In addition, custom events can be registered\nby using Application.customEvents.

\n

Touch events:

\n
    \n
  • touchStart
  • \n
  • touchMove
  • \n
  • touchEnd
  • \n
  • touchCancel
  • \n
\n

Keyboard events:

\n
    \n
  • keyDown
  • \n
  • keyUp
  • \n
  • keyPress
  • \n
\n

Mouse events:

\n
    \n
  • mouseDown
  • \n
  • mouseUp
  • \n
  • contextMenu
  • \n
  • click
  • \n
  • doubleClick
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
\n

Form events:

\n
    \n
  • submit
  • \n
  • change
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
  • input
  • \n
\n

Drag and drop events:

\n
    \n
  • dragStart
  • \n
  • drag
  • \n
  • dragEnter
  • \n
  • dragLeave
  • \n
  • dragOver
  • \n
  • dragEnd
  • \n
  • drop
  • \n
\n

{{action}} Helper

\n

Instead of handling all events of a particular type anywhere inside the\ncomponent's element, you may instead want to limit it to a particular\nelement in the component's template. In this case, it would be more\nconvenient to implement an action instead.

\n

For example, you could implement the action hello for the person-profile\ncomponent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  actions: {\n    hello(name) {\n      console.log("Hello", name);\n    }\n  }\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
<h1>{{@person.name}}</h1>\n\n<button {{action 'hello' @person.name}}>\n  Say Hello to {{@person.name}}\n</button>
\n
\n
\n \n

When the user clicks the button, Ember will invoke the hello action,\npassing in the current value of @person.name as an argument.

\n

See Ember.Templates.helpers.action.

\n", + "extends": "Ember.CoreView", + "uses": [ + "Ember.ViewStateSupport", + "Ember.ViewMixin", + "Ember.ActionSupport", + "Ember.ClassNamesSupport", + "Ember.TargetActionSupport" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 656, + "description": "

Called when the attributes passed into the component have been updated.\n Called both during the initial render of a container and during a rerender.\n Can be used in place of an observer; code placed here will be executed\n every time any attribute updates.

\n", + "itemtype": "method", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 677, + "description": "

Called after a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "method", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 694, + "description": "

Called before a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "method", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 711, + "description": "

Called when the attributes passed into the component have been changed.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 728, + "description": "

Called when the component is about to update and rerender itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 745, + "description": "

Called when the component has updated and rerendered itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 951, + "description": "

Normally, Ember's component model is "write-only". The component takes a\nbunch of attributes that it got passed in, and uses them to render its\ntemplate.

\n

One nice thing about this model is that if you try to set a value to the\nsame thing as last time, Ember (through HTMLBars) will avoid doing any\nwork on the DOM.

\n

This is not just a performance optimization. If an attribute has not\nchanged, it is important not to clobber the element's "hidden state".\nFor example, if you set an input's value to the same value as before,\nit will clobber selection state and cursor position. In other words,\nsetting an attribute is not always idempotent.

\n

This method provides a way to read an element's attribute and also\nupdate the last value Ember knows about at the same time. This makes\nsetting an attribute idempotent.

\n

In particular, what this means is that if you get an <input> element's\nvalue attribute and then re-render the template with the same value,\nit will avoid clobbering the cursor and selection position.\nSince most attribute sets are idempotent in the browser, you typically\ncan get away with reading attributes using jQuery, but the most reliable\nway to do so is through this method.

\n", + "itemtype": "method", + "name": "readDOMAttr", + "params": [ + { + "name": "name", + "description": "the name of the attribute", + "type": "String" + } + ], + "return": { + "description": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 36, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 58, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 78, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 110, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 153, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 162, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 177, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 193, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 209, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 75, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 92, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 120, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 140, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 180, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 245, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 330, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 404, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 438, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 51, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.TargetActionSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 171, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 95, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 121, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 142, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 165, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 180, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 428, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Mixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 667, + "description": "

Called when the attributes passed into the component have been updated.\n Called both during the initial render of a container and during a rerender.\n Can be used in place of an observer; code placed here will be executed\n every time any attribute updates.

\n", + "itemtype": "event", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 686, + "description": "

Called after a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "event", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 703, + "description": "

Called before a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "event", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 720, + "description": "

Called when the attributes passed into the component have been changed.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 737, + "description": "

Called when the component is about to update and rerender itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 754, + "description": "

Called when the component has updated and rerendered itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 299, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 307, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 320, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 344, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 357, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 365, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 762, + "description": "

The HTML id of the component's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent @elementId="a-really-cool-id" />
\n
\n
\n \n

If not manually set a default value will be provided by the framework.\nOnce rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
export default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    var index = this.get('index');\n    this.set('elementId', `component-id${index}`);\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1011, + "description": "

Layout can be used to wrap content in a component.

\n", + "itemtype": "property", + "name": "layout", + "type": "Function", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1019, + "description": "

The name of the layout to lookup if no layout is provided.\nBy default Component will lookup a template with this name in\nEmber.TEMPLATES (a shared global object).

\n", + "itemtype": "property", + "name": "layoutName", + "type": "String", + "default": "undefined", + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1030, + "description": "

The WAI-ARIA role of the control represented by this view. For example, a\n button may have a role of type 'button', or a pane may have a role of\n type 'alertdialog'. This property is used by assistive software to help\n visually challenged users navigate rich web applications.

\n

The full list of valid WAI-ARIA roles is available at:\n https://www.w3.org/TR/wai-aria/#roles_categorization

\n", + "itemtype": "property", + "name": "ariaRole", + "type": "String", + "default": "undefined", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1055, + "description": "

Enables components to take a list of parameters as arguments.\n For example, a component that takes two parameters with the names\n name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: ['name', 'age']\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" 38}}
\n
\n
\n \n

The parameters can be referred to just like named parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Name: {{name}}, Age: {{age}}.
\n
\n
\n \n

Using a string instead of an array allows for an arbitrary number of\n parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: 'names'\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" "Michael" "Scott"}}
\n
\n
\n \n

The parameters can then be referred to by enumerating over the list:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{#each names as |name|}}{{name}}{{/each}}
\n
\n
\n \n", + "static": 1, + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "positionalParams", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 36, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 34, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 165, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 266, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 377, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/child_views_support.ts", + "line": 13, + "description": "

Array of child views. You should never edit this array directly.

\n", + "itemtype": "property", + "name": "childViews", + "type": "Array", + "default": "[]", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 35, + "description": "

Standard CSS class names to apply to the view's outer element. This\nproperty automatically inherits any class names defined by the view's\nsuperclasses as well.

\n", + "itemtype": "property", + "name": "classNames", + "type": "Array", + "default": "['ember-view']", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 47, + "description": "

A list of properties of the view to apply as class names. If the property\nis a string value, the value of that string will be applied as a class\nname.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'high' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['priority'],\n  priority: 'high'\n});
\n
\n
\n \n

If the value of the property is a Boolean, the name of that property is\nadded as a dasherized class name.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'is-urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would prefer to use a custom value instead of the dasherized\nproperty name, you can pass a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent:urgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would like to specify a class that should only be added when the\nproperty is false, you can declare a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'disabled' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: false\n});
\n
\n
\n \n

This list of properties is inherited from the component's superclasses as well.

\n", + "itemtype": "property", + "name": "classNameBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 26, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-Ember.CoreView", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-ComputedProperty-8d5f02fac0.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-ComputedProperty-8d5f02fac0.json new file mode 100644 index 000000000..bda20cad8 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-ComputedProperty-8d5f02fac0.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-4.7.1-ComputedProperty", + "type": "class", + "attributes": { + "name": "ComputedProperty", + "shortname": "ComputedProperty", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 77, + "description": "

@computed is a decorator that turns a JavaScript getter and setter into a\ncomputed property, which is a cached, trackable value. By default the getter\nwill only be called once and the result will be cached. You can specify\nvarious properties that your computed property depends on. This will force the\ncached result to be cleared if the dependencies are modified, and lazily recomputed the next time something asks for it.

\n

In the following example we decorate a getter - fullName - by calling\ncomputed with the property dependencies (firstName and lastName) as\narguments. The fullName getter will be called once (regardless of how many\ntimes it is accessed) as long as its dependencies do not change. Once\nfirstName or lastName are updated any future calls to fullName will\nincorporate the new values, and any watchers of the value such as templates\nwill be updated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet tom = new Person('Tom', 'Dale');\n\ntom.fullName; // 'Tom Dale'
\n
\n
\n \n

You can also provide a setter, which will be used when updating the computed\nproperty. Ember's set function must be used to update the property\nsince it will also notify observers of the property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(' ');\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

You can also pass a getter function or object with get and set functions\nas the last argument to the computed decorator. This allows you to define\ncomputed property macros:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { computed } from '@ember/object';\n\nfunction join(...keys) {\n  return computed(...keys, function() {\n    return keys.map(key => this[key]).join(' ');\n  });\n}\n\nclass Person {\n  @join('firstName', 'lastName')\n  fullName;\n}
\n
\n
\n \n

Note that when defined this way, getters and setters receive the key of the\nproperty they are decorating as the first argument. Setters receive the value\nthey are setting to as the second argument instead. Additionally, setters must\nreturn the value that should be cached:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { computed, set } from '@ember/object';\n\nfunction fullNameMacro(firstNameKey, lastNameKey) {\n  return computed(firstNameKey, lastNameKey, {\n    get() {\n      return `${this[firstNameKey]} ${this[lastNameKey]}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, firstNameKey, firstName);\n      set(this, lastNameKey, lastName);\n\n      return value;\n    }\n  });\n}\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @fullNameMacro('firstName', 'lastName') fullName;\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

Computed properties can also be used in classic classes. To do this, we\nprovide the getter and setter as the last argument like we would for a macro,\nand we assign it to a property on the class definition. This is an anonymous\ncomputed macro:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import EmberObject, { computed, set } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  // these will be supplied by `create`\n  firstName: null,\n  lastName: null,\n\n  fullName: computed('firstName', 'lastName', {\n    get() {\n      return `${this.firstName} ${this.lastName}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, 'firstName', firstName);\n      set(this, 'lastName', lastName);\n\n      return value;\n    }\n  })\n});\n\nlet tom = Person.create({\n  firstName: 'Tom',\n  lastName: 'Dale'\n});\n\ntom.get('fullName') // 'Tom Dale'
\n
\n
\n \n

You can overwrite computed property without setters with a normal property (no\nlonger computed) that won't change if dependencies change. You can also mark\ncomputed property as .readOnly() and block all attempts to set it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName').readOnly()\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet person = new Person();\nperson.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX>
\n
\n
\n \n

Additional resources:

\n\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 607, + "description": "

Call on a computed property to set it into read-only mode. When in this\nmode the computed property will throw an error when set.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  @computed().readOnly()\n  get guid() {\n    return 'guid-guid-guid';\n  }\n}\n\nlet person = new Person();\nset(person, 'guid', 'new-guid'); // will throw an exception
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  guid: computed(function() {\n    return 'guid-guid-guid';\n  }).readOnly()\n});\n\nlet person = Person.create();\nperson.set('guid', 'new-guid'); // will throw an exception
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "return": { + "description": "this", + "type": "ComputedProperty" + }, + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 657, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For example,\ncomputed property functions may close over variables that are then no longer\navailable for introspection. You can pass a hash of these values to a\ncomputed property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nclass Store {\n  @computed().meta({ type: Person })\n  get person() {\n    let personId = this.personId;\n    return Person.create({ id: personId });\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nconst Store = EmberObject.extend({\n  person: computed(function() {\n    let personId = this.get('personId');\n    return Person.create({ id: personId });\n  }).meta({ type: Person })\n});
\n
\n
\n \n

The hash that you pass to the meta() function will be saved on the\ncomputed property descriptor under the _meta key. Ember runtime\nexposes a public API for retrieving these values from classes,\nvia the metaForProperty() function.

\n", + "itemtype": "method", + "name": "meta", + "params": [ + { + "name": "meta", + "description": "", + "type": "Object" + } + ], + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Container-a149adb30a.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Container-a149adb30a.json new file mode 100644 index 000000000..623e95e71 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Container-a149adb30a.json @@ -0,0 +1,175 @@ +{ + "data": { + "id": "ember-4.7.1-Container", + "type": "class", + "attributes": { + "name": "Container", + "shortname": "Container", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 53, + "description": "

A container used to instantiate and cache objects.

\n

Every Container must be associated with a Registry, which is referenced\nto determine the factory and options that should be used to instantiate\nobjects.

\n

The public API for Container is still in flux and should not be considered\nstable.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 112, + "description": "

Given a fullName return a corresponding instance.\n The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter');\ntwitter instanceof Twitter; // => true\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted, an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "TypeOptions", + "optional": true + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 151, + "description": "

A depth first traversal, destroying the container, its descendant containers and all\ntheir managed objects.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "destroy", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 168, + "description": "

Clear either the entire cache or just the cache for a particular key.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "params": [ + { + "name": "fullName", + "description": "optional key to reset; if missing, resets everything", + "type": "String" + } + ], + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 185, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "return": { + "description": "", + "type": "Object" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 198, + "description": "

Given a fullName, return the corresponding factory. The consumer of the factory\nis responsible for the destruction of any factory instances, as there is no\nway for the container to ensure instances are destroyed when it itself is\ndestroyed.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 93, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registry", + "type": "Registry", + "since": "1.11.0", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 100, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "cache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 106, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "validationCache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-ContainerDebugAdapter-81ff26f90d.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-ContainerDebugAdapter-81ff26f90d.json new file mode 100644 index 000000000..5e54cd436 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-ContainerDebugAdapter-81ff26f90d.json @@ -0,0 +1,592 @@ +{ + "data": { + "id": "ember-4.7.1-ContainerDebugAdapter", + "type": "class", + "attributes": { + "name": "ContainerDebugAdapter", + "shortname": "ContainerDebugAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.ts", + "line": 12, + "description": "

The ContainerDebugAdapter helps the container and resolver interface\nwith tools that debug Ember such as the\nEmber Inspector\nfor Chrome and Firefox.

\n

This class can be extended by a custom resolver implementer\nto override some of the methods with library-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • canCatalogEntriesByType
  • \n
  • catalogEntriesByType
  • \n
\n

The adapter will need to be registered\nin the application's container as container-debug-adapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "containerDebugAdapter",\n\n  initialize(application) {\n    application.register('container-debug-adapter:main', require('app/container-debug-adapter'));\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "since": "1.5.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.ts", + "line": 63, + "description": "

Returns true if it is possible to catalog a list of available\nclasses in the resolver for a given type.

\n", + "itemtype": "method", + "name": "canCatalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "whether a list is available for this type.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.ts", + "line": 80, + "description": "

Returns the available classes a given type.

\n", + "itemtype": "method", + "name": "catalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "An array of strings.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/extension-support/lib/container_debug_adapter.ts", + "line": 53, + "description": "

The resolver instance of the application\nbeing debugged. This property will be injected\non creation.

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-ContainerProxyMixin-7423409046.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-ContainerProxyMixin-7423409046.json new file mode 100644 index 000000000..f3ab503e2 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-ContainerProxyMixin-7423409046.json @@ -0,0 +1,131 @@ +{ + "data": { + "id": "ember-4.7.1-ContainerProxyMixin", + "type": "class", + "attributes": { + "name": "ContainerProxyMixin", + "shortname": "ContainerProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 19, + "description": "

ContainerProxyMixin is used to provide public access to specific\ncontainer functionality.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 39, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "ContainerProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 65, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ContainerProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 126, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ContainerProxyMixin", + "module": "ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 31, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ContainerProxyMixin", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Controller-8f10f92885.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Controller-8f10f92885.json new file mode 100644 index 000000000..b0b0719f5 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Controller-8f10f92885.json @@ -0,0 +1,724 @@ +{ + "data": { + "id": "ember-4.7.1-Controller", + "type": "class", + "attributes": { + "name": "Controller", + "shortname": "Controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "", + "file": "packages/@ember/controller/index.ts", + "line": 11, + "extends": "EmberObject", + "uses": [ + "Ember.ControllerMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 54, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 75, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 96, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 186, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 171, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 26, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.ts", + "line": 43, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.ts", + "line": 63, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 26, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-CoreObject-6b3921f238.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-CoreObject-6b3921f238.json new file mode 100644 index 000000000..de66eca88 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-CoreObject-6b3921f238.json @@ -0,0 +1,158 @@ +{ + "data": { + "id": "ember-4.7.1-CoreObject", + "type": "class", + "attributes": { + "name": "CoreObject", + "shortname": "CoreObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 173, + "description": "

CoreObject is the base class for all Ember constructs. It establishes a\nclass system based on Ember's Mixin system, and provides the basis for the\nEmber Object Model. CoreObject should generally not be used directly,\ninstead you should use EmberObject.

\n

Usage

\n

You can define a class by extending from CoreObject using the extend\nmethod:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Person = CoreObject.extend({\n  name: 'Tomster',\n});
\n
\n
\n \n

For detailed usage, see the Object Model\nsection of the guides.

\n

Usage with Native Classes

\n

Native JavaScript class syntax can be used to extend from any CoreObject\nbased class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
class Person extends CoreObject {\n  init() {\n    super.init(...arguments);\n    this.name = 'Tomster';\n  }\n}
\n
\n
\n \n

Some notes about class usage:

\n
    \n
  • new syntax is not currently supported with classes that extend from\nEmberObject or CoreObject. You must continue to use the create method\nwhen making new instances of classes, even if they are defined using native\nclass syntax. If you want to use new syntax, consider creating classes\nwhich do not extend from EmberObject or CoreObject. Ember features,\nsuch as computed properties and decorators, will still work with base-less\nclasses.
  • \n
  • Instead of using this._super(), you must use standard super syntax in\nnative classes. See the MDN docs on classes\nfor more details.
  • \n
  • Native classes support using constructors\nto set up newly-created instances. Ember uses these to, among other things,\nsupport features that need to retrieve other entities by name, like Service\ninjection and getOwner. To ensure your custom instance setup logic takes\nplace after this important work is done, avoid using the constructor in\nfavor of init.
  • \n
  • Properties passed to create will be available on the instance by the time\ninit runs, so any code that requires these values should work at that\ntime.
  • \n
  • Using native classes, and switching back to the old Ember Object model is\nfully supported.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.7.1-Helper" + }, + { + "type": "class", + "id": "ember-4.7.1-EmberObject" + } + ] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-DataAdapter-cf03c570c5.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-DataAdapter-cf03c570c5.json new file mode 100644 index 000000000..017cdc11b --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-DataAdapter-cf03c570c5.json @@ -0,0 +1,935 @@ +{ + "data": { + "id": "ember-4.7.1-DataAdapter", + "type": "class", + "attributes": { + "name": "DataAdapter", + "shortname": "DataAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 156, + "description": "

The DataAdapter helps a data persistence library\ninterface with tools that debug Ember such\nas the Ember Inspector\nfor Chrome and Firefox.

\n

This class will be extended by a persistence library\nwhich will override some of the methods with\nlibrary-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • getFilters
  • \n
  • detect
  • \n
  • columnsForType
  • \n
  • getRecords
  • \n
  • getRecordColumnValues
  • \n
  • getRecordKeywords
  • \n
  • getRecordFilterValues
  • \n
  • getRecordColor
  • \n
\n

The adapter will need to be registered\nin the application's container as dataAdapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "data-adapter",\n\n  initialize: function(application) {\n    application.register('data-adapter:main', DS.DataAdapter);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 283, + "description": "

Specifies how records can be filtered.\nRecords returned will need to have a filterValues\nproperty with a key for every name in the returned array.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getFilters", + "return": { + "description": "List of objects defining filters.\n The object should have a `name` and `desc` property.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 297, + "description": "

Fetch the model types and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchModelTypes", + "params": [ + { + "name": "typesAdded", + "description": "Callback to call to add types.\nTakes an array of objects containing wrapped types (returned from `wrapModelType`).", + "type": "Function" + }, + { + "name": "typesUpdated", + "description": "Callback to call when a type has changed.\nTakes an array of objects containing wrapped types.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 345, + "description": "

Fetch the records of a given type and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchRecords", + "params": [ + { + "name": "modelName", + "description": "The model name.", + "type": "String" + }, + { + "name": "recordsAdded", + "description": "Callback to call to add records.\nTakes an array of objects containing wrapped records.\nThe object should have the following properties:\n columnValues: {Object} The key and value of a table cell.\n object: {Object} The actual record object.", + "type": "Function" + }, + { + "name": "recordsUpdated", + "description": "Callback to call when a record has changed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + }, + { + "name": "recordsRemoved", + "description": "Callback to call when a record has removed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 417, + "description": "

Clear all observers before destruction

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 435, + "description": "

Detect whether a class is a model.

\n

Test that against the model class\nof your persistence library.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "detect", + "return": { + "description": "boolean Whether the class is a model class or not." + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 449, + "description": "

Get the columns for a given model type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "columnsForType", + "return": { + "description": "An array of columns of the following format:\n name: {String} The name of the column.\n desc: {String} Humanized description (what would show in a table column name).", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 462, + "description": "

Adds observers to a model type class.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "observeModelType", + "params": [ + { + "name": "modelName", + "description": "The model type name.", + "type": "String" + }, + { + "name": "typesUpdated", + "description": "Called when a type is modified.", + "type": "Function" + } + ], + "return": { + "description": "The function to call to remove observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 499, + "description": "

Wraps a given model type and observes changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapModelType", + "params": [ + { + "name": "klass", + "description": "A model class.", + "type": "Class" + }, + { + "name": "modelName", + "description": "Name of the class.", + "type": "String" + } + ], + "return": { + "description": "The wrapped type has the following format:\n name: {String} The name of the type.\n count: {Integer} The number of records available.\n columns: {Columns} An array of columns to describe the record.\n object: {Class} The actual Model type class.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 523, + "description": "

Fetches all models defined in the application.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getModelTypes", + "return": { + "description": "Array of model types.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 548, + "description": "

Loops over all namespaces and all objects\nattached to them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getObjectsOnNamespaces", + "return": { + "description": "Array of model type strings.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 577, + "description": "

Fetches all loaded records for a given type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecords", + "return": { + "description": "An array of records.\n This array will be observed for changes,\n so it should update when new records are added/removed.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 590, + "description": "

Wraps a record and observers changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapRecord", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The wrapped record. Format:\ncolumnValues: {Array}\nsearchKeywords: {Array}", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 610, + "description": "

Gets the values for each column.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColumnValues", + "return": { + "description": "Keys should match column names defined\nby the model type.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 622, + "description": "

Returns keywords to match when searching records.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordKeywords", + "return": { + "description": "Relevant keywords for search.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 633, + "description": "

Returns the values of filters defined by getFilters.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordFilterValues", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The filter values.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 645, + "description": "

Each record can have a color that represents its state.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColor", + "params": [ + { + "name": "record", + "description": "The record instance", + "type": "Object" + } + ], + "return": { + "description": "The records color.\n Possible options: black, red, blue, green.", + "type": "String" + }, + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 212, + "description": "

The container-debug-adapter which is used\nto list all models.

\n", + "itemtype": "property", + "name": "containerDebugAdapter", + "default": "undefined", + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 222, + "description": "

The number of attributes to send\nas columns. (Enough to make the record\nidentifiable).

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "attributeLimit", + "default": "3", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 234, + "description": "

Ember Data > v1.0.0-beta.18\nrequires string model names to be passed\naround instead of the actual factories.

\n

This is a stamp for the Ember Inspector\nto differentiate between the versions\nto be able to support older versions too.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "acceptsModelName", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 248, + "description": "

Map from records arrays to RecordsWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "recordsWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 256, + "description": "

Map from records arrays to TypeWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "typeWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 264, + "description": "

Callback that is currently scheduled on backburner end to flush and check\nall active watchers.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "flushWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/extension-support/lib/data_adapter.ts", + "line": 274, + "description": "

Stores all methods that clear observers.\nThese methods will be called on destruction.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "releaseMethods", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.ActionHandler-a1ca908fb5.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.ActionHandler-a1ca908fb5.json new file mode 100644 index 000000000..998728aad --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.ActionHandler-a1ca908fb5.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.7.1-Ember.ActionHandler", + "type": "class", + "attributes": { + "name": "Ember.ActionHandler", + "shortname": "Ember.ActionHandler", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.ControllerMixin", + "Ember.CoreView" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 8, + "description": "

Ember.ActionHandler is available on some familiar classes including\nRoute, Component, and Controller.\n(Internally the mixin is used by Ember.CoreView, Ember.ControllerMixin,\nand Route and available to the above classes through\ninheritance.)

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 171, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 26, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.ControllerMixin-c41000c39d.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.ControllerMixin-c41000c39d.json new file mode 100644 index 000000000..970bfae4d --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.ControllerMixin-c41000c39d.json @@ -0,0 +1,223 @@ +{ + "data": { + "id": "ember-4.7.1-Ember.ControllerMixin", + "type": "class", + "attributes": { + "name": "Ember.ControllerMixin", + "shortname": "Ember.ControllerMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Controller" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/controller/lib/controller_mixin.ts", + "line": 17, + "uses": [ + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 54, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 75, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 96, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 186, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 171, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/ext/controller.ts", + "line": 26, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.ts", + "line": 43, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/lib/controller_mixin.ts", + "line": 63, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 26, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.CoreView-c8802cd529.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.CoreView-c8802cd529.json new file mode 100644 index 000000000..d14b6a67c --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.CoreView-c8802cd529.json @@ -0,0 +1,933 @@ +{ + "data": { + "id": "ember-4.7.1-Ember.CoreView", + "type": "class", + "attributes": { + "name": "Ember.CoreView", + "shortname": "Ember.CoreView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 7, + "description": "

Ember.CoreView is an abstract class that exists to give view-like behavior\nto both Ember's main view class Component and other classes that don't need\nthe full functionality of Component.

\n

Unless you have specific needs for CoreView, you will use Component\nin your applications.

\n", + "extends": "EmberObject", + "deprecated": true, + "deprecationMessage": "Use `Component` instead.", + "uses": [ + "Evented", + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 36, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 58, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 78, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 110, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 153, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 162, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 177, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 193, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 209, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 75, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 95, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 121, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 142, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 165, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 180, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 171, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 36, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 26, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.7.1-Component" + } + ] + }, + "module": { + "data": { + "id": "ember-4.7.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.EventDispatcher-e7c0cf2047.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.EventDispatcher-e7c0cf2047.json new file mode 100644 index 000000000..5e877aa21 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.EventDispatcher-e7c0cf2047.json @@ -0,0 +1,174 @@ +{ + "data": { + "id": "ember-4.7.1-Ember.EventDispatcher", + "type": "class", + "attributes": { + "name": "Ember.EventDispatcher", + "shortname": "Ember.EventDispatcher", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 19, + "description": "

Ember.EventDispatcher handles delegating browser events to their\ncorresponding Ember.Views. For example, when you click on a view,\nEmber.EventDispatcher ensures that that view's mouseDown method gets\ncalled.

\n", + "access": "private", + "tagname": "", + "extends": "Ember.Object", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 114, + "description": "

Sets up event listeners for standard browser events.

\n

This will be called after the browser sends a DOMContentReady event. By\ndefault, it will set up all of the listeners on the document body. If you\nwould like to register the listeners on a different element, set the event\ndispatcher's root property.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "params": [ + { + "name": "addedEvents", + "description": "", + "type": "Object" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 208, + "description": "

Setup event listeners for the given browser event name

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForBrowserEvent", + "params": [ + { + "name": "event", + "description": "the name of the event in the browser" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 221, + "description": "

Setup event listeners for the given Ember event name (camel case)

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForEmberEvent", + "params": [ + { + "name": "eventName", + "description": "" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 238, + "description": "

Registers an event listener on the rootElement. If the given event is\ntriggered, the provided event handler will be triggered on the target view.

\n

If the target view does not implement the event handler, or if the handler\nreturns false, the parent view will be called. The event will continue to\nbubble to each successive parent view until it reaches the top.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandler", + "params": [ + { + "name": "rootElement", + "description": "", + "type": "Element" + }, + { + "name": "event", + "description": "the name of the event in the browser", + "type": "String" + }, + { + "name": "eventName", + "description": "the name of the method to call on the view", + "type": "String" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/system/action_manager.ts", + "line": 9, + "description": "

Global action id hash.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registeredActions", + "type": "Object", + "class": "Ember.EventDispatcher", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 31, + "description": "

The set of events names (and associated handler function names) to be setup\nand dispatched by the EventDispatcher. Modifications to this list can be done\nat setup time, generally via the Application.customEvents hash.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "events", + "type": "Object", + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 91, + "description": "

The root DOM element to which event listeners should be attached. Event\nlisteners will be attached to the document unless this is overridden.

\n

Can be specified as a DOMElement or a selector string.

\n

The default body is a string since this may be evaluated before document.body\nexists in the DOM.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.Object", + "type": "missing" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.NativeArray-d2a337fa89.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.NativeArray-d2a337fa89.json new file mode 100644 index 000000000..c44497182 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.NativeArray-d2a337fa89.json @@ -0,0 +1,1636 @@ +{ + "data": { + "id": "ember-4.7.1-Ember.NativeArray", + "type": "class", + "attributes": { + "name": "Ember.NativeArray", + "shortname": "Ember.NativeArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1896, + "description": "

The NativeArray mixin contains the properties needed to make the native\nArray support MutableArray and all of its dependent APIs. Unless you\nhave EmberENV.EXTEND_PROTOTYPES or EmberENV.EXTEND_PROTOTYPES.Array set to\nfalse, this will be applied automatically. Otherwise you can apply the mixin\nat anytime by calling Ember.NativeArray.apply(Array.prototype).

\n", + "uses": [ + "Observable", + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1496, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1515, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1541, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1563, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1588, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1608, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1628, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1654, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1679, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1699, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1720, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1739, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1766, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1794, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1812, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1838, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 329, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 354, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 438, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 481, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 523, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 577, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 637, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 660, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 683, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 731, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 752, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 829, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 881, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 906, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 934, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 981, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1015, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1057, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1101, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1145, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1175, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1246, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1285, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1297, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1313, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1346, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1390, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1409, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1431, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 319, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 373, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 401, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 426, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.TargetActionSupport-d72ca028b6.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.TargetActionSupport-d72ca028b6.json new file mode 100644 index 000000000..f93a9cf62 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.TargetActionSupport-d72ca028b6.json @@ -0,0 +1,101 @@ +{ + "data": { + "id": "ember-4.7.1-Ember.TargetActionSupport", + "type": "class", + "attributes": { + "name": "Ember.TargetActionSupport", + "shortname": "Ember.TargetActionSupport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 10, + "description": "

Ember.TargetActionSupport is a mixin that can be included in a class\nto add a triggerAction method with semantics similar to the Handlebars\n{{action}} helper. In normal Ember usage, the {{action}} helper is\nusually the best choice. This mixin is most often useful when you are\ndoing more complex event handling in Components.

\n", + "extends": "Mixin", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 51, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 428, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Mixin" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-Mixin", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.Templates.components-a9e020b8f2.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.Templates.components-a9e020b8f2.json new file mode 100644 index 000000000..b4d497641 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.Templates.components-a9e020b8f2.json @@ -0,0 +1,85 @@ +{ + "data": { + "id": "ember-4.7.1-Ember.Templates.components", + "type": "class", + "attributes": { + "name": "Ember.Templates.components", + "shortname": "Ember.Templates.components", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 66, + "description": "

The Input component lets you create an HTML <input> element.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value="987" />
\n
\n
\n \n

creates an <input> element with type="text" and value set to 987.

\n

Text field

\n

If no type argument is specified, a default of type 'text' is used.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Search:\n<Input @value={{this.searchWord}} />
\n
\n
\n \n

In this example, the initial value in the <input> will be set to the value of\nthis.searchWord. If the user changes the text, the value of this.searchWord will also be\nupdated.

\n

Actions

\n

The Input component takes a number of arguments with callbacks that are invoked in response to\nuser events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-down
  • \n
  • key-press
  • \n
  • key-up
  • \n
\n

These callbacks are passed to Input like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Starting with Ember Octane, we recommend using the {{on}} modifier to call actions\non specific events, such as the input event.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
<label for="input-name">Name:</label>\n<Input\n  @id="input-name"\n  @value={{this.name}}\n  {{on "input" this.validateName}}\n/>
\n
\n
\n \n

The event name (e.g. focusout, input, keydown) always follows the casing\nthat the HTML standard uses.

\n

<input> HTML Attributes to Avoid

\n

In most cases, if you want to pass an attribute to the underlying HTML <input> element, you\ncan pass the attribute directly, just like any other Ember component.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @type="text" size="10" />
\n
\n
\n \n

In this example, the size attribute will be applied to the underlying <input> element in the\noutputted HTML.

\n

However, there are a few attributes where you must use the @ version.

\n
    \n
  • @type: This argument is used to control which Ember component is used under the hood
  • \n
  • @value: The @value argument installs a two-way binding onto the element. If you wanted a\none-way binding, use <input> with the value property and the input event instead.
  • \n
  • @checked (for checkboxes): like @value, the @checked argument installs a two-way binding\nonto the element. If you wanted a one-way binding, use <input type="checkbox"> with\nchecked and the input event instead.
  • \n
\n

Extending TextField

\n

Internally, <Input @type="text" /> creates an instance of TextField, passing arguments from\nthe helper to TextField's create method. Subclassing TextField is supported but not\nrecommended.

\n

See TextField

\n

Checkbox

\n

To create an <input type="checkbox">:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Emberize Everything:\n<Input @type="checkbox" @checked={{this.isEmberized}} name="isEmberized" />
\n
\n
\n \n

This will bind the checked state of this checkbox to the value of isEmberized -- if either one\nchanges, it will be reflected in the other.

\n

Extending Checkbox

\n

Internally, <Input @type="checkbox" /> creates an instance of Checkbox. Subclassing\nTextField is supported but not recommended.

\n

See Checkbox

\n", + "itemtype": "method", + "name": "Input", + "see": [ + "{TextField}", + "{Checkbox}" + ], + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 41, + "description": "

The LinkTo component renders a link to the supplied routeName passing an optionally\nsupplied model to the route as its model context of the route. The block for LinkTo\nbecomes the contents of the rendered element:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

Disabling the LinkTo component

\n

The LinkTo component can be disabled by using the disabled argument. A disabled link\ndoesn't result in a transition when activated, and adds the disabled class to the <a>\nelement.

\n

(The class name to apply to the element can be overridden by using the disabledClass\nargument)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @disabled={{true}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

Handling href

\n

<LinkTo> will use your application's Router to fill the element's href property with a URL\nthat matches the path to the supplied routeName.

\n

Handling current route

\n

The LinkTo component will apply a CSS class name of 'active' when the application's current\nroute matches the supplied routeName. For example, if the application's current route is\n'photoGallery.recent', then the following invocation of LinkTo:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

will result in

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="active">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

The CSS class used for active classes can be customized by passing an activeClass argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent' @activeClass="current-url">\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="current-url">\n  Great Hamster Photos\n</a>
\n
\n
\n \n\n

If you need a link to be 'active' even when it doesn't match the current route, you can use the\ncurrent-when argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @current-when='photos'>\n  Photo Gallery\n</LinkTo>
\n
\n
\n \n

This may be helpful for keeping links active for:

\n
    \n
  • non-nested routes that are logically related
  • \n
  • some secondary menu approaches
  • \n
  • 'top navigation' with 'sub navigation' scenarios
  • \n
\n

A link will be active if current-when is true or the current\nroute is the route this link would transition to.

\n

To match multiple routes 'space-separate' the routes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='gallery' @current-when='photos drawings paintings'>\n  Art Gallery\n</LinkTo>
\n
\n
\n \n

Supplying a model

\n

An optional model argument can be used for routes whose\npaths contain dynamic segments. This argument will become\nthe model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", {path: "hamster-photos/:photo_id"});\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{this.aPhoto}}>\n  {{aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

Supplying multiple models

\n

For deep-linking to route paths that contain multiple\ndynamic segments, the models argument can be used.

\n

As the router transitions through the route path, each\nsupplied model argument will become the context for the\nroute with the dynamic segments:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() {\n    this.route("comment", {path: "comments/:comment_id"});\n  });\n});
\n
\n
\n \n

This argument will become the model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.comment' @models={{array this.aPhoto this.comment}}>\n  {{comment.body}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42/comments/718">\n  A+++ would snuggle again.\n</a>
\n
\n
\n \n

Supplying an explicit dynamic segment value

\n

If you don't have a model object available to pass to LinkTo,\nan optional string or integer argument can be passed for routes whose\npaths contain dynamic segments. This argument will become the value\nof the dynamic segment:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{aPhotoId}}>\n  {{this.aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

When transitioning into the linked route, the model hook will\nbe triggered with parameters including this passed identifier.

\n

Supplying query parameters

\n

If you need to add optional key-value pairs that appear to the right of the ? in a URL,\nyou can use the query argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @query={{hash page=1 per_page=20}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos?page=1&per_page=20">\n  Great Hamster Photos\n</a>
\n
\n
\n \n", + "itemtype": "method", + "name": "LinkTo", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 9, + "description": "

The Textarea component inserts a new instance of <textarea> tag into the template.

\n

The @value argument provides the content of the <textarea>.

\n

This template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value="A bunch of text" />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  A bunch of text\n</textarea>
\n
\n
\n \n

The @value argument is two-way bound. If the user types text into the textarea, the @value\nargument is updated. If the @value argument is updated, the text in the textarea is updated.

\n

In the following example, the writtenWords property on the component will be updated as the user\ntypes 'Lots of text' into the text area of their browser's window.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class WordEditorComponent extends Component {\n  @tracked writtenWords = "Lots of text that IS bound";\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{writtenWords}} />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  Lots of text that IS bound\n</textarea>
\n
\n
\n \n

If you wanted a one way binding, you could use the <textarea> element directly, and use the\nvalue DOM property and the input event.

\n

Actions

\n

The Textarea component takes a number of arguments with callbacks that are invoked in\nresponse to user events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-press
  • \n
\n

These callbacks are passed to Textarea like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Classic Invocation Syntax

\n

The Textarea component can also be invoked using curly braces, just like any other Ember\ncomponent.

\n

For example, this is an invocation using angle-bracket notation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

You could accomplish the same thing using classic invocation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{textarea value=this.searchWord enter=this.query}}
\n
\n
\n \n

The main difference is that angle-bracket invocation supports any HTML attribute using HTML\nattribute syntax, because attributes and arguments have different syntax when using angle-bracket\ninvocation. Curly brace invocation, on the other hand, only has a single syntax for arguments,\nand components must manually map attributes onto component arguments.

\n

When using classic invocation with {{textarea}}, only the following attributes are mapped onto\narguments:

\n
    \n
  • rows
  • \n
  • cols
  • \n
  • name
  • \n
  • selectionEnd
  • \n
  • selectionStart
  • \n
  • autocomplete
  • \n
  • wrap
  • \n
  • lang
  • \n
  • dir
  • \n
  • value
  • \n
\n

Classic layout and layoutName properties

\n

Because HTML textarea elements do not contain inner HTML the layout and\nlayoutName properties will not be applied.

\n", + "itemtype": "method", + "name": "Textarea", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.Templates.helpers-b881f89458.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.Templates.helpers-b881f89458.json new file mode 100644 index 000000000..b38115218 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.Templates.helpers-b881f89458.json @@ -0,0 +1,508 @@ +{ + "data": { + "id": "ember-4.7.1-Ember.Templates.helpers", + "type": "class", + "attributes": { + "name": "Ember.Templates.helpers", + "shortname": "Ember.Templates.helpers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 86, + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 45, + "description": "

See Ember.Templates.components.Input.

\n", + "itemtype": "method", + "name": "input", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 253, + "description": "

See Ember.Templates.components.LinkTo.

\n", + "itemtype": "method", + "name": "link-to", + "see": [ + "{Ember.Templates.components.LinkTo}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 122, + "description": "

See Ember.Templates.components.Textarea.

\n", + "itemtype": "method", + "name": "textarea", + "see": [ + "{Ember.Templates.components.Textarea}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/action.ts", + "line": 18, + "description": "

The {{action}} helper provides a way to pass triggers for behavior (usually\njust a function) between components, and into components from controllers.

\n

Passing functions with the action helper

\n

There are three contexts an action helper can be used in. The first two\ncontexts to discuss are attribute context, and Handlebars value context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>\n{{! Examples of Handlebars value context }}\n{{input on-input=(action "save")}}\n{{yield (action "refreshData") andAnotherParam}}
\n
\n
\n \n

In these contexts,\nthe helper is called a "closure action" helper. Its behavior is simple:\nIf passed a function name, read that function off the actions property\nof the current context. Once that function is read, or immediately if a function was\npassed, create a closure over that function and any arguments.\nThe resulting value of an action helper used this way is simply a function.

\n

For example, in the attribute context:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>
\n
\n
\n \n

The resulting template render logic would be:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
var div = document.createElement('div');\nvar actionFunction = (function(context){\n  return function() {\n    return context.actions.save.apply(context, arguments);\n  };\n})(context);\ndiv.onclick = actionFunction;
\n
\n
\n \n

Thus when the div is clicked, the action on that context is called.\nBecause the actionFunction is just a function, closure actions can be\npassed between components and still execute in the correct context.

\n

Here is an example action handler on a component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  save() {\n    this.model.save();\n  }\n}
\n
\n
\n \n

Actions are always looked up on the actions property of the current context.\nThis avoids collisions in the naming of common actions, such as destroy.\nTwo options can be passed to the action helper when it is used in this way.

\n
    \n
  • target=someProperty will look to someProperty instead of the current\ncontext for the actions hash. This can be useful when targeting a\nservice for actions.
  • \n
  • value="target.value" will read the path target.value off the first\nargument to the action when it is called and rewrite the first argument\nto be that value. This is useful when attaching actions to event listeners.
  • \n
\n

Invoking an action

\n

Closure actions curry both their scope and any arguments. When invoked, any\nadditional arguments are added to the already curried list.\nActions are presented in JavaScript as callbacks, and are\ninvoked like any other JavaScript function.

\n

For example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.hbs
1\n
{{input on-input=(action (action 'setName' @model) value="target.value")}}
\n
\n
\n \n

The first argument (@model) was curried over, and the run-time argument (event)\nbecomes a second argument. Action calls can be nested this way because each simply\nreturns a function. Any function can be passed to the {{action}} helper, including\nother actions.

\n

Actions invoked with sendAction have the same currying behavior as demonstrated\nwith on-input above. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyInput @submit={{action 'setName' @model}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-input submit=(action 'setName' @model)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    // Note that model is not passed, it was curried in the template\n    this.submit('bob');\n  }\n});
\n
\n
\n \n

Attaching actions to DOM elements

\n

The third context of the {{action}} helper can be called "element space".\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of element space }}\n<div {{action "save"}}></div>
\n
\n
\n \n

Used this way, the {{action}} helper provides a useful shortcut for\nregistering an HTML element in a template for a single DOM event and\nforwarding that interaction to the template's context (controller or component).\nIf the context of a template is a controller, actions used this way will\nbubble to routes when the controller does not implement the specified action.\nOnce an action hits a route, it will bubble through the route hierarchy.

\n

Event Propagation

\n

{{action}} helpers called in element space can control event bubbling. Note\nthat the closure style actions cannot.

\n

Events triggered through the action helper will automatically have\n.preventDefault() called on them. You do not need to do so in your event\nhandlers. If you need to allow event propagation (to handle file inputs for\nexample) you can supply the preventDefault=false option to the {{action}} helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<div {{action "sayHello" preventDefault=false}}>\n  <input type="file" />\n  <input type="checkbox" />\n</div>
\n
\n
\n \n

To disable bubbling, pass bubbles=false to the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<button {{action 'edit' post bubbles=false}}>Edit</button>
\n
\n
\n \n

To disable bubbling with closure style actions you must create your own\nwrapper helper that makes use of event.stopPropagation():

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div onclick={{disable-bubbling (action "sayHello")}}>Hello</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
bubbling.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { helper } from '@ember/component/helper';\n\nexport function disableBubbling([action]) {\n  return function(event) {\n    event.stopPropagation();\n    return action(event);\n  };\n}\nexport default helper(disableBubbling);
\n
\n
\n \n

If you need the default handler to trigger you should either register your\nown event handler, or use event methods on your view class. See\n"Responding to Browser Events"\nin the documentation for Component for more information.

\n

Specifying DOM event type

\n

{{action}} helpers called in element space can specify an event type.\nBy default the {{action}} helper registers for DOM click events. You can\nsupply an on option to the helper to specify a different DOM event name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" on="doubleClick"}}>\n  click me\n</div>
\n
\n
\n \n

See "Event Names" for a list of\nacceptable DOM event names.

\n

Specifying whitelisted modifier keys

\n

{{action}} helpers called in element space can specify modifier keys.\nBy default the {{action}} helper will ignore click events with pressed modifier\nkeys. You can supply an allowedKeys option to specify which keys should not be ignored.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="alt"}}>\n  click me\n</div>
\n
\n
\n \n

This way the action will fire when clicking with the alt key pressed down.\nAlternatively, supply "any" to the allowedKeys option to accept any combination of modifier keys.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="any"}}>\n  click me with any key pressed\n</div>
\n
\n
\n \n

Specifying a Target

\n

A target option can be provided to the helper to change\nwhich object will receive the method call. This option must be a path\nto an object, accessible in the current context:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<div {{action "anActionName" target=someService}}>\n  click me\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n
import Controller from '@ember/controller';\nimport { service } from '@ember/service';\n\nexport default class extends Controller {\n  @service someService;\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "action", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/array.ts", + "line": 5, + "description": "

Use the {{array}} helper to create an array to pass as an option to your\ncomponents.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<MyComponent @people={{array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson}}\n/>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{my-component people=(array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson)\n}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Tom Dale', 'Yehuda Katz', this.get('myOtherPerson')]
\n
\n
\n \n

Where the 3rd item in the array is bound to updates of the myOtherPerson property.

\n", + "itemtype": "method", + "name": "array", + "params": [ + { + "name": "options", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "Array", + "type": "Array" + }, + "since": "3.8.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/component.ts", + "line": 5, + "description": "

The {{component}} helper lets you add instances of Component to a\ntemplate. See Component for\nadditional information on how a Component functions.\n{{component}}'s primary use is for cases where you want to dynamically\nchange which type of component is rendered as the state of your application\nchanges. This helper has three modes: inline, block, and nested.

\n

Inline Form

\n

Given the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/application.hbs
1\n
{{component this.infographicComponentName}}
\n
\n
\n \n

And the following application code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Controller from '@ember/controller';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

The live-updating-chart component will be appended when isMarketOpen is\ntrue, and the market-close-summary component will be appended when\nisMarketOpen is false. If the value changes while the app is running,\nthe component will be automatically swapped out accordingly.\nNote: You should not use this helper when you are consistently rendering the same\ncomponent. In that case, use standard component syntax, for example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LiveUpdatingChart />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{live-updating-chart}}
\n
\n
\n \n

Block Form

\n

Using the block form of this helper is similar to using the block form\nof a component. Given the following application template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
{{#component this.infographicComponentName}}\n  Last update: {{this.lastUpdateTimestamp}}\n{{/component}}
\n
\n
\n \n

The following controller code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Controller from '@ember/controller';\nimport { computed } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get lastUpdateTimestamp() {\n    return new Date();\n  }\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

And the following component template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
chart.hbs
1\n2\n
{{! chart }}\n{{yield}}
\n
\n
\n \n

The Last Update: {{this.lastUpdateTimestamp}} will be rendered in place of the {{yield}}.

\n

Nested Usage

\n

The component helper can be used to package a component path with initial attrs.\nThe included attrs can then be merged during the final invocation.\nFor example, given a person-form component with the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.hbs
1\n2\n3\n
{{yield (hash\n  nameInput=(component "my-input-component" value=@model.name placeholder="First Name")\n)}}
\n
\n
\n \n

When yielding the component via the hash helper, the component is invoked directly.\nSee the following snippet:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonForm as |form|>\n  <form.nameInput @placeholder="Username" />\n</PersonForm>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-form as |form|}}\n  {{form.nameInput placeholder="Username"}}\n{{/person-form}}
\n
\n
\n \n

Which outputs an input whose value is already bound to model.name and placeholder\nis "Username".

\n

When yielding the component without the hash helper use the component helper.\nFor example, below is a full-name component template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{yield (component "my-input-component" value=@model.name placeholder="Name")}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<FullName as |field|>\n  {{component field placeholder="Full name"}}\n</FullName>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#full-name as |field|}}\n  {{component field placeholder="Full name"}}\n{{/full-name}}
\n
\n
\n \n", + "itemtype": "method", + "name": "component", + "since": "1.11.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/concat.ts", + "line": 5, + "description": "

Concatenates the given arguments into a string.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{some-component name=(concat firstName " " lastName)}}\n\n{{! would pass name="<first name value> <last name value>" to the component}}
\n
\n
\n \n

or for angle bracket invocation, you actually don't need concat at all.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @name="{{firstName}} {{lastName}}" />
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "concat", + "since": "1.13.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 13, + "description": "

The {{#each}} helper loops over elements in a collection. It is an extension\nof the base Handlebars {{#each}} helper.

\n

The default behavior of {{#each}} is to yield its inner block once for every\nitem in an array passing the item as the first block parameter.

\n

Assuming the @developers argument contains this array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
[{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }];
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

The same rules apply to arrays of primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Yehuda', 'Tom', 'Paul']
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developerNames as |name|}}\n    <li>Hello, {{name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

During iteration, the index of each item in the array is provided as a second block\nparameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person index|}}\n    <li>Hello, {{person.name}}! You're number {{index}} in line</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

Specifying Keys

\n

In order to improve rendering speed, Ember will try to reuse the DOM elements\nwhere possible. Specifically, if the same item is present in the array both\nbefore and after the change, its DOM output will be reused.

\n

The key option is used to tell Ember how to determine if the items in the\narray being iterated over with {{#each}} has changed between renders. By\ndefault the item's object identity is used.

\n

This is usually sufficient, so in most cases, the key option is simply not\nneeded. However, in some rare cases, the objects' identities may change even\nthough they represent the same underlying data.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
people.map(person => {\n  return { ...person, type: 'developer' };\n});
\n
\n
\n \n

In this case, each time the people array is map-ed over, it will produce\nan new array with completely different objects between renders. In these cases,\nyou can help Ember determine how these objects related to each other with the\nkey option:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers key="name" as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

By doing so, Ember will use the value of the property specified (person.name\nin the example) to find a "match" from the previous render. That is, if Ember\nhas previously seen an object from the @developers array with a matching\nname, its DOM elements will be re-used.

\n

There are two special values for key:

\n
    \n
  • @index - The index of the item in the array.
  • \n
  • @identity - The item in the array itself.
  • \n
\n

{{else}} condition

\n

{{#each}} can have a matching {{else}}. The contents of this block will render\nif the collection is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<ul>\n  {{#each @developers as |person|}}\n    <li>{{person.name}} is available!</li>\n  {{else}}\n    <li>Sorry, nobody is available for this task.</li>\n  {{/each}}\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 124, + "description": "

The {{each-in}} helper loops over properties on an object.

\n

For example, given this component definition:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    "name": "Shelly Sails",\n    "age": 42\n  };\n}
\n
\n
\n \n

This template would display all properties on the developer\nobject in a list:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.hbs
1\n2\n3\n4\n5\n
<ul>\n  {{#each-in this.developer as |key value|}}\n    <li>{{key}}: {{value}}</li>\n  {{/each-in}}\n</ul>
\n
\n
\n \n

Outputting their name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<ul>\n  <li>name: Shelly Sails</li>\n  <li>age: 42</li>\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each-in", + "access": "public", + "tagname": "", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/fn.ts", + "line": 5, + "description": "

The fn helper allows you to ensure a function that you are passing off\nto another component, helper, or modifier has access to arguments that are\navailable in the template.

\n

For example, if you have an each helper looping over a number of items, you\nmay need to pass a function that expects to receive the item as an argument\nto a component invoked within the loop. Here's how you could use the fn\nhelper to pass both the function and its arguments together:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
listing.hbs
1\n2\n3\n
{{#each @items as |item|}}\n<DisplayItem @item=item @select={{fn this.handleSelected item}} />\n{{/each}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class ItemsList extends Component {\n  @action\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this case the display-item component will receive a normal function\nthat it can invoke. When it invokes the function, the handleSelected\nfunction will receive the item and any arguments passed, thanks to the\nfn helper.

\n

Let's take look at what that means in a couple circumstances:

\n
    \n
  • When invoked as this.args.select() the handleSelected function will\nreceive the item from the loop as its first and only argument.
  • \n
  • When invoked as this.args.select('foo') the handleSelected function\nwill receive the item from the loop as its first argument and the\nstring 'foo' as its second argument.
  • \n
\n

In the example above, we used @action to ensure that handleSelected is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class ItemsList extends Component {\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when handleSelected is invoked inside the display-item\ncomponent, it will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into fn!

\n

See also partial application.

\n", + "itemtype": "method", + "name": "fn", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/get.ts", + "line": 5, + "description": "

Dynamically look up a property on an object or an element in an array.\nThe second argument to {{get}} should have a string or number value,\nalthough it can be bound.

\n

For example, these two usages are equivalent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{this.developer.name}}\n{{get this.developer "name"}}
\n
\n
\n \n

If there were several facts about a person, the {{get}} helper can dynamically\npick one:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<DeveloperDetail @factName="language" />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.developer @factName}}
\n
\n
\n \n

For a more complex example, this template would allow the user to switch\nbetween showing the user's name and preferred coding language with a click:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n\n  @tracked currentFact = 'name'\n\n  @action\n  showFact(fact) {\n    this.currentFact = fact;\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
{{get this.developer this.currentFact}}\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

The {{get}} helper can also respect mutable values itself. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
<Input @value={{mut (get this.person this.currentFact)}} />\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

Would allow the user to swap what fact is being displayed, and also edit\nthat fact via a two-way mutable binding.

\n

The {{get}} helper can also be used for array element access via index.\nThis would display the value of the first element in the array this.names:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names 0}}
\n
\n
\n \n

Array element access also works with a dynamic second argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names @index}}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "get", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/hash.ts", + "line": 5, + "description": "

Use the {{hash}} helper to create a hash to pass as an option to your\ncomponents. This is specially useful for contextual components where you can\njust yield a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{yield (hash\n   name='Sarah'\n   title=office\n)}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ name: 'Sarah', title: this.get('office') }
\n
\n
\n \n

Where the title is bound to updates of the office property.

\n

Note that the hash is an empty object with no prototype chain, therefore\ncommon methods like toString are not available in the resulting hash.\nIf you need to use such a method, you can use the call or apply\napproach:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
function toString(obj) {\n  return Object.prototype.toString.apply(obj);\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "Hash", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/helper.ts", + "line": 5, + "description": "

Use the {{helper}} helper to create contextual helper so\nthat it can be passed around as first-class values in templates.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let (helper "join-words" "foo" "bar" separator=" ") as |foo-bar|}}\n\n  {{!-- this is equivalent to invoking `{{join-words "foo" "bar" separator=" "}}` --}}\n  {{foo-bar}}\n\n  {{!-- this will pass the helper itself into the component, instead of invoking it now --}}\n  <MyComponent @helper={{helper foo-bar "baz"}} />\n\n  {{!-- this will yield the helper itself ("contextual helper"), instead of invoking it now --}}\n  {{yield foo-bar}}\n{{/let}}
\n
\n
\n \n

Arguments

\n

The {{helper}} helper works similarly to the {{component}} and\n{{modifier}} helper:

\n
    \n
  • When passed a string (e.g. (helper "foo")) as the first argument,\nit will produce an opaque, internal "helper definition" object\nthat can be passed around and invoked elsewhere.

    \n
  • \n
  • Any additional positional and/or named arguments (a.k.a. params and hash)\nwill be stored ("curried") inside the definition object, such that, when invoked,\nthese arguments will be passed along to the referenced helper.

    \n
  • \n
\n", + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "3.27.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 5, + "description": "

The if helper allows you to conditionally render one of two branches,\ndepending on the "truthiness" of a property.\nFor example the following values are all falsey: false, undefined, null, "", 0, NaN or an empty array.

\n

This helper has two forms, block and inline.

\n

Block form

\n

You can use the block form of if to conditionally render a section of the template.

\n

To use it, pass the conditional value to the if helper,\nusing the block form to wrap the section of template you want to conditionally render.\nLike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n
{{! will not render because greeting is undefined}}\n{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{/if}}
\n
\n
\n \n

You can also define what to show if the property is falsey by using\nthe else helper.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n
{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{else}}\n  No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

You are also able to combine else and if helpers to create more complex\nconditional logic.

\n

For the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if @isRaining}}\n Yes, grab an umbrella!\n{{else if @isCold}}\n Grab a coat, it's chilly!\n{{else}}\n No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

If you call it by saying isCold is true:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather @isCold={{true}} />
\n
\n
\n \n

Then Grab a coat, it's chilly! will be rendered.

\n

Inline form

\n

The inline if helper conditionally renders a single property or string.

\n

In this form, the if helper receives three arguments, the conditional value,\nthe value to render when truthy, and the value to render when falsey.

\n

For example, if useLongGreeting is truthy, the following:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{true}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{if @useLongGreeting "Hello" "Hi"}} Alex
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hello Alex
\n
\n
\n \n

One detail to keep in mind is that both branches of the if helper will be evaluated,\nso if you have {{if condition "foo" (expensive-operation "bar"),\nexpensive-operation will always calculate.

\n", + "itemtype": "method", + "name": "if", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 97, + "description": "

The unless helper is the inverse of the if helper. It displays if a value\nis falsey ("not true" or "is false"). Example values that will display with\nunless: false, undefined, null, "", 0, NaN or an empty array.

\n

Inline form

\n

The inline unless helper conditionally renders a single property or string.\nThis helper acts like a ternary operator. If the first property is falsy,\nthe second argument will be displayed, otherwise, the third argument will be\ndisplayed

\n

For example, if you pass a falsey useLongGreeting to the Greeting component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{false}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{unless @useLongGreeting "Hi" "Hello"}} Ben
\n
\n
\n \n

Then it will display:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hi Ben
\n
\n
\n \n

Block form

\n

Like the if helper, the unless helper also has a block form.

\n

The following will not render anything:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n2\n3\n
{{#unless @greeting}}\n  No greeting was found. Why not set one?\n{{/unless}}
\n
\n
\n \n

You can also use an else helper with the unless block. The\nelse will display if the value is truthy.

\n

If you have the following component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
in.hbs
1\n2\n3\n4\n5\n
{{#unless @userData}}\n  Please login.\n{{else}}\n  Welcome back!\n{{/unless}}
\n
\n
\n \n

Calling it with a truthy userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{hash username="Zoey"}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Welcome back!
\n
\n
\n \n

and calling it with a falsey userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{false}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Please login.
\n
\n
\n \n", + "itemtype": "method", + "name": "unless", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/log.ts", + "line": 5, + "description": "

log allows you to output the value of variables in the current rendering\ncontext. log also accepts primitive types such as strings or numbers.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{log "myVariable:" myVariable }}
\n
\n
\n \n", + "itemtype": "method", + "name": "log", + "params": [ + { + "name": "params", + "description": "", + "type": "Array" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/modifier.ts", + "line": 5, + "description": "

Use the {{modifier}} helper to create contextual modifier so\nthat it can be passed around as first-class values in templates.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let (modifier "click-outside" click=this.submit) as |on-click-outside|}}\n\n  {{!-- this is equivalent to `<MyComponent {{click-outside click=this.submit}} />` --}}\n  <MyComponent {{on-click-outside}} />\n\n  {{!-- this will pass the modifier itself into the component, instead of invoking it now --}}\n  <MyComponent @modifier={{modifier on-click-outside "extra" "args"}} />\n\n  {{!-- this will yield the modifier itself ("contextual modifier"), instead of invoking it now --}}\n  {{yield on-click-outside}}\n{{/let}}
\n
\n
\n \n

Arguments

\n

The {{modifier}} helper works similarly to the {{component}} and\n{{helper}} helper:

\n
    \n
  • When passed a string (e.g. (modifier "foo")) as the first argument,\nit will produce an opaque, internal "modifier definition" object\nthat can be passed around and invoked elsewhere.

    \n
  • \n
  • Any additional positional and/or named arguments (a.k.a. params and hash)\nwill be stored ("curried") inside the definition object, such that, when invoked,\nthese arguments will be passed along to the referenced modifier.

    \n
  • \n
\n", + "itemtype": "method", + "name": "modifier", + "access": "public", + "tagname": "", + "since": "3.27.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/mut.ts", + "line": 9, + "description": "

The mut helper lets you clearly specify that a child Component can update the\n(mutable) value passed to it, which will change the value of the parent component.

\n

To specify that a parameter is mutable, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{fn (mut totalClicks)}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(mut totalClicks)}}
\n
\n
\n \n

The child Component can then modify the parent's value just by modifying its own\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

Note that for curly components ({{my-component}}) the bindings are already mutable,\nmaking the mut unnecessary.

\n

Additionally, the mut helper can be combined with the fn helper to\nmutate a value. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=totalClicks click-count-change=(fn (mut totalClicks))}}
\n
\n
\n \n

The child Component would invoke the function with the new click value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.get('click-count-change')(this.get('childClickCount') + 1);\n  }\n});
\n
\n
\n \n

The mut helper changes the totalClicks value to what was provided as the fn argument.

\n

The mut helper, when used with fn, will return a function that\nsets the value passed to mut to its first argument. As an example, we can create a\nbutton that increments a value passing the value directly to the fn:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{! inc helper is not provided by Ember }}\n<button onclick={{fn (mut count) (inc count)}}>\n  Increment count\n</button>
\n
\n
\n \n", + "itemtype": "method", + "name": "mut", + "params": [ + { + "name": "attr", + "description": "the \"two-way\" attribute that can be modified.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/page-title.ts", + "line": 5, + "description": "

page-title allows you to set the title of any page in your application and\nappend additional titles for each route. For complete documentation, see\nhttps://github.com/ember-cli/ember-page-title.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{page-title "My Page Title" }}
\n
\n
\n \n", + "itemtype": "method", + "name": "page-title", + "params": [ + { + "name": "param", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/readonly.ts", + "line": 9, + "description": "

The readonly helper let's you specify that a binding is one-way only,\ninstead of two-way.\nWhen you pass a readonly binding from an outer context (e.g. parent component),\nto to an inner context (e.g. child component), you are saying that changing that\nproperty in the inner context does not change the value in the outer context.

\n

To specify that a binding is read-only, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n
export default Component.extend({\n  totalClicks: 3\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} // -> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Now, when you update childClickCount:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n
export default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

The value updates in the child component, but not the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClickCount}} //-> 4
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Objects and Arrays

\n

When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string),\nonly the reference to the object is protected using the readonly helper.\nThis means that you can change properties of the object both on the parent component, as well as the child component.\nThe readonly binding behaves similar to the const keyword in JavaScript.

\n

Let's look at an example:

\n

First let's set up the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  clicks: null,\n\n  init() {\n    this._super(...arguments);\n    this.set('clicks', { total: 3 });\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n

Now, if you update the total property of childClicks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    this.get('clicks').incrementProperty('total');\n  }\n});
\n
\n
\n \n

You will see the following happen:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClicks.total}} //-> 4
\n
\n
\n \n", + "itemtype": "method", + "name": "readonly", + "params": [ + { + "name": "attr", + "description": "the read-only attribute.", + "type": "Object", + "optional": true + } + ], + "access": "private", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unbound.ts", + "line": 10, + "description": "

The {{unbound}} helper disconnects the one-way binding of a property,\nessentially freezing its value at the moment of rendering. For example,\nin this example the display of the variable name will not change even\nif it is set with a new value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{unbound this.name}}
\n
\n
\n \n

Like any helper, the unbound helper can accept a nested helper expression.\nThis allows for custom helpers to be rendered unbound:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{unbound (some-custom-helper)}}\n{{unbound (capitalize this.name)}}\n{{! You can use any helper, including unbound, in a nested expression }}\n{{capitalize (unbound this.name)}}
\n
\n
\n \n

The unbound helper only accepts a single argument, and it return an\nunbound value.

\n", + "itemtype": "method", + "name": "unbound", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts", + "line": 5, + "description": "

Use the {{unique-id}} helper to generate a unique ID string suitable for use as\nan ID attribute in the DOM.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id={{unique-id}} type="email" />
\n
\n
\n \n

Each 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#let (unique-id) as |emailId|}}\n  <label for={{emailId}}>Email address</label>\n  <input id={{emailId}} type="email" />\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "unique-id", + "since": "4.4.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/modifiers/on.ts", + "line": 5, + "description": "

The {{on}} modifier lets you easily add event listeners (it uses\nEventTarget.addEventListener\ninternally).

\n

For example, if you'd like to run a function on your component when a <button>\nin the components template is clicked you might do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' this.saveLike}}>Like this post!</button>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class LikePostComponent extends Component {\n  @action\n  saveLike() {\n    // someone likes your post!\n    // better send a request off to your server...\n  }\n}
\n
\n
\n \n

Arguments

\n

{{on}} accepts two positional arguments, and a few named arguments.

\n

The positional arguments are:

\n
    \n
  • event -- the name to use when calling addEventListener
  • \n
  • callback -- the function to be passed to addEventListener
  • \n
\n

The named arguments are:

\n
    \n
  • capture -- a true value indicates that events of this type will be dispatched\nto the registered listener before being dispatched to any EventTarget beneath it\nin the DOM tree.
  • \n
  • once -- indicates that the listener should be invoked at most once after being\nadded. If true, the listener would be automatically removed when invoked.
  • \n
  • passive -- if true, indicates that the function specified by listener will never\ncall preventDefault(). If a passive listener does call preventDefault(), the user\nagent will do nothing other than generate a console warning. See\nImproving scrolling performance with passive listeners\nto learn more.
  • \n
\n

The callback function passed to {{on}} will receive any arguments that are passed\nto the event handler. Most commonly this would be the event itself.

\n

If you would like to pass additional arguments to the function you should use\nthe {{fn}} helper.

\n

For example, in our example case above if you'd like to pass in the post that\nwas being liked when the button is clicked you could do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' (fn this.saveLike @post)}}>Like this post!</button>
\n
\n
\n \n

In this case, the saveLike function will receive two arguments: the click event\nand the value of @post.

\n

Function Context

\n

In the example above, we used @action to ensure that likePost is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class LikePostComponent extends Component {\n  saveLike() {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when the button is clicked saveLike will be invoked,\nit will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into on!

\n", + "itemtype": "method", + "name": "on", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/in-element.ts", + "line": 5, + "description": "

The in-element helper renders its block content outside of the regular flow,\ninto a DOM element given by its destinationElement positional argument.

\n

Common use cases - often referred to as "portals" or "wormholes" - are rendering\ndropdowns, modals or tooltips close to the root of the page to bypass CSS overflow\nrules, or to render content to parts of the page that are outside of the control\nof the Ember app itself (e.g. embedded into a static or server rendered HTML page).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#in-element this.destinationElement}}\n  <div>Some content</div>\n{{/in-element}}
\n
\n
\n \n

Arguments

\n

{{in-element}} requires a single positional argument:

\n
    \n
  • destinationElement -- the DOM element to render into. It must exist at the time\nof rendering.
  • \n
\n

It also supports an optional named argument:

\n
    \n
  • insertBefore -- by default the DOM element's content is replaced when used as\ndestinationElement. Passing null changes the behaviour to appended at the end\nof any existing content. Any other value than null is currently not supported.
  • \n
\n", + "itemtype": "method", + "name": "in-element", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/let.ts", + "line": 5, + "description": "

The let helper receives one or more positional arguments and yields\nthem out as block params.

\n

This allows the developer to introduce shorter names for certain computations\nin the template.

\n

This is especially useful if you are passing properties to a component\nthat receives a lot of options and you want to clean up the invocation.

\n

For the following example, the template receives a post object with\ncontent and title properties.

\n

We are going to call the my-post component, passing a title which is\nthe title of the post suffixed with the name of the blog, the content\nof the post, and a series of options defined in-place.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n    (concat post.title ' | The Ember.js Blog')\n    post.content\n    (hash\n      theme="high-contrast"\n      enableComments=true\n    )\n    as |title content options|\n}}\n  <MyPost @title={{title}} @content={{content}} @options={{options}} />\n{{/let}}
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n  (concat post.title ' | The Ember.js Blog')\n  post.content\n  (hash\n    theme="high-contrast"\n    enableComments=true\n  )\n  as |title content options|\n}}\n{{my-post title=title content=content options=options}}\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "let", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/mount.ts", + "line": 16, + "description": "

The {{mount}} helper lets you embed a routeless engine in a template.\nMounting an engine will cause an instance to be booted and its application\ntemplate to be rendered.

\n

For example, the following template mounts the ember-chat engine:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! application.hbs }}\n{{mount "ember-chat"}}
\n
\n
\n \n

Additionally, you can also pass in a model argument that will be\nset as the engines model. This can be an existing object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div>\n  {{mount 'admin' model=userSettings}}\n</div>
\n
\n
\n \n

Or an inline hash, and you can even pass components:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>\n  <h1>Application template!</h1>\n  {{mount 'admin' model=(hash\n      title='Secret Admin'\n      signInButton=(component 'sign-in-button')\n  )}}\n</div>
\n
\n
\n \n", + "itemtype": "method", + "name": "mount", + "params": [ + { + "name": "name", + "description": "Name of the engine to mount.", + "type": "String" + }, + { + "name": "model", + "description": "Object that will be set as\n the model of the engine.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/outlet.ts", + "line": 22, + "description": "

The {{outlet}} helper lets you specify where a child route will render in\nyour template. An important use of the {{outlet}} helper is in your\napplication's application.hbs file:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n7\n8\n
<MyHeader />\n\n<div class="my-dynamic-content">\n  <!-- this content will change based on the current route, which depends on the current URL -->\n  {{outlet}}\n</div>\n\n<MyFooter />
\n
\n
\n \n

See the routing guide for more\ninformation on how your route interacts with the {{outlet}} helper.\nNote: Your content will not render if there isn't an {{outlet}} for it.

\n", + "itemtype": "method", + "name": "outlet", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 91, + "description": "

{{yield}} denotes an area of a template that will be rendered inside\nof another template.

\n

Use with Component

\n

When designing components {{yield}} is used to denote where, inside the component's\ntemplate, an optional block passed to the component should render:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<LabeledTextfield @value={{@model.name}}>\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<label>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n

Additionally you can yield properties into the context for use by the consumer:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n
<LabeledTextfield @value={{@model.validation}} @validator={{this.firstNameValidator}} as |validationError|>\n  {{#if validationError}}\n    <p class="error">{{validationError}}</p>\n  {{/if}}\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield this.validationError}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<label>\n  <p class="error">First Name must be at least 3 characters long.</p>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n", + "itemtype": "method", + "name": "yield", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "return": { + "description": "HTML string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 152, + "description": "

{{(has-block)}} indicates if the component was invoked with a block.

\n

This component is invoked with a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component}}
\n
\n
\n \n

Using angle bracket invocation, this looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent>Hi Jen!</MyComponent> {{! with a block}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent/> {{! without a block}}
\n
\n
\n \n

This is useful when you want to create a component that can optionally take a block\nand then render a default template when it is not invoked with a block.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n
{{#if (has-block)}}\n  Welcome {{yield}}, we are happy you're here!\n{{else}}\n  Hey you! You're great!\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with a block", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 197, + "description": "

{{(has-block-params)}} indicates if the component was invoked with block params.

\n

This component is invoked with block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component as |favoriteFlavor|}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jenn!\n{{/my-component}}
\n
\n
\n \n

With angle bracket syntax, block params look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent as |favoriteFlavor|>\nHi Jen!\n</MyComponent>
\n
\n
\n \n

And without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent>\n  Hi Jen!\n</MyComponent>
\n
\n
\n \n

This is useful when you want to create a component that can render itself\ndifferently when it is not invoked with block params.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if (has-block-params)}}\n  Welcome {{yield this.favoriteFlavor}}, we're happy you're here and hope you\n  enjoy your favorite ice cream flavor.\n{{else}}\n  Welcome {{yield}}, we're happy you're here, but we're unsure what\n  flavor ice cream you would enjoy.\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block-params", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with block params", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 252, + "description": "

Execute the debugger statement in the current template's context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{debugger}}
\n
\n
\n \n

When using the debugger helper you will have access to a get function. This\nfunction retrieves values available in the context of the template.\nFor example, if you're wondering why a value {{foo}} isn't rendering as\nexpected within a template, you could place a {{debugger}} statement and,\nwhen the debugger; breakpoint is hit, you can attempt to retrieve this value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('foo')
\n
\n
\n \n

get is also aware of keywords. So in this situation

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#each this.items as |item|}}\n  {{debugger}}\n{{/each}}
\n
\n
\n \n

You'll be able to get values from the current item:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('item.name')
\n
\n
\n \n

You can also access the context of the view to make sure it is the object that\nyou expect:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> context
\n
\n
\n \n", + "itemtype": "method", + "name": "debugger", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.Test-ae14b55041.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.Test-ae14b55041.json new file mode 100644 index 000000000..b1a2e7c09 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.Test-ae14b55041.json @@ -0,0 +1,147 @@ +{ + "data": { + "id": "ember-4.7.1-Ember.Test", + "type": "class", + "attributes": { + "name": "Ember.Test", + "shortname": "Ember.Test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/ember-testing/lib/test.ts", + "line": 11, + "description": "

This is a container for an assortment of testing related functionality:

\n
    \n
  • Choose your default test adapter (for your framework of choice).
  • \n
  • Register/Unregister additional test helpers.
  • \n
  • Setup callbacks to be fired when the test helpers are injected into\nyour application.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/ember-testing/lib/test/on_inject_helpers.ts", + "line": 5, + "description": "

Used to register callbacks to be fired whenever App.injectTestHelpers\nis called.

\n

The callback will receive the current application as an argument.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import $ from 'jquery';\n\nEmber.Test.onInjectHelpers(function() {\n  $(document).ajaxSend(function() {\n    Test.pendingRequests++;\n  });\n\n  $(document).ajaxComplete(function() {\n    Test.pendingRequests--;\n  });\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "onInjectHelpers", + "params": [ + { + "name": "callback", + "description": "The function to be called.", + "type": "Function" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.ts", + "line": 32, + "description": "

This returns a thenable tailored for testing. It catches failed\nonSuccess callbacks and invokes the Ember.Test.adapter.exception\ncallback in the last chained then.

\n

This method should be returned by async helpers such as wait.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "promise", + "params": [ + { + "name": "resolver", + "description": "The function used to resolve the promise.", + "type": "Function" + }, + { + "name": "label", + "description": "An optional string for identifying the promise.", + "type": "String" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.ts", + "line": 50, + "description": "

Replacement for Ember.RSVP.resolve\nThe only difference is this uses\nan instance of Ember.Test.Promise

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "The", + "description": "value to resolve", + "type": "Mixed" + } + ], + "since": "1.2.0", + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/setup_for_testing.ts", + "line": 8, + "description": "

Sets Ember up for testing. This is useful to perform\nbasic setup steps in order to unit test.

\n

Use App.setupForTesting to perform integration tests (full\napplication testing).

\n", + "itemtype": "method", + "name": "setupForTesting", + "since": "1.5.0", + "access": "private", + "tagname": "", + "class": "Ember.Test", + "module": "@ember/test", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/test.ts", + "line": 24, + "description": "

Hash containing all known test helpers.

\n", + "itemtype": "property", + "name": "_helpers", + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/ember-testing/lib/test.ts", + "line": 45, + "description": "

Used to allow ember-testing to communicate with a specific testing\nframework.

\n

You can manually set it before calling App.setupForTesting().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Ember.Test.adapter = MyCustomAdapter.create()
\n
\n
\n \n

If you do not set it, ember-testing will default to Ember.Test.QUnitAdapter.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "adapter", + "type": "{Class} The adapter to be used.", + "default": "Ember.Test.QUnitAdapter", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.ViewMixin-a40f7cc76c.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.ViewMixin-a40f7cc76c.json new file mode 100644 index 000000000..93076fd96 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Ember.ViewMixin-a40f7cc76c.json @@ -0,0 +1,322 @@ +{ + "data": { + "id": "ember-4.7.1-Ember.ViewMixin", + "type": "class", + "attributes": { + "name": "Ember.ViewMixin", + "shortname": "Ember.ViewMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 14, + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 92, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 120, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 140, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 180, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 245, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 330, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 404, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 438, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 299, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 307, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 320, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 344, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 357, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 365, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 34, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 165, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 266, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 377, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-EmberArray-1a98ed04ad.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-EmberArray-1a98ed04ad.json new file mode 100644 index 000000000..91e71ed3a --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-EmberArray-1a98ed04ad.json @@ -0,0 +1,836 @@ +{ + "data": { + "id": "ember-4.7.1-EmberArray", + "type": "class", + "attributes": { + "name": "EmberArray", + "shortname": "EmberArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "MutableArray" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 219, + "description": "

This mixin implements Observer-friendly Array-like behavior. It is not a\nconcrete implementation, but it can be used up by other classes that want\nto appear like arrays.

\n

For example, ArrayProxy is a concrete class that can be instantiated to\nimplement array-like behavior. This class uses the Array Mixin by way of\nthe MutableArray mixin, which allows observable changes to be made to the\nunderlying array.

\n

This mixin defines methods specifically for collections that provide\nindex-ordered access to their contents. When you are designing code that\nneeds to accept any kind of Array-like object, you should use these methods\ninstead of Array primitives because these will properly notify observers of\nchanges to the array.

\n

Although these methods are efficient, they do add a layer of indirection to\nyour application so it is a good idea to use them only when you need the\nflexibility of using both true JavaScript arrays and "virtual" arrays such\nas controllers and collections.

\n

You can use the methods defined in this module to access and modify array\ncontents in an observable-friendly way. You can also be notified whenever\nthe membership of an array changes by using .observes('myArray.[]').

\n

To support EmberArray in your own class, you must override two\nprimitives to use it: length() and objectAt().

\n", + "uses": [ + "Enumerable" + ], + "since": "Ember 0.9.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 329, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 354, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 438, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 481, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 523, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 577, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 637, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 660, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 683, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 731, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 752, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 829, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 881, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 906, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 934, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 981, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1015, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1057, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1101, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1145, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1175, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1246, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1285, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1297, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1313, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1346, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1390, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1409, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1431, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 319, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 373, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 401, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 426, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-EmberObject-274b944f82.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-EmberObject-274b944f82.json new file mode 100644 index 000000000..523c71873 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-EmberObject-274b944f82.json @@ -0,0 +1,596 @@ +{ + "data": { + "id": "ember-4.7.1-EmberObject", + "type": "class", + "attributes": { + "name": "EmberObject", + "shortname": "EmberObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/object.ts", + "line": 13, + "description": "

EmberObject is the main base class for all Ember objects. It is a subclass\nof CoreObject with the Observable mixin applied. For details,\nsee the documentation for each of these.

\n", + "extends": "CoreObject", + "uses": [ + "Observable" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.7.1-ContainerDebugAdapter" + }, + { + "type": "class", + "id": "ember-4.7.1-DataAdapter" + }, + { + "type": "class", + "id": "ember-4.7.1-HashLocation" + }, + { + "type": "class", + "id": "ember-4.7.1-HistoryLocation" + }, + { + "type": "class", + "id": "ember-4.7.1-NoneLocation" + }, + { + "type": "class", + "id": "ember-4.7.1-Route" + }, + { + "type": "class", + "id": "ember-4.7.1-EmberRouter" + }, + { + "type": "class", + "id": "ember-4.7.1-ArrayProxy" + }, + { + "type": "class", + "id": "ember-4.7.1-Namespace" + }, + { + "type": "class", + "id": "ember-4.7.1-ObjectProxy" + }, + { + "type": "class", + "id": "ember-4.7.1-Ember.CoreView" + }, + { + "type": "class", + "id": "ember-4.7.1-Controller" + }, + { + "type": "class", + "id": "ember-4.7.1-EngineInstance" + }, + { + "type": "class", + "id": "ember-4.7.1-Service" + } + ] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-EmberRouter-63908d4c0e.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-EmberRouter-63908d4c0e.json new file mode 100644 index 000000000..2df73c081 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-EmberRouter-63908d4c0e.json @@ -0,0 +1,1192 @@ +{ + "data": { + "id": "ember-4.7.1-EmberRouter", + "type": "class", + "attributes": { + "name": "EmberRouter", + "shortname": "EmberRouter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 137, + "description": "

The EmberRouter class manages the application state and URLs. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 216, + "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

The first parameter is the name of the route which is used by default as the\npath name as well.

\n

The 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\nsegments.
  • \n
  • resetNamespace: false by default; when nesting routes, ember will\ncombine the route names to form the fully-qualified route name, which is\nused with {{link-to}} or manually transitioning to routes. Setting\nresetNamespace: true will cause the route not to inherit from its\nparent route's names. This is handy for preventing extremely long route names.\nKeep in mind that the actual URL path behavior is still retained.
  • \n
\n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
Router.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
\n
\n \n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 551, + "description": "

Initializes the current router instance and sets up the change handling\nevent listeners used by the instances location implementation.

\n

A property named initialURL will be used to determine the initial URL.\nIf no value is found / will be used.

\n", + "itemtype": "method", + "name": "startRouting", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 674, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 719, + "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", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 746, + "description": "

Determines if the supplied route is currently active.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 758, + "description": "

An alternative form of isActive that doesn't require\nmanual concatenation of the arguments into a single\narray.

\n", + "itemtype": "method", + "name": "isActiveIntent", + "params": [ + { + "name": "routeName", + "description": "" + }, + { + "name": "models", + "description": "" + }, + { + "name": "queryParams", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 780, + "description": "

Does this router instance have the given route.

\n", + "itemtype": "method", + "name": "hasRoute", + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 791, + "description": "

Resets the state of the router by clearing the current route\nhandlers and deactivating them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 939, + "description": "

Serializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Arrray" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 969, + "description": "

Serializes the value of a query parameter based on a type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "type", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 987, + "description": "

Deserializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1015, + "description": "

Deserializes the value of a query parameter based on a default type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "defaultType", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1036, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_pruneDefaultQueryParamValues", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1117, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareQueryParams", + "params": [ + { + "name": "targetRouteName", + "description": "", + "type": "String" + }, + { + "name": "models", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + }, + { + "name": "keepDefaultQueryParamValues", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1144, + "description": "

Returns the meta information for the query params of a given route. This\nwill be overridden to allow support for lazy routes.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getQPMeta", + "params": [ + { + "name": "routeInfo", + "description": "", + "type": "RouteInfo" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1158, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_queryParamsFor", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1220, + "description": "

Maps all query param keys to their fully scoped property name of the form\ncontrollerName:propName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_fullyScopeQueryParams", + "params": [ + { + "name": "leafRouteName", + "description": "", + "type": "String" + }, + { + "name": "contexts", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1258, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_hydrateUnsuppliedQueryParams", + "params": [ + { + "name": "state", + "description": "", + "type": "TransitionState" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1429, + "description": "

Handles updating the paths and notifying any listeners of the URL\nchange.

\n

Triggers the router level didTransition hook.

\n

For example, to notify google analytics when the route changes,\nyou could use this hook. (Note: requires also including GA scripts, etc.)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "didTransition", + "access": "private", + "tagname": "", + "since": "1.2.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1466, + "description": "

Handles notifying any listeners of an impending URL\nchange.

\n

Triggers the router level willTransition hook.

\n", + "itemtype": "method", + "name": "willTransition", + "access": "private", + "tagname": "", + "since": "1.11.0", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 95, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 121, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 142, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 165, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 180, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 147, + "description": "

Represents the URL of the root of the application, often '/'. This prefix is\n assumed on all routes defined on this router.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 158, + "description": "

The location property determines the type of URL's that your\n application will use.

\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 history by the locationType setting of /config/environment.js

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/router.ts", + "line": 1479, + "description": "

Represents the current URL.

\n", + "itemtype": "property", + "name": "url", + "type": "{String}", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Engine-b8f3ca3066.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Engine-b8f3ca3066.json new file mode 100644 index 000000000..8e5cbffeb --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Engine-b8f3ca3066.json @@ -0,0 +1,499 @@ +{ + "data": { + "id": "ember-4.7.1-Engine", + "type": "class", + "attributes": { + "name": "Engine", + "shortname": "Engine", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/index.ts", + "line": 40, + "description": "

The Engine class contains core functionality for both applications and\nengines.

\n

Each engine manages a registry that's used for dependency injection and\nexposed through RegistryProxy.

\n

Engines also manage initializers and instance initializers.

\n

Engines can spawn EngineInstance instances via buildInstance().

\n", + "extends": "Ember.Namespace", + "uses": [ + "RegistryProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/engine/index.ts", + "line": 62, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 209, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 285, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 346, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 359, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 371, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 384, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 392, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 400, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 414, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 448, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Enginer" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 51, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/index.ts", + "line": 325, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 338, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Engine", + "module": "@ember/engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.Namespace", + "type": "missing" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.7.1-Application" + } + ] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-EngineInstance-24a7c4d1c6.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-EngineInstance-24a7c4d1c6.json new file mode 100644 index 000000000..8a304f5ec --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-EngineInstance-24a7c4d1c6.json @@ -0,0 +1,1003 @@ +{ + "data": { + "id": "ember-4.7.1-EngineInstance", + "type": "class", + "attributes": { + "name": "EngineInstance", + "shortname": "EngineInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/instance.ts", + "line": 26, + "description": "

The EngineInstance encapsulates all of the stateful aspects of a\nrunning Engine.

\n", + "access": "public", + "tagname": "", + "extends": "EmberObject", + "uses": [ + "RegistryProxyMixin", + "ContainerProxyMixin" + ], + "methods": [ + { + "file": "packages/@ember/engine/instance.ts", + "line": 39, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 86, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 152, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 169, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 199, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 51, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 39, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 65, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 126, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/instance.ts", + "line": 47, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 31, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.7.1-ApplicationInstance" + } + ] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Evented-aff8932e1d.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Evented-aff8932e1d.json new file mode 100644 index 000000000..ff8d5ff6b --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Evented-aff8932e1d.json @@ -0,0 +1,190 @@ +{ + "data": { + "id": "ember-4.7.1-Evented", + "type": "class", + "attributes": { + "name": "Evented", + "shortname": "Evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Route", + "EmberRouter", + "Ember.CoreView" + ], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 13, + "description": "

This mixin allows for Ember objects to subscribe to and emit events.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/utils/person.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport Evented from '@ember/object/evented';\n\nexport default EmberObject.extend(Evented, {\n  greet() {\n    // ...\n    this.trigger('greet');\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
var person = Person.create();\n\nperson.on('greet', function() {\n  console.log('Our person has greeted');\n});\n\nperson.greet();\n\n// outputs: 'Our person has greeted'
\n
\n
\n \n

You can also chain multiple event subscriptions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
person.on('greet', function() {\n  console.log('Our person has greeted');\n}).one('greet', function() {\n  console.log('Offer one-time special');\n}).off('event', this, forgetThis);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 95, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 121, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 142, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 165, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 180, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-HashLocation-89c4de3959.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-HashLocation-89c4de3959.json new file mode 100644 index 000000000..7ce36193b --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-HashLocation-89c4de3959.json @@ -0,0 +1,641 @@ +{ + "data": { + "id": "ember-4.7.1-HashLocation", + "type": "class", + "attributes": { + "name": "HashLocation", + "shortname": "HashLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 11, + "description": "

HashLocation implements the location API using the browser's\nhash. At present, it relies on a hashchange event existing in the\nbrowser.

\n

Using HashLocation results in URLs with a # (hash sign) separating the\nserver side URL portion of the URL from the portion that is used by Ember.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'hash'\n});
\n
\n
\n \n

This will result in a posts.new url of /#/posts/new.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 51, + "access": "private", + "tagname": "Returns normalized location.hash", + "since": "1.5.1", + "itemtype": "method", + "name": "getHash", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 63, + "description": "

Returns the normalized URL, constructed from location.hash.

\n

e.g. #/foo => /foo as well as #/foo#bar => /foo#bar.

\n

By convention, hashed paths must begin with a forward slash, otherwise they\nare not treated as a path so we can distinguish intent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 93, + "description": "

Set the location.hash and remembers what was set. This prevents\nonUpdateURL callbacks from triggering when the hash was set by\nHashLocation.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 107, + "description": "

Uses location.replace to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 122, + "description": "

Register a callback to be invoked when the hash changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 147, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/hash_location.ts", + "line": 162, + "description": "

Cleans up the HashLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HashLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Helper-2e9ba4bf86.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Helper-2e9ba4bf86.json new file mode 100644 index 000000000..10027e5c3 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Helper-2e9ba4bf86.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.7.1-Helper", + "type": "class", + "attributes": { + "name": "Helper", + "shortname": "Helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 47, + "description": "

Ember Helpers are functions that can compute values, and are used in templates.\nFor example, this code calls a helper named format-currency:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Cost @cents={{230}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/cost.hbs
1\n
<div>{{format-currency @cents currency="$"}}</div>
\n
\n
\n \n

Additionally a helper can be called as a nested helper.\nIn this example, we show the formatted currency value if the showMoney\nnamed argument is truthy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{if @showMoney (format-currency @cents currency="$")}}
\n
\n
\n \n

Helpers defined using a class must provide a compute function. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n6\n7\n
import Helper from '@ember/component/helper';\n\nexport default class extends Helper {\n  compute([cents], { currency }) {\n    return `${currency}${cents * 0.01}`;\n  }\n}
\n
\n
\n \n

Each time the input to a helper changes, the compute function will be\ncalled again.

\n

As instances, these helpers also have access to the container and will accept\ninjected dependencies.

\n

Additionally, class helpers can call recompute to force a new computation.

\n", + "extends": "CoreObject", + "access": "public", + "tagname": "", + "since": "1.13.0", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 93, + "description": "

Override this function when writing a class-based helper.

\n", + "itemtype": "method", + "name": "compute", + "params": [ + { + "name": "params", + "description": "The positional arguments to the helper", + "type": "Array" + }, + { + "name": "hash", + "description": "The named arguments to the helper", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 117, + "description": "

On a class-based helper, it may be useful to force a recomputation of that\nhelpers value. This is akin to rerender on a component.

\n

For example, this component will rerender when the currentUser on a\nsession service changes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
email.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Helper from '@ember/component/helper'\nimport { service } from '@ember/service'\nimport { observer } from '@ember/object'\n\nexport default Helper.extend({\n  session: service(),\n\n  onNewUser: observer('session.currentUser', function() {\n    this.recompute();\n  }),\n\n  compute() {\n    return this.get('session.currentUser.email');\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "recompute", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-HistoryLocation-2cc293870d.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-HistoryLocation-2cc293870d.json new file mode 100644 index 000000000..2657754ab --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-HistoryLocation-2cc293870d.json @@ -0,0 +1,707 @@ +{ + "data": { + "id": "ember-4.7.1-HistoryLocation", + "type": "class", + "attributes": { + "name": "HistoryLocation", + "shortname": "HistoryLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 21, + "description": "

HistoryLocation implements the location API using the browser's\nhistory.pushState API.

\n

Using HistoryLocation results in URLs that are indistinguishable from a\nstandard URL. This relies upon the browser's history API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'history'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new.

\n

Keep in mind that your server must serve the Ember app at all the routes you\ndefine.

\n

Using HistoryLocation will also result in location states being recorded by\nthe browser history API with the following schema:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
window.history.state -> { path: '/', uuid: '3552e730-b4a6-46bd-b8bf-d8c3c1a97e0a' }
\n
\n
\n \n

This allows each in-app location state to be tracked uniquely across history\nstate changes via the uuid field.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 79, + "access": "private", + "tagname": "Returns normalized location.hash", + "itemtype": "method", + "name": "getHash", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 105, + "description": "

Used to set state on first call to setURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initState", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 126, + "description": "

Returns the current location.pathname without rootURL or baseURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 153, + "description": "

Uses history.pushState to update the url without a page reload.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 169, + "description": "

Uses history.replaceState to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 186, + "description": "

Pushes a new state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "pushState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 202, + "description": "

Replaces the current state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 218, + "description": "

Register a callback to be invoked whenever the browser\nhistory changes, including using forward and back buttons.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 243, + "description": "

Used when using {{action}} helper. The url is always appended to the rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "formatted url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 267, + "description": "

Cleans up the HistoryLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/history_location.ts", + "line": 71, + "description": "

Will be pre-pended to path upon state change

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Location-1cece8f3c5.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Location-1cece8f3c5.json new file mode 100644 index 000000000..c3e8a4e98 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Location-1cece8f3c5.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.7.1-Location", + "type": "class", + "attributes": { + "name": "Location", + "shortname": "Location", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/api.ts", + "line": 21, + "description": "

Location returns an instance of the correct implementation of\nthe location API.

\n

Implementations

\n

You can pass an implementation name (hash, history, none, auto) to force a\nparticular implementation to be used in your application.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n

Location API

\n

Each location implementation must provide the following methods:

\n
    \n
  • implementation: returns the string name used to reference the implementation.
  • \n
  • getURL: returns the current URL.
  • \n
  • setURL(path): sets the current URL.
  • \n
  • replaceURL(path): replace the current URL (optional).
  • \n
  • onUpdateURL(callback): triggers the callback when the URL changes.
  • \n
  • formatURL(url): formats url to be placed into href attribute.
  • \n
  • detect() (optional): instructs the location to do any feature detection\n necessary. If the location needs to redirect to a different URL, it\n can cancel routing by setting the cancelRouterSetup property on itself\n to false.
  • \n
\n

Calling setURL or replaceURL will not trigger onUpdateURL callbacks.

\n

Custom implementation

\n

Ember scans app/locations/* for extending the Location API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import HistoryLocation from '@ember/routing/history-location';\n\nexport default class MyHistory {\n  implementation = 'my-custom-history';\n\n  constructor() {\n    this._history = HistoryLocation.create(...arguments);\n  }\n\n  create() {\n    return new this(...arguments);\n  }\n\n  pushState(path) {\n     this._history.pushState(path);\n  }\n}
\n
\n
\n \n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/api.ts", + "line": 82, + "description": "

This is deprecated in favor of using the container to lookup the location\nimplementation as desired.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
// Given a location registered as follows:\ncontainer.register('location:history-test', HistoryTestLocation);\n\n// You could create a new instance via:\ncontainer.lookup('location:history-test');
\n
\n
\n \n", + "itemtype": "method", + "name": "create", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "an instance of an implementation of the `location` API", + "type": "Object" + }, + "deprecated": true, + "deprecationMessage": "Use the container to lookup the location implementation that you\n need.", + "access": "private", + "tagname": "", + "class": "Location", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Mixin-96c494c9c7.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Mixin-96c494c9c7.json new file mode 100644 index 000000000..3efd7d172 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Mixin-96c494c9c7.json @@ -0,0 +1,75 @@ +{ + "data": { + "id": "ember-4.7.1-Mixin", + "type": "class", + "attributes": { + "name": "Mixin", + "shortname": "Mixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 442, + "description": "

The Mixin class allows you to create mixins, whose properties can be\nadded to other classes. For instance,

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nconst EditableMixin = Mixin.create({\n  edit() {\n    console.log('starting to edit');\n    this.set('isEditing', true);\n  },\n  isEditing: false\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import EmberObject from '@ember/object';\nimport EditableMixin from '../mixins/editable';\n\n// Mix mixins into classes by passing them as the first arguments to\n// `.extend.`\nconst Comment = EmberObject.extend(EditableMixin, {\n  post: null\n});\n\nlet comment = Comment.create({\n  post: somePost\n});\n\ncomment.edit(); // outputs 'starting to edit'
\n
\n
\n \n

Note that Mixins are created with Mixin.create, not\nMixin.extend.

\n

Note that mixins extend a constructor's prototype so arrays and object literals\ndefined as properties will be shared amongst objects that implement the mixin.\nIf you want to define a property in a mixin that is not shared, you can define\nit either as a computed property or have it be created on initialization of the object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
// filters array will be shared amongst any object implementing mixin\nimport Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\nconst FilterableMixin = Mixin.create({\n  filters: A()\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\nimport { computed } from '@ember/object';\n\n// filters will be a separate array for every object implementing the mixin\nconst FilterableMixin = Mixin.create({\n  filters: computed(function() {\n    return A();\n  })\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\n// filters will be created as a separate array during the object's initialization\nconst Filterable = Mixin.create({\n  filters: null,\n\n  init() {\n    this._super(...arguments);\n    this.set("filters", A());\n  }\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/mixin.ts", + "line": 428, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Mixin", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.7.1-Ember.TargetActionSupport" + } + ] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-MutableArray-dde43b2d85.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-MutableArray-dde43b2d85.json new file mode 100644 index 000000000..b52eb8ed7 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-MutableArray-dde43b2d85.json @@ -0,0 +1,1240 @@ +{ + "data": { + "id": "ember-4.7.1-MutableArray", + "type": "class", + "attributes": { + "name": "MutableArray", + "shortname": "MutableArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "ArrayProxy" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1457, + "description": "

This mixin defines the API for modifying array-like objects. These methods\ncan be applied only to a collection that keeps its items in an ordered set.\nIt builds upon the Array mixin and adds methods to modify the array.\nOne concrete implementations of this class include ArrayProxy.

\n

It is important to use the methods in this class to modify arrays so that\nchanges are observable. This allows the binding system in Ember to function\ncorrectly.

\n

Note that an Array can change even if it does not implement this mixin.\nFor example, one might implement a SparseArray that cannot be directly\nmodified, but if its underlying enumerable changes, it will change also.

\n", + "uses": [ + "MutableEnumerable", + "EmberArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1496, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1515, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1541, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1563, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1588, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1608, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1628, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1654, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1679, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1699, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1720, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1739, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1766, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1794, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1812, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1838, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 329, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 354, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 438, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 481, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 523, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 577, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 637, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 660, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 683, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 731, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 752, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 829, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 881, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 906, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 934, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 981, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1015, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1057, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1101, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1145, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1175, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1246, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1285, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1297, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1313, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1346, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1390, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1409, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 1431, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 319, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 373, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 401, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/array.ts", + "line": 426, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Namespace-eaf897d5f1.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Namespace-eaf897d5f1.json new file mode 100644 index 000000000..8fc5085bb --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Namespace-eaf897d5f1.json @@ -0,0 +1,536 @@ +{ + "data": { + "id": "ember-4.7.1-Namespace", + "type": "class", + "attributes": { + "name": "Namespace", + "shortname": "Namespace", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/namespace.ts", + "line": 20, + "description": "

A Namespace is an object usually used to contain other objects or methods\nsuch as an application or framework. Create a namespace anytime you want\nto define one of these new containers.

\n

Example Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
MyFramework = Ember.Namespace.create({\n  VERSION: '1.0.0'\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-NoneLocation-43f411176f.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-NoneLocation-43f411176f.json new file mode 100644 index 000000000..e1e5e9f1a --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-NoneLocation-43f411176f.json @@ -0,0 +1,639 @@ +{ + "data": { + "id": "ember-4.7.1-NoneLocation", + "type": "class", + "attributes": { + "name": "NoneLocation", + "shortname": "NoneLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 10, + "description": "

NoneLocation does not interact with the browser. It is useful for\ntesting, or when you need to manage state with your Router, but temporarily\ndon't want it to muck with the URL (for example when you embed your\napplication in a larger page).

\n

Using NoneLocation causes Ember to not store the applications URL state\nin the actual URL. This is generally used for testing purposes, and is one\nof the changes made when calling App.setupForTesting().

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 55, + "description": "

Returns the current path without rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "path", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 72, + "description": "

Set the path and remembers what was set. Using this method\nto change the path will not invoke the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 84, + "description": "

Register a callback to be invoked when the path changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 97, + "description": "

Sets the path and calls the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "handleURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 109, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/none_location.ts", + "line": 31, + "description": "

Will be pre-pended to path.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "NoneLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-ObjectProxy-9e55a30a9e.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-ObjectProxy-9e55a30a9e.json new file mode 100644 index 000000000..b50c08016 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-ObjectProxy-9e55a30a9e.json @@ -0,0 +1,571 @@ +{ + "data": { + "id": "ember-4.7.1-ObjectProxy", + "type": "class", + "attributes": { + "name": "ObjectProxy", + "shortname": "ObjectProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/system/object_proxy.ts", + "line": 4, + "description": "

ObjectProxy forwards all properties not defined by the proxy itself\nto a proxied content object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nlet exampleObject = EmberObject.create({\n  name: 'Foo'\n});\n\nlet exampleProxy = ObjectProxy.create({\n  content: exampleObject\n});\n\n// Access and change existing properties\nexampleProxy.get('name');          // 'Foo'\nexampleProxy.set('name', 'Bar');\nexampleObject.get('name');         // 'Bar'\n\n// Create new 'description' property on `exampleObject`\nexampleProxy.set('description', 'Foo is a whizboo baz');\nexampleObject.get('description');  // 'Foo is a whizboo baz'
\n
\n
\n \n

While content is unset, setting a property to be delegated will throw an\nError.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import ObjectProxy from '@ember/object/proxy';\n\nlet exampleProxy = ObjectProxy.create({\n  content: null,\n  flag: null\n});\nexampleProxy.set('flag', true);\nexampleProxy.get('flag');         // true\nexampleProxy.get('foo');          // undefined\nexampleProxy.set('foo', 'data');  // throws Error
\n
\n
\n \n

Delegated properties can be bound to and will change when content is updated.

\n

Computed properties on the proxy itself can depend on delegated properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { computed } from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nProxyWithComputedProperty = ObjectProxy.extend({\n  fullName: computed('firstName', 'lastName', function() {\n    var firstName = this.get('firstName'),\n        lastName = this.get('lastName');\n    if (firstName && lastName) {\n      return firstName + ' ' + lastName;\n    }\n    return firstName || lastName;\n  })\n});\n\nlet exampleProxy = ProxyWithComputedProperty.create();\n\nexampleProxy.get('fullName');  // undefined\nexampleProxy.set('content', {\n  firstName: 'Tom', lastName: 'Dale'\n}); // triggers property change for fullName on proxy\n\nexampleProxy.get('fullName');  // 'Tom Dale'
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "Ember.ProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 72, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 94, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Observable-dde4a8e88c.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Observable-dde4a8e88c.json new file mode 100644 index 000000000..bb1ad52d8 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Observable-dde4a8e88c.json @@ -0,0 +1,388 @@ +{ + "data": { + "id": "ember-4.7.1-Observable", + "type": "class", + "attributes": { + "name": "Observable", + "shortname": "Observable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "EmberObject" + ], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 25, + "description": "

Overview

\n

This mixin provides properties and property observing functionality, core\nfeatures of the Ember object model.

\n

Properties and observers allow one object to observe changes to a\nproperty on another object. This is one of the fundamental ways that\nmodels, controllers and views communicate with each other in an Ember\napplication.

\n

Any object that has this mixin applied can be used in observer\noperations. That includes EmberObject and most objects you will\ninteract with as you write your Ember application.

\n

Note that you will not generally apply this mixin to classes yourself,\nbut you will use the features provided by this module frequently, so it\nis important to understand how to use it.

\n

Using get() and set()

\n

Because of Ember's support for bindings and observers, you will always\naccess properties using the get method, and set properties using the\nset method. This allows the observing objects to be notified and\ncomputed properties to be handled properly.

\n

More documentation about get and set are below.

\n

Observing Property Changes

\n

You typically observe property changes simply by using the observer\nfunction in classes that you write.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { observer } from '@ember/object';\nimport EmberObject from '@ember/object';\n\nEmberObject.extend({\n  valueObserver: observer('value', function(sender, key, value, rev) {\n    // Executes whenever the "value" property changes\n    // See the addObserver method for more information about the callback arguments\n  })\n});
\n
\n
\n \n

Although this is the most common way to add an observer, this capability\nis actually built into the EmberObject class on top of two methods\ndefined in this mixin: addObserver and removeObserver. You can use\nthese two methods to add and remove observers yourself if you need to\ndo so at runtime.

\n

To add an observer for a property, call:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
object.addObserver('propertyKey', targetObject, targetAction)
\n
\n
\n \n

This will call the targetAction method on the targetObject whenever\nthe value of the propertyKey changes.

\n

Note that if propertyKey is a computed property, the observer will be\ncalled when any of the property dependencies are changed, even if the\nresulting value of the computed property is unchanged. This is necessary\nbecause computed properties are not computed until get is called.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Promise-e6a1058f83.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Promise-e6a1058f83.json new file mode 100644 index 000000000..f0b184c91 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Promise-e6a1058f83.json @@ -0,0 +1,246 @@ +{ + "data": { + "id": "ember-4.7.1-Promise", + "type": "class", + "attributes": { + "name": "Promise", + "shortname": "Promise", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 26, + "description": "

Promise objects represent the eventual result of an asynchronous operation. The\nprimary way of interacting with a promise is through its then method, which\nregisters callbacks to receive either a promise’s eventual value or the reason\nwhy the promise cannot be fulfilled.

\n

Terminology

\n
    \n
  • promise is an object or function with a then method whose behavior conforms to this specification.
  • \n
  • thenable is an object or function that defines a then method.
  • \n
  • value is any legal JavaScript value (including undefined, a thenable, or a promise).
  • \n
  • exception is a value that is thrown using the throw statement.
  • \n
  • reason is a value that indicates why a promise was rejected.
  • \n
  • settled the final resting state of a promise, fulfilled or rejected.
  • \n
\n

A promise can be in one of three states: pending, fulfilled, or rejected.

\n

Promises that are fulfilled have a fulfillment value and are in the fulfilled\nstate. Promises that are rejected have a rejection reason and are in the\nrejected state. A fulfillment value is never a thenable.

\n

Promises can also be said to resolve a value. If this value is also a\npromise, then the original promise's settled state will match the value's\nsettled state. So a promise that resolves a promise that rejects will\nitself reject, and a promise that resolves a promise that fulfills will\nitself fulfill.

\n

Basic Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
let promise = new Promise(function(resolve, reject) {\n  // on success\n  resolve(value);\n\n  // on failure\n  reject(reason);\n});\n\npromise.then(function(value) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Advanced Usage:

\n

Promises shine when abstracting away asynchronous interactions such as\nXMLHttpRequests.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
function getJSON(url) {\n  return new Promise(function(resolve, reject){\n    let xhr = new XMLHttpRequest();\n\n    xhr.open('GET', url);\n    xhr.onreadystatechange = handler;\n    xhr.responseType = 'json';\n    xhr.setRequestHeader('Accept', 'application/json');\n    xhr.send();\n\n    function handler() {\n      if (this.readyState === this.DONE) {\n        if (this.status === 200) {\n          resolve(this.response);\n        } else {\n          reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n        }\n      }\n    };\n  });\n}\n\ngetJSON('/posts.json').then(function(json) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Unlike callbacks, promises are great composable primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Promise.all([\n  getJSON('/posts'),\n  getJSON('/comments')\n]).then(function(values){\n  values[0] // => postsJSON\n  values[1] // => commentsJSON\n\n  return values;\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "params": [ + { + "name": "resolver", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "is_constructor": 1, + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/promise/all.js", + "line": 3, + "description": "

Promise.all accepts an array of promises, and returns a new promise which\nis fulfilled with an array of fulfillment values for the passed promises, or\nrejected with the reason of the first passed promise to be rejected. It casts all\nelements of the passed iterable to promises as it runs this algorithm.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Promise, { resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // The array here would be [ 1, 2, 3 ];\n});
\n
\n
\n \n

If any of the promises given to RSVP.all are rejected, the first promise\nthat is rejected will be given as an argument to the returned promises's\nrejection handler. For example:

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Promise, { resolve, reject } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error("2"));\nlet promise3 = reject(new Error("3"));\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(error) {\n  // error.message === "2"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "all", + "params": [ + { + "name": "entries", + "description": "array of promises", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all `promises` have been\nfulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "static": 1, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/race.js", + "line": 9, + "description": "

Promise.race returns a new promise which is settled in the same way as the\nfirst passed promise to settle.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 2');\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // result === 'promise 2' because it was resolved before promise1\n  // was resolved.\n});
\n
\n
\n \n

Promise.race is deterministic in that only the state of the first\nsettled promise matters. For example, even if other promises given to the\npromises array argument are resolved, but the first settled promise has\nbecome rejected before the other promises became fulfilled, the returned\npromise will become rejected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    reject(new Error('promise 2'));\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // Code here never runs\n}, function(reason){\n  // reason.message === 'promise 2' because promise 2 became rejected before\n  // promise 1 became fulfilled\n});
\n
\n
\n \n

An example real-world use case is implementing timeouts:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import Promise from 'rsvp';\n\nPromise.race([ajax('foo.json'), timeout(5000)])
\n
\n
\n \n", + "itemtype": "method", + "name": "race", + "static": 1, + "params": [ + { + "name": "entries", + "description": "array of promises to observe", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for describing the promise returned.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise which settles in the same way as the first passed\npromise to settle.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/reject.js", + "line": 6, + "description": "

Promise.reject returns a promise rejected with the passed reason.\nIt is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  reject(new Error('WHOOPS'));\n});\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = Promise.reject(new Error('WHOOPS'));\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/resolve.js", + "line": 6, + "description": "

Promise.resolve returns a promise that will become resolved with the\npassed value. It is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  resolve(1);\n});\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Promise from 'rsvp';\n\nlet promise = RSVP.Promise.resolve(1);\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "resolve", + "static": 1, + "params": [ + { + "name": "object", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 155, + "description": "

catch is simply sugar for then(undefined, onRejection) which makes it the same\nas the catch block of a try/catch statement.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
function findAuthor(){\n  throw new Error('couldn\\'t find that author');\n}\n\n// synchronous\ntry {\n  findAuthor();\n} catch(reason) {\n  // something went wrong\n}\n\n// async with promises\nfindAuthor().catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 187, + "description": "

finally will be invoked regardless of the promise's fate just as native\ntry/catch/finally behaves

\n

Synchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
findAuthor() {\n  if (Math.random() > 0.5) {\n    throw new Error();\n  }\n  return new Author();\n}\n\ntry {\n  return findAuthor(); // succeed or fail\n} catch(error) {\n  return findOtherAuthor();\n} finally {\n  // always runs\n  // doesn't affect the return value\n}
\n
\n
\n \n

Asynchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findAuthor().catch(function(reason){\n  return findOtherAuthor();\n}).finally(function(){\n  // author was either found, or not\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 248, + "description": "

The primary way of interacting with a promise is through its then method,\nwhich registers callbacks to receive either a promise's eventual value or the\nreason why the promise cannot be fulfilled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function(user){\n  // user is available\n}, function(reason){\n  // user is unavailable, and you are given the reason why\n});
\n
\n
\n \n

Chaining

\n

The return value of then is itself a promise. This second, 'downstream'\npromise is resolved with the return value of the first promise's fulfillment\nor rejection handler, or rejected if the handler throws an exception.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
findUser().then(function (user) {\n  return user.name;\n}, function (reason) {\n  return 'default name';\n}).then(function (userName) {\n  // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n  // will be `'default name'`\n});\n\nfindUser().then(function (user) {\n  throw new Error('Found user, but still unhappy');\n}, function (reason) {\n  throw new Error('`findUser` rejected and we\\'re unhappy');\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n  // If `findUser` rejected, `reason` will be '`findUser` rejected and we\\'re unhappy'.\n});
\n
\n
\n \n

If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
findUser().then(function (user) {\n  throw new PedagogicalException('Upstream error');\n}).then(function (value) {\n  // never reached\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // The `PedgagocialException` is propagated all the way down to here\n});
\n
\n
\n \n

Assimilation

\n

Sometimes the value you want to propagate to a downstream promise can only be\nretrieved asynchronously. This can be achieved by returning a promise in the\nfulfillment or rejection handler. The downstream promise will then be pending\nuntil the returned promise is settled. This is called assimilation.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // The user's comments are now available\n});
\n
\n
\n \n

If the assimliated promise rejects, then the downstream promise will also reject.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // If `findCommentsByAuthor` fulfills, we'll have the value here\n}, function (reason) {\n  // If `findCommentsByAuthor` rejects, we'll have the reason here\n});
\n
\n
\n \n

Simple Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let result;\n\ntry {\n  result = findResult();\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findResult(function(result, err){\n  if (err) {\n    // failure\n  } else {\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findResult().then(function(result){\n  // success\n}, function(reason){\n  // failure\n});
\n
\n
\n \n

Advanced Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let author, books;\n\ntry {\n  author = findAuthor();\n  books  = findBooksByAuthor(author);\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
function foundBooks(books) {\n\n}\n\nfunction failure(reason) {\n\n}\n\nfindAuthor(function(author, err){\n  if (err) {\n    failure(err);\n    // failure\n  } else {\n    try {\n      findBoooksByAuthor(author, function(books, err) {\n        if (err) {\n          failure(err);\n        } else {\n          try {\n            foundBooks(books);\n          } catch(reason) {\n            failure(reason);\n          }\n        }\n      });\n    } catch(error) {\n      failure(err);\n    }\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findAuthor().\n  then(findBooksByAuthor).\n  then(function(books){\n    // found books\n}).catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "onFulfillment", + "description": "", + "type": "Function" + }, + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-PromiseProxyMixin-1a8e1fd130.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-PromiseProxyMixin-1a8e1fd130.json new file mode 100644 index 000000000..7fa51bbc1 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-PromiseProxyMixin-1a8e1fd130.json @@ -0,0 +1,186 @@ +{ + "data": { + "id": "ember-4.7.1-PromiseProxyMixin", + "type": "class", + "attributes": { + "name": "PromiseProxyMixin", + "shortname": "PromiseProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 46, + "description": "

A low level mixin making ObjectProxy promise-aware.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { resolve } from 'rsvp';\nimport $ from 'jquery';\nimport ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nlet ObjectPromiseProxy = ObjectProxy.extend(PromiseProxyMixin);\n\nlet proxy = ObjectPromiseProxy.create({\n  promise: resolve($.getJSON('/some/remote/data.json'))\n});\n\nproxy.then(function(json){\n   // the json\n}, function(reason) {\n   // the reason why you have no json\n});
\n
\n
\n \n

the proxy has bindable attributes which\ntrack the promises life cycle

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> true\nproxy.get('isSettled')  //=> false\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> false
\n
\n
\n \n

When the $.getJSON completes, and the promise is fulfilled\nwith json, the life cycle attributes will update accordingly.\nNote that $.getJSON doesn't return an ECMA specified promise,\nit is useful to wrap this with an RSVP.resolve so that it behaves\nas a spec compliant promise.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> false\nproxy.get('isSettled')   //=> true\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> true
\n
\n
\n \n

As the proxy is an ObjectProxy, and the json now its content,\nall the json properties will be available directly from the proxy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// Assuming the following json:\n{\n  firstName: 'Stefan',\n  lastName: 'Penner'\n}\n\n// both properties will accessible on the proxy\nproxy.get('firstName') //=> 'Stefan'\nproxy.get('lastName')  //=> 'Penner'
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 204, + "description": "

An alias to the proxied promise's then.

\n

See RSVP.Promise.then.

\n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 216, + "description": "

An alias to the proxied promise's catch.

\n

See RSVP.Promise.catch.

\n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 229, + "description": "

An alias to the proxied promise's finally.

\n

See RSVP.Promise.finally.

\n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 125, + "description": "

If the proxied promise is rejected this will contain the reason\nprovided.

\n", + "itemtype": "property", + "name": "reason", + "default": "null", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 135, + "description": "

Once the proxied promise has settled this will become false.

\n", + "itemtype": "property", + "name": "isPending", + "default": "true", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 146, + "description": "

Once the proxied promise has settled this will become true.

\n", + "itemtype": "property", + "name": "isSettled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 157, + "description": "

Will become true if the proxied promise is rejected.

\n", + "itemtype": "property", + "name": "isRejected", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 166, + "description": "

Will become true if the proxied promise is fulfilled.

\n", + "itemtype": "property", + "name": "isFulfilled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/promise_proxy.ts", + "line": 175, + "description": "

The promise whose fulfillment value is being proxied by this object.

\n

This property must be specified upon creation, and should not be\nchanged once created.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nObjectProxy.extend(PromiseProxyMixin).create({\n  promise: <thenable>\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "promise", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Registry-6755ae8394.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Registry-6755ae8394.json new file mode 100644 index 000000000..99e5e2270 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Registry-6755ae8394.json @@ -0,0 +1,407 @@ +{ + "data": { + "id": "ember-4.7.1-Registry", + "type": "class", + "attributes": { + "name": "Registry", + "shortname": "Registry", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 57, + "description": "

A registry used to store factory and option information keyed\nby type.

\n

A Registry stores the factory and option information needed by a\nContainer to instantiate and cache objects.

\n

The API for Registry is still in flux and should not be considered stable.

\n", + "access": "private", + "tagname": "", + "since": "1.11.0", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 146, + "description": "

Creates a container based on this registry.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "container", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "created container", + "type": "Container" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 158, + "description": "

Registers a factory for later injection.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let registry = new Registry();\n\nregistry.register('model:user', Person, {singleton: false });\nregistry.register('fruit:favorite', Orange);\nregistry.register('communication:main', Email, {singleton: false});
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "factory", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 195, + "description": "

Unregister a fullName

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.register('model:user', User);\n\nregistry.resolve('model:user').create() instanceof User //=> true\n\nregistry.unregister('model:user')\nregistry.resolve('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 223, + "description": "

Given a fullName return the corresponding factory.

\n

By default resolve will retrieve the factory from\nthe registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let registry = new Registry();\nregistry.register('api:twitter', Twitter);\n\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n

Optionally the registry can be provided with a custom resolver.\nIf provided, resolve will first provide the custom resolver\nthe opportunity to resolve the fullName, otherwise it will fallback\nto the registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.resolver = function(fullName) {\n   // lookup via the module system of choice\n };\n\n// the twitter factory is added to the module system\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 264, + "description": "

A hook that can be used to describe how the resolver will\nattempt to find the factory.

\n

For example, the default Ember .describe returns the full\nclass name (including namespace) where Ember's resolver expects\nto find the fullName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "describe", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "described fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 287, + "description": "

A hook to enable custom fullName normalization behavior

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalizeFullName", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 305, + "description": "

Normalize a fullName based on the application's conventions

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalize", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 320, + "itemtype": "method", + "name": "makeToString", + "access": "private", + "tagname": "", + "params": [ + { + "name": "factory", + "description": "", + "type": "Any" + }, + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "toString function", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 338, + "description": "

Given a fullName check if the container is aware of its factory\nor singleton instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "the fullname of the request source (used for local lookups)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 357, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let registry = new Registry();\nlet container = registry.container();\n\n// if all of type `connection` must not be singletons\nregistry.optionsForType('connection', { singleton: false });\n\nregistry.register('connection:twitter', TwitterConnection);\nregistry.register('connection:facebook', FacebookConnection);\n\nlet twitter = container.lookup('connection:twitter');\nlet twitter2 = container.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = container.lookup('connection:facebook');\nlet facebook2 = container.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "optionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 398, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "options", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 471, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "knownForType", + "params": [ + { + "name": "type", + "description": "the type to iterate over", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 96, + "description": "

A backup registry for resolving registrations when no matches can be found.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "fallback", + "type": "Registry", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 104, + "description": "

An object that has a resolve method that resolves a name.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "resolver", + "type": "Resolver", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 112, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registrations", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 118, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_normalizeCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 125, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_resolveCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 132, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_options", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 139, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_typeOptions", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-RegistryProxyMixin-23cc508803.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-RegistryProxyMixin-23cc508803.json new file mode 100644 index 000000000..f93c50ec2 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-RegistryProxyMixin-23cc508803.json @@ -0,0 +1,285 @@ +{ + "data": { + "id": "ember-4.7.1-RegistryProxyMixin", + "type": "class", + "attributes": { + "name": "RegistryProxyMixin", + "shortname": "RegistryProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Engine", + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 37, + "description": "

RegistryProxyMixin is used to provide public access to specific\nregistry functionality.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 51, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "RegistryProxyMixin", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Route-6504517e50.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Route-6504517e50.json new file mode 100644 index 000000000..43445c265 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Route-6504517e50.json @@ -0,0 +1,1706 @@ +{ + "data": { + "id": "ember-4.7.1-Route", + "type": "class", + "attributes": { + "name": "Route", + "shortname": "Route", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 84, + "description": "

The Route class is used to define individual routes. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented", + "ActionHandler" + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 310, + "description": "

A hook you can implement to convert the route's model into parameters\nfor the URL.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model({ post_id }) {\n    // the server returns `{ id: 12 }`\n    return fetch(`/posts/${post_id}`;\n  }\n\n  serialize(model) {\n    // this will make the URL `/posts/12`\n    return { post_id: model.id };\n  }\n}
\n
\n
\n \n

The default serialize method will insert the model's id into the\nroute's dynamic segment (in this case, :post_id) if the segment contains '_id'.\nIf the route has multiple dynamic segments or does not contain '_id', serialize\nwill return getProperties(model, params)

\n

This method is called when transitionTo is called with a context\nin order to populate the URL.

\n", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "model", + "description": "the routes model", + "type": "Object" + }, + { + "name": "params", + "description": "an Array of parameter names for the current\n route (in the example, `['post_id']`.", + "type": "Array" + } + ], + "return": { + "description": "the serialized parameters", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 547, + "description": "

Sets the name for this route, including a fully resolved name for routes\ninside engines.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_setRouteName", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 562, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_stashNames", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 605, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_updatingQPChanged", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 613, + "description": "

Returns a hash containing the parameters of an ancestor route.

\n

You may notice that this.paramsFor sometimes works when referring to a\nchild route, but this behavior should not be relied upon as only ancestor\nroutes are certain to be loaded in time.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('member', { path: ':name' }, function() {\n    this.route('interest', { path: ':interest' });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class MemberRoute extends Route {\n  queryParams = {\n    memberQp: { refreshModel: true }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member/interest.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default class MemberInterestRoute extends Route {\n  queryParams = {\n    interestQp: { refreshModel: true }\n  }\n\n  model() {\n    return this.paramsFor('member');\n  }\n}
\n
\n
\n \n

If we visit /turing/maths?memberQp=member&interestQp=interest the model for\nthe member.interest route is a hash with:

\n
    \n
  • name: turing
  • \n
  • memberQp: member
  • \n
\n", + "itemtype": "method", + "name": "paramsFor", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "return": { + "description": "hash containing the parameters of the route `name`", + "type": "Object" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 694, + "description": "

Serializes the query parameter key

\n", + "itemtype": "method", + "name": "serializeQueryParamKey", + "params": [ + { + "name": "controllerPropertyName", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 705, + "description": "

Serializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 721, + "description": "

Deserializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 753, + "description": "

A hook you can use to reset controller values either when the model\nchanges or the route is exiting.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/articles.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class ArticlesRoute extends Route {\n  resetController(controller, isExiting, transition) {\n    if (isExiting && transition.targetName !== 'error') {\n      controller.set('page', 1);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "resetController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "isExiting", + "description": "", + "type": "Boolean" + }, + { + "name": "transition", + "description": "", + "type": "Object" + } + ], + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 780, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "exit", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 791, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_internalReset", + "since": "3.6.0", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 805, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "enter", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 856, + "description": "

This hook is executed when the router completely exits this route. It is\nnot executed when the model for the route changes.

\n", + "itemtype": "method", + "name": "deactivate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 867, + "description": "

This hook is executed when the router enters the route. It is not executed\nwhen the model for the route changes.

\n", + "itemtype": "method", + "name": "activate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 878, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogPosts');\nthis.transitionTo('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('blogPost', { path:':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogComment', aPost, aComment);\nthis.transitionTo('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
this.transitionTo('/');\nthis.transitionTo('/blog/post/1/comment/13');\nthis.transitionTo('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
this.transitionTo('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\nthis.transitionTo({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceWith.

\n

Simple Transition Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n  this.route('fourOhFour', { path: '*:' });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToSecret(context) {\n    if (authorized()) {\n      this.transitionTo('secret', context);\n    } else {\n      this.transitionTo('fourOhFour');\n    }\n  }\n}
\n
\n
\n \n

Transition to a nested route

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('articles', { path: '/articles' }, function() {\n    this.route('new');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToNewArticle() {\n    this.transitionTo('articles.new');\n  }\n}
\n
\n
\n \n

Multiple Models Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n\n  this.route('breakfast', { path: ':breakfastId' }, function() {\n    this.route('cereal', { path: ':cerealId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToChocolateCereal() {\n    let cereal = { cerealId: 'ChocolateYumminess' };\n    let breakfast = { breakfastId: 'CerealAndMilk' };\n\n    this.transitionTo('breakfast.cereal', breakfast, cereal);\n  }\n}
\n
\n
\n \n

Nested Route with Query String Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('fruits', function() {\n    this.route('apples');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToApples() {\n    this.transitionTo('fruits.apples', { queryParams: { color: 'red' } });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL.", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1076, + "description": "

Perform a synchronous transition into another route without attempting\nto resolve promises, update the URL, or abort any currently active\nasynchronous transitions (i.e. regular transitions caused by\ntransitionTo or URL changes).

\n

This method is handy for performing intermediate transitions on the\nway to a final destination route, and is called internally by the\ndefault implementations of the error and loading handlers.

\n", + "itemtype": "method", + "name": "intermediateTransitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) to be used while transitioning\nto the route.", + "type": "...Object" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1098, + "description": "

Refresh the model on this route and any child routes, firing the\nbeforeModel, model, and afterModel hooks in a similar fashion\nto how routes are entered when transitioning in from other route.\nThe current route params (e.g. article_id) will be passed in\nto the respective model hooks, and if a different model is returned,\nsetupController and associated route hooks will re-fire as well.

\n

An example usage of this method is re-querying the server for the\nlatest information using the same parameters as when the route\nwas first entered.

\n

Note that this will cause model hooks to fire even on routes\nthat were provided a model object when the route was initially\nentered.

\n", + "itemtype": "method", + "name": "refresh", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1124, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionTo in all other respects. See\n'transitionTo' for additional information regarding multiple models.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/secret.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class SecretRoute Route {\n  afterModel() {\n    if (!authorized()){\n      this.replaceWith('index');\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1172, + "description": "

This hook is the entry point for router.js

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1247, + "description": "

This hook is the first of the route entry validation hooks\ncalled when an attempt is made to transition into a route\nor one of its children. It is called before model and\nafterModel, and is appropriate for cases when:

\n
    \n
  1. A decision can be made to redirect elsewhere without\nneeding to resolve the model first.
  2. \n
  3. Any async operations need to occur first before the\nmodel is attempted to be resolved.
  4. \n
\n

This hook is provided the current transition attempt\nas a parameter, which can be used to .abort() the transition,\nsave it for a later .retry(), or retrieve values set\non it from a previous hook. You can also just call\nthis.transitionTo to another route to implicitly\nabort the transition.

\n

You can return a promise from this hook to pause the\ntransition until the promise resolves (or rejects). This could\nbe useful, for instance, for retrieving async code from\nthe server that is required to enter a route.

\n", + "itemtype": "method", + "name": "beforeModel", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1282, + "description": "

This hook is called after this route's model has resolved.\nIt follows identical async/promise semantics to beforeModel\nbut is provided the route's resolved model in addition to\nthe transition, and is therefore suited to performing\nlogic that can only take place after the model has already\nresolved.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n  afterModel(posts, transition) {\n    if (posts.get('length') === 1) {\n      this.transitionTo('post.show', posts.get('firstObject'));\n    }\n  }\n}
\n
\n
\n \n

Refer to documentation for beforeModel for a description\nof transition-pausing semantics when a promise is returned\nfrom this hook.

\n", + "itemtype": "method", + "name": "afterModel", + "params": [ + { + "name": "resolvedModel", + "description": "the value returned from `model`,\n or its resolved value if it was a promise", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1320, + "description": "

A hook you can implement to optionally redirect to another route.

\n

Calling this.transitionTo from inside of the redirect hook will\nabort the current transition (into the route that has implemented redirect).

\n

redirect and afterModel behave very similarly and are\ncalled almost at the same time, but they have an important\ndistinction when calling this.transitionTo to a child route\nof the current route. From afterModel, this new transition\ninvalidates the current transition, causing beforeModel,\nmodel, and afterModel hooks to be called again. But the\nsame transition started from redirect does not invalidate\nthe current transition. In other words, by the time the redirect\nhook has been called, both the resolved model and the attempted\nentry into this route are considered fully validated.

\n", + "itemtype": "method", + "name": "redirect", + "params": [ + { + "name": "model", + "description": "the model for this route", + "type": "Object" + }, + { + "name": "transition", + "description": "the transition object associated with the current transition", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1345, + "description": "

Called when the context is changed by router.js.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "contextDidChange", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1355, + "description": "

A hook you can implement to convert the URL into the model for\nthis route.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

The model for the post route is store.findRecord('post', params.post_id).

\n

By default, if your route has a dynamic segment ending in _id:

\n
    \n
  • The model class is determined from the segment (post_id's\nclass is App.Post)
  • \n
  • The find method is called on the model class with the value of\nthe dynamic segment.
  • \n
\n

Note that for routes with dynamic segments, this hook is not always\nexecuted. If the route is entered through a transition (e.g. when\nusing the link-to Handlebars helper or the transitionTo method\nof routes), and a model context is already provided this hook\nis not called.

\n

A model context does not include a primitive string or number,\nwhich does cause the model hook to be called.

\n

Routes without dynamic segments will always execute the model hook.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
// no dynamic segment, model hook always called\nthis.transitionTo('posts');\n\n// model passed in, so model hook not called\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost);\n\n// integer passed in, model hook is called\nthis.transitionTo('post', 1);\n\n// model id passed in, model hook is called\n// useful for forcing the hook to execute\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost.id);
\n
\n
\n \n

This hook follows the asynchronous/promise semantics\ndescribed in the documentation for beforeModel. In particular,\nif a promise returned from model fails, the error will be\nhandled by the error hook on Route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model(params) {\n    return this.store.findRecord('post', params.post_id);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "model", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route. If\n a promise is returned, the transition will pause until\n the promise resolves, and the resolved value of the promise\n will be used as the model for this route.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1470, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "deserialize", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route.\n\nRouter.js hook.", + "type": "Any | Promise" + }, + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1483, + "itemtype": "method", + "name": "findModel", + "params": [ + { + "name": "type", + "description": "the model type", + "type": "String" + }, + { + "name": "value", + "description": "the value passed to find", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1494, + "description": "

A hook you can use to setup the controller for the current route.

\n

This method is called with the controller for the current route and the\nmodel supplied by the model hook.

\n

By default, the setupController hook sets the model property of\nthe controller to the specified model when it is not undefined.

\n

If you implement the setupController hook in your Route, it will\nprevent this default behavior. If you want to preserve that behavior\nwhen implementing your setupController function, make sure to call\nsuper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/photos.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PhotosRoute extends Route {\n  model() {\n    return this.store.findAll('photo');\n  }\n\n  setupController(controller, model) {\n    super.setupController(controller, model);\n\n    this.controllerFor('application').set('showingPhotos', true);\n  }\n}
\n
\n
\n \n

The provided controller will be one resolved based on the name\nof this route.

\n

If no explicit controller is defined, Ember will automatically create one.

\n

As an example, consider the router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

If you have defined a file for the post controller,\nthe framework will use it.\nIf it is not defined, a basic Controller instance would be used.

\n", + "example": [ + " Behavior of a basic Controller\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, model) {\n controller.set('model', model);\n }\n});\n```" + ], + "itemtype": "method", + "name": "setupController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "model", + "description": "", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition", + "optional": true + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1570, + "description": "

Returns the controller of the current route, or a parent (or any ancestor)\nroute in a route hierarchy.

\n

The controller instance must already have been created, either through entering the\nassociated route or using generateController.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.controllerFor('posts').set('currentPost', post);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "controllerFor", + "params": [ + { + "name": "name", + "description": "the name of the route or controller", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Controller | undefined" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1624, + "description": "

Generates a controller for a route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class Post extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.generateController('posts');\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "generateController", + "params": [ + { + "name": "name", + "description": "the name of the controller", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1652, + "description": "

Returns the resolved model of a parent (or any ancestor) route\nin a route hierarchy. During a transition, all routes\nmust resolve a model object, and if a route\nneeds access to a parent route's model in order to\nresolve a model (or just reuse the model from a parent),\nit can call this.modelFor(theNameOfParentRoute) to\nretrieve it. If the ancestor route's model was a promise,\nits resolved result is returned.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' }, function() {\n    this.route('comments');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post/comments.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostCommentsRoute extends Route {\n  model() {\n    let post = this.modelFor('post');\n\n    return post.comments;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "modelFor", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "the model object", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1724, + "description": "

this[RENDER] is used to render a template into a region of another template\n(indicated by an {{outlet}}).

\n", + "itemtype": "method", + "name": "this[RENDER]", + "params": [ + { + "name": "name", + "description": "the name of the template to render", + "type": "String" + }, + { + "name": "options", + "description": "the options", + "type": "Object", + "optional": true, + "props": [ + { + "name": "into", + "description": "the template to render into,\n referenced by name. Defaults to the parent template", + "type": "String", + "optional": true + }, + { + "name": "outlet", + "description": "the outlet inside `options.into` to render into.\n Defaults to 'main'", + "type": "String", + "optional": true + }, + { + "name": "controller", + "description": "the controller to use for this template,\n referenced by name or as a controller instance. Defaults to the Route's paired controller", + "type": "String|Object", + "optional": true + }, + { + "name": "model", + "description": "the model object to set on `options.controller`.\n Defaults to the return value of the Route's model hook", + "type": "Object", + "optional": true + } + ] + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1751, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "teardownViews", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1764, + "description": "

Allows you to produce custom metadata for the route.\nThe return value of this method will be attached to\nits corresponding RouteInfoWithAttributes object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostsIndexRoute extends Route {\n  buildRouteInfoMetadata() {\n    return { title: 'Posts Page' }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service router\n\n  constructor() {\n    super(...arguments);\n\n    this.router.on('routeDidChange', transition => {\n      document.title = transition.to.metadata.title;\n      // would update document's title to "Posts Page"\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "buildRouteInfoMetadata", + "return": { + "description": "any" + }, + "since": "3.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2020, + "description": "

Sends an action to the router, which will delegate it to the currently\nactive route hierarchy per the bubbling rules explained under actions.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  track(arg) {\n    console.log(arg, 'was clicked');\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  trackIfDebug(arg) {\n    if (debug) {\n      this.send('track', arg);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "name", + "description": "the name of the action to trigger", + "type": "String" + }, + { + "name": "args", + "description": "", + "type": "...*" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2436, + "description": "

This action is called when one or more query params have changed. Bubbles.

\n", + "itemtype": "method", + "name": "queryParamsDidChange", + "params": [ + { + "name": "changed", + "description": "Keys are names of query params that have changed.", + "type": "Object" + }, + { + "name": "totalPresent", + "description": "Keys are names of query params that are currently set.", + "type": "Object" + }, + { + "name": "removed", + "description": "Keys are names of query params that have been removed.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 95, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 121, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 142, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 165, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/evented.ts", + "line": 180, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 96, + "description": "

The willTransition action 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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ContactFormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData')) {\n      this.controller.displayNavigationConfirm();\n      transition.abort();\n    }\n  }\n}
\n
\n
\n \n

You can also redirect elsewhere by calling\nthis.transitionTo('elsewhere') from within willTransition.\nNote that willTransition will not be fired for the\nredirecting transitionTo, since willTransition doesn't\nfire when there is already a transition underway. If you want\nsubsequent willTransition actions to fire for the redirecting\ntransition, you must first explicitly call\ntransition.abort().

\n

To allow the willTransition event to continue bubbling to the parent\nroute, use return true;. When the willTransition method has a\nreturn value of true then the parent route's willTransition method\nwill be fired, enabling "bubbling" behavior for the event.

\n", + "itemtype": "event", + "name": "willTransition", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 141, + "description": "

The didTransition action is fired after a transition has\nsuccessfully been completed. This occurs after the normal model\nhooks (beforeModel, model, afterModel, setupController)\nhave resolved. The didTransition action has no arguments,\nhowever, it can be useful for tracking page views or resetting\nstate on the controller.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/login.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class LoginRoute extends Route {\n  @action\n  didTransition() {\n    this.controller.get('errors.base').clear();\n    return true; // Bubble the didTransition event\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "didTransition", + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 168, + "description": "

The loading action is fired on the route when a route's model\nhook returns a promise that is not already resolved. The current\nTransition object is the first parameter and the route that\ntriggered the loading event is the second parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  loading(transition, route) {\n    let controller = this.controllerFor('foo');\n\n    // The controller may not be instantiated when initially loading\n    if (controller) {\n      controller.currentlyLoading = true;\n\n      transition.finally(function() {\n        controller.currentlyLoading = false;\n      });\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "loading", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + }, + { + "name": "route", + "description": "The route that triggered the loading event", + "type": "Route" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 203, + "description": "

When attempting to transition into a route, any of the hooks\nmay return a promise that rejects, at which point an error\naction will be fired on the partially-entered routes, allowing\nfor per-route error handling logic, or shared error handling\nlogic defined on a parent route.

\n

Here is an example of an error handler that will be invoked\nfor rejected promises from the various hooks on the route,\nas well as any unhandled errors from child routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/admin.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { reject } from 'rsvp';\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class AdminRoute extends Route {\n  beforeModel() {\n    return reject('bad things!');\n  }\n\n  @action\n  error(error, transition) {\n    // Assuming we got here due to the error in `beforeModel`,\n    // we can expect that error === "bad things!",\n    // but a promise model rejecting would also\n    // call this hook, as would any errors encountered\n    // in `afterModel`.\n\n    // The `error` hook is also provided the failed\n    // `transition`, which can be stored and later\n    // `.retry()`d if desired.\n\n    this.transitionTo('login');\n  }\n}
\n
\n
\n \n

error actions that bubble up all the way to ApplicationRoute\nwill fire a default error handler that logs the error. You can\nspecify your own global default error handler by overriding the\nerror handler on ApplicationRoute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  error(error, transition) {\n    this.controllerFor('banner').displayError(error.message);\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "error", + "params": [ + { + "name": "error", + "description": "", + "type": "Error" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 816, + "description": "

This event is triggered when the router enters the route. It is\nnot executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  collectAnalytics: on('activate', function(){\n    collectAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "activate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 836, + "description": "

This event is triggered when the router completely exits this\nroute. It is not executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  trackPageLeaveAnalytics: on('deactivate', function(){\n    trackPageLeaveAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "deactivate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 378, + "description": "

Configuration hash for this route's queryParams. The possible\nconfiguration options and their defaults are as follows\n(assuming a query param whose controller property is page):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
queryParams = {\n  page: {\n    // By default, controller query param properties don't\n    // cause a full transition when they are changed, but\n    // rather only cause the URL to update. Setting\n    // `refreshModel` to true will cause an "in-place"\n    // transition to occur, whereby the model hooks for\n    // this route (and any child routes) will re-fire, allowing\n    // you to reload models (e.g., from the server) using the\n    // updated query param values.\n    refreshModel: false,\n\n    // By default, changes to controller query param properties\n    // cause the URL to update via `pushState`, which means an\n    // item will be added to the browser's history, allowing\n    // you to use the back button to restore the app to the\n    // previous state before the query param property was changed.\n    // Setting `replace` to true will use `replaceState` (or its\n    // hash location equivalent), which causes no browser history\n    // item to be added. This options name and default value are\n    // the same as the `link-to` helper's `replace` option.\n    replace: false,\n\n    // By default, the query param URL key is the same name as\n    // the controller property name. Use `as` to specify a\n    // different URL key.\n    as: 'page'\n  }\n};
\n
\n
\n \n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 431, + "description": "

The name of the template to use by default when rendering this route's\ntemplate.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/list.js
1\n2\n3\n4\n5\n
import Route from '@ember/routing/route';\n\nexport default class PostsListRoute extends Route {\n  templateName = 'posts/list';\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n
import PostsListRoute from '../posts/list';\n\nexport default class PostsIndexRoute extends PostsListRoute {};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/archived.js
1\n2\n3\n
import PostsListRoute from '../posts/list';\n\nexport default class PostsArchivedRoute extends PostsListRoute {};
\n
\n
\n \n", + "itemtype": "property", + "name": "templateName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 464, + "description": "

The name of the controller to associate with this route.

\n

By default, Ember will lookup a route's controller that matches the name\nof the route (i.e. posts.new). However,\nif you would like to define a specific controller to use, you can do so\nusing this property.

\n

This is useful in many ways, as the controller specified will be:

\n
    \n
  • passed to the setupController method.
  • \n
  • used as the controller for the template being rendered by the route.
  • \n
  • returned from a call to controllerFor for the route.
  • \n
\n", + "itemtype": "property", + "name": "controllerName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 487, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 518, + "description": "

The name of the route, dot-delimited.

\n

For example, a route found at app/routes/posts/post.js will have\na routeName of posts.post.

\n", + "itemtype": "property", + "name": "routeName", + "type": "String", + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 532, + "description": "

The name of the route, dot-delimited, including the engine prefix\nif applicable.

\n

For example, a route found at addon/routes/posts/post.js within an\nengine named admin will have a fullRouteName of admin.posts.post.

\n", + "itemtype": "property", + "name": "fullRouteName", + "type": "String", + "since": "2.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 596, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_activeQPChanged", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 737, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_optionsForQueryParam", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1815, + "description": "

Store property provides a hook for data persistence libraries to inject themselves.

\n

By default, this store property provides the exact same functionality previously\nin the model hook.

\n

Currently, the required interface is:

\n

store.find(modelName, findArguments)

\n", + "itemtype": "property", + "name": "store", + "type": "{Object}", + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 1881, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_qp", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route.ts", + "line": 2405, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-RouteInfo-af9d77ee42.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-RouteInfo-af9d77ee42.json new file mode 100644 index 000000000..0d2712e88 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-RouteInfo-af9d77ee42.json @@ -0,0 +1,171 @@ +{ + "data": { + "id": "ember-4.7.1-RouteInfo", + "type": "class", + "attributes": { + "name": "RouteInfo", + "shortname": "RouteInfo", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 124, + "description": "

A RouteInfo is an object that contains metadata\nabout a specific route within a Transition. It is\nread-only and internally immutable. It is also not\nobservable, because a Transition instance is never\nchanged after creation.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 198, + "description": "

Allows you to traverse through the linked list\nof RouteInfos from the topmost to leafmost.\nReturns the first RouteInfo in the linked list\nfor which the callback returns true.

\n

This method is similar to the find() method\n defined in ECMAScript 2015.

\n

The callback method you provide should have the\n following signature (all parameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in\n the results, false otherwise.

\n

Note that in addition to a callback, you can also\n pass an optional target object that will be set as\n this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 135, + "description": "

The dot-separated, fully-qualified name of the\nroute, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 142, + "description": "

The final segment of the fully-qualified name of\nthe route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 149, + "description": "

The values of the route's parameters. These are the\nsame params that are received as arguments to the\nroute's model hook. Contains only the parameters\nvalid for this route, if any (params for parent or\nchild routes are not merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 159, + "description": "

The ordered list of the names of the params\nrequired for this route. It will contain the same\nstrings as Object.keys(params), but here the order\nis significant. This allows users to correctly pass\nparams into routes programmatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 169, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 175, + "description": "

Will contain the result Route#buildRouteInfoMetadata\nfor the corresponding Route.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 182, + "description": "

A reference to the parent route's RouteInfo.\nThis can be used to traverse upward to the topmost\nRouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 190, + "description": "

A reference to the child route's RouteInfo.\nThis can be used to traverse downward to the\nleafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-RouteInfoWithAttributes-dc312207a8.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-RouteInfoWithAttributes-dc312207a8.json new file mode 100644 index 000000000..15798536c --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-RouteInfoWithAttributes-dc312207a8.json @@ -0,0 +1,183 @@ +{ + "data": { + "id": "ember-4.7.1-RouteInfoWithAttributes", + "type": "class", + "attributes": { + "name": "RouteInfoWithAttributes", + "shortname": "RouteInfoWithAttributes", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 7, + "description": "

A RouteInfoWithAttributes is an object that contains\nmetadata, including the resolved value from the routes\nmodel hook. Like RouteInfo, a RouteInfoWithAttributes\nrepresents a specific route within a Transition.\nIt is read-only and internally immutable. It is also not\nobservable, because a Transition instance is never\nchanged after creation.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 90, + "description": "

Allows you to traverse through the linked list\nof RouteInfos from the topmost to leafmost.\nReturns the first RouteInfo in the linked list\nfor which the callback returns true.

\n

This method is similar to the find() method\n defined in ECMAScript 2015.

\n

The callback method you provide should have the\n following signature (all parameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in\n the results, false otherwise.

\n

Note that in addition to a callback, you can also\n pass an optional target object that will be set as\n this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 20, + "description": "

The dot-separated, fully-qualified name of the\nroute, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 27, + "description": "

The final segment of the fully-qualified name of\nthe route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 34, + "description": "

The values of the route's parameters. These are the\nsame params that are received as arguments to the\nroute's model hook. Contains only the parameters\nvalid for this route, if any (params for parent or\nchild routes are not merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 44, + "description": "

The ordered list of the names of the params\nrequired for this route. It will contain the same\nstrings as Object.keys(params), but here the order\nis significant. This allows users to correctly pass\nparams into routes programmatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 54, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 60, + "description": "

This is the resolved return value from the\nroute's model hook.

\n", + "itemtype": "property", + "name": "attributes", + "type": "Object|Array|String|undefined", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 67, + "description": "

Will contain the result Route#buildRouteInfoMetadata\nfor the corresponding Route.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 74, + "description": "

A reference to the parent route's RouteInfo.\nThis can be used to traverse upward to the topmost\nRouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/system/route-info.ts", + "line": 82, + "description": "

A reference to the child route's RouteInfo.\nThis can be used to traverse downward to the\nleafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-RouterService-006cd89ba0.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-RouterService-006cd89ba0.json new file mode 100644 index 000000000..c73845e25 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-RouterService-006cd89ba0.json @@ -0,0 +1,882 @@ +{ + "data": { + "id": "ember-4.7.1-RouterService", + "type": "class", + "attributes": { + "name": "RouterService", + "shortname": "RouterService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 24, + "description": "

The Router service is the public API that provides access to the router.

\n

The immediate benefit of the Router service is that you can inject it into components,\ngiving them a friendly way to initiate transitions and ask questions about the current\nglobal router state.

\n

In this example, the Router service is injected into a component to initiate a transition\nto a dedicated route:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class ExampleComponent extends Component {\n  @service router;\n\n  @action\n  next() {\n    this.router.transitionTo('other.route');\n  }\n}
\n
\n
\n \n

Like any service, it can also be injected into helpers, routes, etc.

\n", + "access": "public", + "tagname": "", + "extends": "Service", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 82, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n

Calling transitionTo from the Router service will cause default query parameter values to be included in the URL.\nThis behavior is different from calling transitionTo on a route or transitionToRoute on a controller.\nSee the Router Service RFC for more info.

\n

In the following example we use the Router service to navigate to a route with a\nspecific model from a Component in the first action, and in the second we trigger\na query-params only transition.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n  @service router;\n\n  @action\n  goToComments(post) {\n    this.router.transitionTo('comments', post);\n  }\n\n  @action\n  fetchMoreComments(latestComment) {\n    this.router.transitionTo({\n      queryParams: { commentsAfter: latestComment }\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 141, + "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

Calling 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 for more info.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class extends Route {\n  beforeModel() {\n    if (!authorized()){\n      this.replaceWith('unauthorized');\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL of the desired destination", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route i.e. an object of params to pass to the destination route", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 180, + "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

In this example, the URL for the author.books route for a given author\nis copied to the clipboard.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

Just like with transitionTo and replaceWith, urlFor can also handle\nquery parameters.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "urlFor", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) for the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the string representing the generated URL", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 253, + "description": "

Returns true if routeName/models/queryParams is the active route, where models and queryParams are optional.\nSee model and\nqueryParams for more information about these arguments.

\n

In the following example, isActive will return true if the current route is /posts.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

Where 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.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used when determining the active route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "true if the provided routeName/models/queryParams are active", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 357, + "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

See RouteInfo for more info.

\n

In the following example recognize is used to verify if a path belongs to our\napplication before transitioning to it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "recognize", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo | null" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 398, + "description": "

Takes a string URL and returns a promise that resolves to a\nRouteInfoWithAttributes 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.

\n", + "itemtype": "method", + "name": "recognizeAndLoad", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 420, + "description": "

You can register a listener for events emitted by this service with .on():

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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
\n \n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 447, + "description": "

You can unregister a listener for events emitted by this service with .off():

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 553, + "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.

\n", + "itemtype": "method", + "name": "refresh", + "params": [ + { + "name": "routeName", + "description": "the route to refresh (along with all child routes)", + "type": "String", + "optional": true + } + ], + "return": { + "description": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 479, + "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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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
\n \n

The 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.

\n", + "itemtype": "event", + "name": "routeWillChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 513, + "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

A good example is sending some analytics when the route has transitioned:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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 \n

routeDidChange will be called after any Route's\ndidTransition\naction has been fired.\nThe updates of properties\ncurrentURL,\ncurrentRouteName\nand\ncurrentRoute\nare completed at the time routeDidChange is called.

\n", + "itemtype": "event", + "name": "routeDidChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 583, + "description": "

Name of the current route.

\n

This property represents the logical name of the route,\n which is dot separated.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentRouteName", + "type": "{String | null}", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 613, + "description": "

Current URL for the application.

\n

This property represents the URL path for this route.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentURL", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 642, + "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

See Location for more information.

\n

To 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\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
\n \n

The following location types are available by default:\nauto, hash, history, none.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 682, + "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

If you change the rootURL in your environment configuration\nlike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\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
\n \n

This property will return /my-root.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/services/router.ts", + "line": 712, + "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

See RouteInfo for more info.

\n

This 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

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/header.js
1\n2\n3\n4\n5\n6\n7\n8\n9\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
\n
\n \n", + "itemtype": "property", + "name": "currentRoute", + "type": "RouteInfo", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-Service", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-Service-4c154afcdd.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-Service-4c154afcdd.json new file mode 100644 index 000000000..88b1b0337 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-Service-4c154afcdd.json @@ -0,0 +1,541 @@ +{ + "data": { + "id": "ember-4.7.1-Service", + "type": "class", + "attributes": { + "name": "Service", + "shortname": "Service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "file": "packages/@ember/service/index.ts", + "line": 87, + "extends": "EmberObject", + "since": "1.10.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 319, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 538, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 565, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 573, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 174, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 219, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 244, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 292, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 310, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 330, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 349, + "description": "

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 367, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 460, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 483, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 498, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 520, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 542, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/observable.ts", + "line": 559, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 353, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 427, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 502, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/system/core_object.ts", + "line": 520, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.7.1-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.7.1-RouterService" + } + ] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-String-e75bd12199.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-String-e75bd12199.json new file mode 100644 index 000000000..d020bdd57 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-String-e75bd12199.json @@ -0,0 +1,200 @@ +{ + "data": { + "id": "ember-4.7.1-String", + "type": "class", + "attributes": { + "name": "String", + "shortname": "String", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/string", + "namespace": "", + "file": "packages/@ember/string/index.ts", + "line": 74, + "description": "

Defines string helper methods including string formatting and localization.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/string/index.ts", + "line": 81, + "description": "

Splits a string into separate units separated by spaces, eliminating any\nempty strings in the process.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { w } from '@ember/string';\n\nw("alpha beta gamma").forEach(function(key) {\n  console.log(key);\n});\n\n// > alpha\n// > beta\n// > gamma
\n
\n
\n \n", + "itemtype": "method", + "name": "w", + "params": [ + { + "name": "str", + "description": "The string to split", + "type": "String" + } + ], + "return": { + "description": "array containing the split strings", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 106, + "description": "

Converts a camelized string into all lower case separated by underscores.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { decamelize } from '@ember/string';\n\ndecamelize('innerHTML');          // 'inner_html'\ndecamelize('action_name');        // 'action_name'\ndecamelize('css-class-name');     // 'css-class-name'\ndecamelize('my favorite items');  // 'my favorite items'
\n
\n
\n \n", + "itemtype": "method", + "name": "decamelize", + "params": [ + { + "name": "str", + "description": "The string to decamelize.", + "type": "String" + } + ], + "return": { + "description": "the decamelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 127, + "description": "

Replaces underscores, spaces, or camelCase with dashes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { dasherize } from '@ember/string';\n\ndasherize('innerHTML');                // 'inner-html'\ndasherize('action_name');              // 'action-name'\ndasherize('css-class-name');           // 'css-class-name'\ndasherize('my favorite items');        // 'my-favorite-items'\ndasherize('privateDocs/ownerInvoice';  // 'private-docs/owner-invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "dasherize", + "params": [ + { + "name": "str", + "description": "The string to dasherize.", + "type": "String" + } + ], + "return": { + "description": "the dasherized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 149, + "description": "

Returns the lowerCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { camelize } from '@ember/string';\n\ncamelize('innerHTML');                   // 'innerHTML'\ncamelize('action_name');                 // 'actionName'\ncamelize('css-class-name');              // 'cssClassName'\ncamelize('my favorite items');           // 'myFavoriteItems'\ncamelize('My Favorite Items');           // 'myFavoriteItems'\ncamelize('private-docs/owner-invoice');  // 'privateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "camelize", + "params": [ + { + "name": "str", + "description": "The string to camelize.", + "type": "String" + } + ], + "return": { + "description": "the camelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 172, + "description": "

Returns the UpperCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { classify } from '@ember/string';\n\nclassify('innerHTML');                   // 'InnerHTML'\nclassify('action_name');                 // 'ActionName'\nclassify('css-class-name');              // 'CssClassName'\nclassify('my favorite items');           // 'MyFavoriteItems'\nclassify('private-docs/owner-invoice');  // 'PrivateDocs/OwnerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "classify", + "params": [ + { + "name": "str", + "description": "the string to classify", + "type": "String" + } + ], + "return": { + "description": "the classified string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 194, + "description": "

More general than decamelize. Returns the lower_case_and_underscored\nform of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { underscore } from '@ember/string';\n\nunderscore('innerHTML');                 // 'inner_html'\nunderscore('action_name');               // 'action_name'\nunderscore('css-class-name');            // 'css_class_name'\nunderscore('my favorite items');         // 'my_favorite_items'\nunderscore('privateDocs/ownerInvoice');  // 'private_docs/owner_invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "underscore", + "params": [ + { + "name": "str", + "description": "The string to underscore.", + "type": "String" + } + ], + "return": { + "description": "the underscored string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 217, + "description": "

Returns the Capitalized form of a string

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capitalize } from '@ember/string';\n\ncapitalize('innerHTML')                 // 'InnerHTML'\ncapitalize('action_name')               // 'Action_name'\ncapitalize('css-class-name')            // 'Css-class-name'\ncapitalize('my favorite items')         // 'My favorite items'\ncapitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "capitalize", + "params": [ + { + "name": "str", + "description": "The string to capitalize.", + "type": "String" + } + ], + "return": { + "description": "The capitalized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/string", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/classes/ember-4.7.1-rsvp-0b7bebe823.json b/json-docs/ember/4.7.1/classes/ember-4.7.1-rsvp-0b7bebe823.json new file mode 100644 index 000000000..9b0fe31c1 --- /dev/null +++ b/json-docs/ember/4.7.1/classes/ember-4.7.1-rsvp-0b7bebe823.json @@ -0,0 +1,445 @@ +{ + "data": { + "id": "ember-4.7.1-rsvp", + "type": "class", + "attributes": { + "name": "rsvp", + "shortname": "rsvp", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/all-settled.js", + "line": 20, + "description": "

RSVP.allSettled is similar to RSVP.all, but instead of implementing\na fail-fast method, it waits until all the promises have returned and\nshows you all the results. This is useful if you want to handle multiple\npromises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled. The return promise is fulfilled with an array of the states of\nthe promises passed into the promises array argument.

\n

Each state object will either indicate fulfillment or rejection, and\nprovide the corresponding value or reason. The states will take one of\nthe following formats:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{ state: 'fulfilled', value: value }\n  or\n{ state: 'rejected', reason: reason }
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
let promise1 = RSVP.Promise.resolve(1);\nlet promise2 = RSVP.Promise.reject(new Error('2'));\nlet promise3 = RSVP.Promise.reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nRSVP.allSettled(promises).then(function(array){\n  // array == [\n  //   { state: 'fulfilled', value: 1 },\n  //   { state: 'rejected', reason: Error },\n  //   { state: 'rejected', reason: Error }\n  // ]\n  // Note that for the second item, reason.message will be '2', and for the\n  // third item, reason.message will be '3'.\n}, function(error) {\n  // Not run. (This block would only be called if allSettled had failed,\n  // for instance if passed an incorrect argument type.)\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "allSettled", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "entries", + "description": "", + "type": "Array" + }, + { + "name": "label", + "description": "- optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with an array of the settled\nstates of the constituent promises.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/all.js", + "line": 3, + "description": "

This is a convenient alias for Promise.all.

\n", + "itemtype": "method", + "name": "all", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/defer.js", + "line": 3, + "description": "

defer returns an object similar to jQuery's $.Deferred.\ndefer should be used when porting over code reliant on $.Deferred's\ninterface. New code should use the Promise constructor instead.

\n

The object returned from defer is a plain object with three properties:

\n
    \n
  • promise - an Promise.
  • \n
  • reject - a function that causes the promise property on this object to\nbecome rejected
  • \n
  • resolve - a function that causes the promise property on this object to\nbecome fulfilled.
  • \n
\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let deferred = defer();\n\ndeferred.resolve("Success!");\n\ndeferred.promise.then(function(value){\n  // value here is "Success!"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "defer", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 19, + "description": "

EventTarget.mixin extends an object with EventTarget methods. For\nExample:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import EventTarget from 'rsvp';\n\nlet object = {};\n\nEventTarget.mixin(object);\n\nobject.on('finished', function(event) {\n  // handle event\n});\n\nobject.trigger('finished', { detail: value });
\n
\n
\n \n

EventTarget.mixin also works with prototypes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EventTarget from 'rsvp';\n\nlet Person = function() {};\nEventTarget.mixin(Person.prototype);\n\nlet yehuda = new Person();\nlet tom = new Person();\n\nyehuda.on('poke', function(event) {\n  console.log('Yehuda says OW');\n});\n\ntom.on('poke', function(event) {\n  console.log('Tom says OW');\n});\n\nyehuda.trigger('poke');\ntom.trigger('poke');
\n
\n
\n \n", + "itemtype": "method", + "name": "mixin", + "access": "private", + "tagname": "", + "params": [ + { + "name": "object", + "description": "object to extend with EventTarget methods", + "type": "Object" + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 107, + "description": "

You can use off to stop firing a particular callback for an event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function doStuff() { // do stuff! }\nobject.on('stuff', doStuff);\n\nobject.trigger('stuff'); // doStuff will be called\n\n// Unregister ONLY the doStuff callback\nobject.off('stuff', doStuff);\nobject.trigger('stuff'); // doStuff will NOT be called
\n
\n
\n \n

If you don't pass a callback argument to off, ALL callbacks for the\nevent will not be executed when the event fires. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let callback1 = function(){};\nlet callback2 = function(){};\n\nobject.on('stuff', callback1);\nobject.on('stuff', callback2);\n\nobject.trigger('stuff'); // callback1 and callback2 will be executed.\n\nobject.off('stuff');\nobject.trigger('stuff'); // callback1 and callback2 will not be executed!
\n
\n
\n \n", + "itemtype": "method", + "name": "off", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "event to stop listening to", + "type": "String" + }, + { + "name": "callback", + "description": "optional argument. If given, only the function\ngiven will be removed from the event's callback queue. If no `callback`\nargument is given, all callbacks will be removed from the event's callback\nqueue.", + "type": "Function", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 162, + "description": "

Use trigger to fire custom events. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
object.on('foo', function(){\n  console.log('foo event happened!');\n});\nobject.trigger('foo');\n// 'foo event happened!' logged to the console
\n
\n
\n \n

You can also pass a value as a second argument to trigger that will be\npassed as an argument to all event listeners for the event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
object.on('foo', function(value){\n  console.log(value.name);\n});\n\nobject.trigger('foo', { name: 'bar' });\n// 'bar' logged to the console
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "name of the event to be triggered", + "type": "String" + }, + { + "name": "options", + "description": "optional value to be passed to any event handlers for\nthe given `eventName`", + "type": "*", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/filter.js", + "line": 42, + "description": "

filter is similar to JavaScript's native filter method.\nfilterFn is eagerly called meaning that as soon as any promise\n resolves its value will be passed to filterFn. filter returns\n a promise that will become fulfilled with the result of running\n filterFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { filter, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\n\nlet promises = [promise1, promise2, promise3];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(result){\n  // result is [ 2, 3 ]\n});
\n
\n
\n \n

If any of the promises given to filter are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { filter, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

filter will also wait for any promises returned from filterFn.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter, resolve } from 'rsvp';\n\nlet alice = { name: 'alice' };\nlet bob   = { name: 'bob' };\nlet users = [ alice, bob ];\n\nlet promises = users.map(function(user){\n  return resolve(user);\n});\n\nlet filterFn = function(user){\n  // Here, Alice has permissions to create a blog post, but Bob does not.\n  return getPrivilegesForUser(user).then(function(privs){\n    return privs.can_create_blog_post === true;\n  });\n};\nfilter(promises, filterFn).then(function(users){\n  // true, because the server told us only Alice can create a blog post.\n  users.length === 1;\n  // false, because Alice is the only user present in `users`\n  users[0] === bob;\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "filterFn", + "description": "- function to be called on each resolved value to\n filter the final results.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string describing the promise. Useful for\n tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash-settled.js", + "line": 16, + "description": "

hashSettled is similar to allSettled, but takes an object\ninstead of an array for its promises argument.

\n

Unlike all or hash, which implement a fail-fast method,\nbut like allSettled, hashSettled waits until all the\nconstituent promises have returned and then shows you all the results\nwith their states and values/reasons. This is useful if you want to\nhandle multiple promises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled, or rejected if the passed parameters are invalid.

\n

The returned promise is fulfilled with a hash that has the same key names as\nthe promises object argument. If any of the values in the object are not\npromises, they will be copied over to the fulfilled object and marked with state\n'fulfilled'.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: { state: 'fulfilled', value: 1 },\n  //   yourPromise: { state: 'fulfilled', value: 2 },\n  //   theirPromise: { state: 'fulfilled', value: 3 },\n  //   notAPromise: { state: 'fulfilled', value: 4 }\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the state will\nbe set to 'rejected' and the reason for rejection provided.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, reject, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejection')),\n  anotherRejectedPromise: reject(new Error('more rejection')),\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise:              { state: 'fulfilled', value: 1 },\n  //   rejectedPromise:        { state: 'rejected', reason: Error },\n  //   anotherRejectedPromise: { state: 'rejected', reason: Error },\n  // }\n  // Note that for rejectedPromise, reason.message == 'rejection',\n  // and for anotherRejectedPromise, reason.message == 'more rejection'.\n});
\n
\n
\n \n

An important note: hashSettled is intended for plain JavaScript objects that\nare just a set of keys and values. hashSettled will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import Promise, { hashSettled, resolve } from 'rsvp';\n\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: Promise.resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhashSettled(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: { state: 'fulfilled', value: 'Example' }\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hashSettled", + "access": "public", + "tagname": "", + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when when all properties of `promises`\nhave been settled.", + "type": "Promise" + }, + "static": 1, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash.js", + "line": 4, + "description": "

hash is similar to all, but takes an object instead of an array\nfor its promises argument.

\n

Returns a promise that is fulfilled when all the given promises have been\nfulfilled, or rejected if any of them become rejected. The returned promise\nis fulfilled with a hash that has the same key names as the promises object\nargument. If any of the values in the object are not promises, they will\nsimply be copied over to the fulfilled object.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhash(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: 1,\n  //   yourPromise: 2,\n  //   theirPromise: 3,\n  //   notAPromise: 4\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the first promise\nthat is rejected will be given as the reason to the rejection handler.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejectedPromise')),\n  anotherRejectedPromise: reject(new Error('anotherRejectedPromise')),\n};\n\nhash(promises).then(function(hash){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === 'rejectedPromise'\n});
\n
\n
\n \n

An important note: hash is intended for plain JavaScript objects that\nare just a set of keys and values. hash will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { hash, resolve } from 'rsvp';\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhash(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: 'Example'\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all properties of `promises`\nhave been fulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/map.js", + "line": 39, + "description": "

map is similar to JavaScript's native map method. mapFn is eagerly called\n meaning that as soon as any promise resolves its value will be passed to mapFn.\n map returns a promise that will become fulfilled with the result of running\n mapFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(result){\n  // result is [ 2, 3, 4 ]\n});
\n
\n
\n \n

If any of the promises given to map are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { map, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

map will also wait if a promise is returned from mapFn. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first because they contain a url to those comments.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map } from 'rsvp';\n\nlet mapFn = function(blogPost){\n  // getComments does some ajax and returns an Promise that is fulfilled\n  // with some comments data\n  return getComments(blogPost.comments_url);\n};\n\n// getBlogPosts does some ajax and returns an Promise that is fulfilled\n// with some blog post data\nmap(getBlogPosts(), mapFn).then(function(comments){\n  // comments is the result of asking the server for the comments\n  // of all blog posts returned from getBlogPosts()\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "mapFn", + "description": "function to be called on each fulfilled promise.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\n Useful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/node.js", + "line": 44, + "description": "

denodeify takes a 'node-style' function and returns a function that\nwill return an Promise. You can use denodeify in Node.js or the\nbrowser when you'd prefer to use promises over using callbacks. For example,\ndenodeify transforms the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) return handleError(err);\n  handleData(data);\n});
\n
\n
\n \n

into:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\n\nreadFile('myfile.txt').then(handleData, handleError);
\n
\n
\n \n

If the node function has multiple success parameters, then denodeify\njust returns the first one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let request = denodeify(require('request'));\n\nrequest('http://example.com').then(function(res) {\n  // ...\n});
\n
\n
\n \n

However, if you need all success parameters, setting denodeify's\nsecond parameter to true causes it to return all success parameters\nas an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), true);\n\nrequest('http://example.com').then(function(result) {\n  // result[0] -> res\n  // result[1] -> body\n});
\n
\n
\n \n

Or if you pass it an array with names it returns the parameters as a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), ['res', 'body']);\n\nrequest('http://example.com').then(function(result) {\n  // result.res\n  // result.body\n});
\n
\n
\n \n

Sometimes you need to retain the this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let app = require('express')();\nlet render = denodeify(app.render.bind(app));
\n
\n
\n \n

The denodified function inherits from the original function. It works in all\nenvironments, except IE 10 and below. Consequently all properties of the original\nfunction are available to you. However, any properties you change on the\ndenodeified function won't be changed on the original function. Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request')),\n    cookieJar = request.jar(); // <- Inheritance is used here\n\nrequest('http://example.com', {jar: cookieJar}).then(function(res) {\n  // cookieJar.cookies holds now the cookies returned by example.com\n});
\n
\n
\n \n

Using denodeify makes it easier to compose asynchronous operations instead\nof using callbacks. For example, instead of:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) { ... } // Handle error\n  fs.writeFile('myfile2.txt', data, function(err){\n    if (err) { ... } // Handle error\n    console.log('done')\n  });\n});
\n
\n
\n \n

you can chain the operations together using then from the returned promise:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\nlet writeFile = denodeify(fs.writeFile);\n\nreadFile('myfile.txt').then(function(data){\n  return writeFile('myfile2.txt', data);\n}).then(function(){\n  console.log('done')\n}).catch(function(error){\n  // Handle error\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "denodeify", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "nodeFunc", + "description": "a 'node-style' function that takes a callback as\nits last argument. The callback expects an error to be passed as its first\nargument (if an error occurred, otherwise null), and the value from the\noperation as its second argument ('function(err, value){ }').", + "type": "Function" + }, + { + "name": "options", + "description": "An optional paramter that if set\nto `true` causes the promise to fulfill with the callback's success arguments\nas an array. This is useful if the node function has multiple success\nparamters. If you set this paramter to an array with names, the promise will\nfulfill with a hash with these names as keys and the success parameters as\nvalues.", + "type": "Boolean|Array", + "optional": true + } + ], + "return": { + "description": "a function that wraps `nodeFunc` to return a `Promise`", + "type": "Function" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/race.js", + "line": 3, + "description": "

This is a convenient alias for Promise.race.

\n", + "itemtype": "method", + "name": "race", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/reject.js", + "line": 3, + "description": "

This is a convenient alias for Promise.reject.

\n", + "itemtype": "method", + "name": "reject", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/resolve.js", + "line": 3, + "description": "

This is a convenient alias for Promise.resolve.

\n", + "itemtype": "method", + "name": "resolve", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "value", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/rethrow.js", + "line": 1, + "description": "

rethrow will rethrow an error on the next turn of the JavaScript event\nloop in order to aid debugging.

\n

Promises A+ specifies that any exceptions that occur with a promise must be\ncaught by the promises implementation and bubbled to the last handler. For\nthis reason, it is recommended that you always specify a second rejection\nhandler function to then. However, rethrow will throw the exception\noutside of the promise, so it bubbles up to your console if in the browser,\nor domain/cause uncaught exception in Node. rethrow will also throw the\nerror again so the error can be handled by the promise per the spec.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { rethrow } from 'rsvp';\n\nfunction throws(){\n  throw new Error('Whoops!');\n}\n\nlet promise = new Promise(function(resolve, reject){\n  throws();\n});\n\npromise.catch(rethrow).then(function(){\n  // Code here doesn't run because the promise became rejected due to an\n  // error!\n}, function (err){\n  // handle the error here\n});
\n
\n
\n \n

The 'Whoops' error will be thrown on the next turn of the event loop\nand you can watch for it in your console. You can also handle it using a\nrejection handler given to .then or .catch on the returned promise.

\n", + "itemtype": "method", + "name": "rethrow", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "reason the promise became rejected.", + "type": "Error" + } + ], + "throws": { + "description": "Error" + }, + "class": "rsvp", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/modules/ember-4.7.1-@ember/component-2fe5b25bc6.json b/json-docs/ember/4.7.1/modules/ember-4.7.1-@ember/component-2fe5b25bc6.json new file mode 100644 index 000000000..269081f28 --- /dev/null +++ b/json-docs/ember/4.7.1/modules/ember-4.7.1-@ember/component-2fe5b25bc6.json @@ -0,0 +1,89 @@ +{ + "data": { + "id": "ember-4.7.1-@ember/component", + "type": "module", + "attributes": { + "name": "@ember/component", + "submodules": {}, + "elements": {}, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/component": 1, + "Ember.Templates.components": 1, + "@ember/component/helper": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 47, + "description": "

Glimmer is a templating engine used by Ember.js that is compatible with a subset of the Handlebars syntax.

\n

Showing a property

\n

Templates manage the flow of an application's UI, and display state (through\nthe DOM) to a user. For example, given a component with the property "name",\nthat component's template can use the name in several ways:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  name: 'Jill'\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
{{this.name}}\n<div>{{this.name}}</div>\n<span data-name={{this.name}}></span>
\n
\n
\n \n

Any time the "name" property on the component changes, the DOM will be\nupdated.

\n

Properties can be chained as well:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{@aUserModel.name}}\n<div>{{@listOfUsers.firstObject.name}}</div>
\n
\n
\n \n

Using Ember helpers

\n

When content is passed in mustaches {{}}, Ember will first try to find a helper\nor component with that name. For example, the if helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
{{if this.name "I have a name" "I have no name"}}\n<span data-has-name={{if this.name true}}></span>
\n
\n
\n \n

The returned value is placed where the {{}} is called. The above style is\ncalled "inline". A second style of helper usage is called "block". For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#if this.name}}\n  I have a name\n{{else}}\n  I have no name\n{{/if}}
\n
\n
\n \n

The block form of helpers allows you to control how the UI is created based\non the values of properties.\nA third form of helper is called "nested". For example here the concat\nhelper will add " Doe" to a displayed name if the person has no last name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<span data-name={{concat this.firstName (\n  if this.lastName (concat " " this.lastName) "Doe"\n)}}></span>
\n
\n
\n \n

Ember's built-in helpers are described under the Ember.Templates.helpers\nnamespace. Documentation on creating custom helpers can be found under\nhelper (or\nunder Helper if a helper requires access to\ndependency injection).

\n

Invoking a Component

\n

Ember components represent state to the UI of an application. Further\nreading on components can be found under Component.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "Component", + "Helper" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 269, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "allstaticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 269, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "version": "4.7.1" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/modules/ember-4.7.1-@glimmer/component-f9704d567b.json b/json-docs/ember/4.7.1/modules/ember-4.7.1-@glimmer/component-f9704d567b.json new file mode 100644 index 000000000..18ed01acb --- /dev/null +++ b/json-docs/ember/4.7.1/modules/ember-4.7.1-@glimmer/component-f9704d567b.json @@ -0,0 +1,36 @@ +{ + "data": { + "id": "ember-4.7.1-@glimmer/component", + "type": "module", + "attributes": { + "name": "@glimmer/component", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts", + "line": 1, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault components for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Template-only and Glimmer components. If you\nare looking for the API documentation for Classic components, it is\navailable here. The source code for\nGlimmer components can be found in @glimmer/component.

\n

Defining a Template-only Component

\n

The simplest way to create a component is to create a template file in\napp/templates/components. For example, if you name a template\napp/templates/components/person-profile.hbs:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
<h1>{{@person.name}}</h1>\n<img src={{@person.avatar}}>\n<p class='signature'>{{@person.signature}}</p>
\n
\n
\n \n

You will be able to use <PersonProfile /> to invoke this component elsewhere\nin your application:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<PersonProfile @person={{this.currentUser}} />
\n
\n
\n \n

Note that component names are capitalized here in order to distinguish them\nfrom regular HTML elements, but they are dasherized in the file system.

\n

While the angle bracket invocation form is generally preferred, it is also\npossible to invoke the same component with the {{person-profile}} syntax:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person-profile person=this.currentUser}}
\n
\n
\n \n

Note that with this syntax, you use dashes in the component name and\narguments are passed without the @ sign.

\n

In both cases, Ember will render the content of the component template we\ncreated above. The end result will be something like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\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 \n

File System Nesting

\n

Components can be nested inside sub-folders for logical groupping. For\nexample, if we placed our template in\napp/templates/components/person/short-profile.hbs, we can invoke it as\n<Person::ShortProfile />:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Person::ShortProfile @person={{this.currentUser}} />
\n
\n
\n \n

Or equivalently, {{person/short-profile}}:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person/short-profile person=this.currentUser}}
\n
\n
\n \n

Using Blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield}}
\n
\n
\n \n

We could then invoke it like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}}>\n  <p>Admin mode</p>\n</PersonProfile>
\n
\n
\n \n

or with curly syntax like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-profile person=this.currentUser}}\n  <p>Admin mode</p>\n{{/person-profile}}
\n
\n
\n \n

And 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

Blocks are executed in their original context, meaning they have access to the\nscope and any in-scope variables where they were defined.

\n

Passing parameters to blocks

\n

You can also pass positional parameters to {{yield}}, which are then made\navailable in the block:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

We can then use this value in the block like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}} as |signature|>\n  {{signature}}\n</PersonProfile>
\n
\n
\n \n

Passing multiple blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield to="title"}}</h1>\n{{yield}}
\n
\n
\n \n

This component could then be invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title>{{this.currentUser.name}}</:title>\n  <:default>{{this.currentUser.signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

When 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

Passing parameters to named blocks

\n

You can also pass parameters to named blocks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield @person.name to="title"}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

These parameters can then be used like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title as |name|>{{name}}</:title>\n  <:default as |signature|>{{signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

Checking to see if a block exists

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\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
\n \n

With this template, we can then optionally pass in one block, both blocks, or\nnone at all:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\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 \n

Checking to see if a block has parameters

\n

We can also check if a block receives parameters using the (has-block-params)\nkeyword, and conditionally yield different values if so.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
{{#if (has-block-params)}}\n  {{yield @person.signature}}\n{{else}}\n  {{yield}}\n{{/if}}
\n
\n
\n \n

Customizing Components With JavaScript

\n

To 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\nPersonProfile component which we defined above, we would create\napp/components/person-profile.js and export our class as the default, like\nso:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n \n

You 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\ndisplayName property of our PersonProfile component instance in the\ntemplate like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

constructor

\n

params: owner object and args object

\n

Constructs 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import 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
\n \n

Service injections and arguments are available in the constructor.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import 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 \n

willDestroy

\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import 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 \n

args

\n

The args property of Glimmer components is an object that contains the\narguments that are passed to the component. For instance, the\nfollowing component usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @fadeIn={{true}} />
\n
\n
\n \n

Would result in the following args object to be passed to the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ fadeIn: true }
\n
\n
\n \n

args can be accessed at any point in the component lifecycle, including\nconstructor and willDestroy. They are also automatically marked as tracked\nproperties, and they can be depended on as computed property dependencies:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import 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 \n

isDestroying

\n

A boolean flag to tell if the component is in the process of destroying. This is set to\ntrue before willDestroy is called.

\n

isDestroyed

\n

A boolean to tell if the component has been fully destroyed. This is set to true\nafter willDestroy is called.

\n", + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "4.7.1" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/namespaces/ember-4.7.1-AutoLocation-fdb950ac52.json b/json-docs/ember/4.7.1/namespaces/ember-4.7.1-AutoLocation-fdb950ac52.json new file mode 100644 index 000000000..7e6090f67 --- /dev/null +++ b/json-docs/ember/4.7.1/namespaces/ember-4.7.1-AutoLocation-fdb950ac52.json @@ -0,0 +1,129 @@ +{ + "data": { + "id": "ember-4.7.1-AutoLocation", + "type": "namespace", + "attributes": { + "name": "AutoLocation", + "shortname": "AutoLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 22, + "description": "

AutoLocation will select the best location option based off browser\nsupport with the priority order: history, hash, none.

\n

Clean pushState paths accessed by hashchange-only browsers will be redirected\nto the hash-equivalent and vice versa so future transitions are consistent.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n

Browsers that support the history API will use HistoryLocation, those that\ndo not, but still support the hashchange event will use HashLocation, and\nin the rare case neither is supported will use NoneLocation.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'auto'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new for modern browsers that\nsupport the history api or /#/posts/new for older ones, like Internet\nExplorer 9 and below.

\n

When a user visits a link to your application, they will be automatically\nupgraded or downgraded to the appropriate Location class, with the URL\ntransformed accordingly, if needed.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n", + "static": 1, + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 354, + "access": "private", + "tagname": "Returns the current path as it should appear for HashLocation supported\nbrowsers. This may very well differ from the real current path.", + "itemtype": "method", + "name": "_getHashPath", + "class": "AutoLocation", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 80, + "access": "private", + "tagname": "Will be pre-pended to path upon state change.", + "since": "1.5.1", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 92, + "access": "private", + "tagname": "The browser's `location` object. This is typically equivalent to\n`window.location`, but may be overridden for testing.", + "itemtype": "property", + "name": "location", + "default": "environment.location", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 104, + "access": "private", + "tagname": "The browser's `history` object. This is typically equivalent to\n`window.history`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "history", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 117, + "access": "private", + "tagname": "The user agent's global variable. In browsers, this will be `window`.", + "since": "1.11", + "itemtype": "property", + "name": "global", + "default": "window", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 129, + "access": "private", + "tagname": "The browser's `userAgent`. This is typically equivalent to\n`navigator.userAgent`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "userAgent", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/routing/lib/location/auto_location.ts", + "line": 142, + "access": "private", + "tagname": "This property is used by the router to know whether to cancel the routing\nsetup process, which is needed while we redirect the browser.", + "since": "1.5.1", + "itemtype": "property", + "name": "cancelRouterSetup", + "default": "false", + "class": "AutoLocation", + "module": "@ember/routing" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.7.1/namespaces/ember-4.7.1-Instrumentation-46b17e5d59.json b/json-docs/ember/4.7.1/namespaces/ember-4.7.1-Instrumentation-46b17e5d59.json new file mode 100644 index 000000000..743ce8f42 --- /dev/null +++ b/json-docs/ember/4.7.1/namespaces/ember-4.7.1-Instrumentation-46b17e5d59.json @@ -0,0 +1,46 @@ +{ + "data": { + "id": "ember-4.7.1-Instrumentation", + "type": "namespace", + "attributes": { + "name": "Instrumentation", + "shortname": "Instrumentation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/instrumentation", + "namespace": "", + "file": "packages/@ember/instrumentation/index.ts", + "line": 40, + "description": "

The purpose of the Ember Instrumentation module is\nto provide efficient, general-purpose instrumentation\nfor Ember.

\n

Subscribe to a listener by using subscribe:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { subscribe } from '@ember/instrumentation';\n\nsubscribe("render", {\n  before(name, timestamp, payload) {\n\n  },\n\n  after(name, timestamp, payload) {\n\n  }\n});
\n
\n
\n \n

If you return a value from the before callback, that same\nvalue will be passed as a fourth parameter to the after\ncallback.

\n

Instrument a block of code by using instrument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { instrument } from '@ember/instrumentation';\n\ninstrument("render.handlebars", payload, function() {\n  // rendering logic\n}, binding);
\n
\n
\n \n

Event names passed to instrument are namespaced\nby periods, from more general to more specific. Subscribers\ncan listen for events by whatever level of granularity they\nare interested in.

\n

In the above example, the event is render.handlebars,\nand the subscriber listened for all events beginning with\nrender. It would receive callbacks for events named\nrender, render.handlebars, render.container, or\neven render.handlebars.layout.

\n", + "static": 1, + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.7.1-@ember/instrumentation", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.7.1", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/application-8e1d454bf6.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/application-8e1d454bf6.json new file mode 100644 index 000000000..a3814c042 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/application-8e1d454bf6.json @@ -0,0 +1,138 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/application", + "type": "class", + "attributes": { + "name": "@ember/application", + "shortname": "@ember/application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 31, + "description": "

Framework objects in an Ember application (components, services, routes, etc.)\nare created via a factory and dependency injection system. Each of these\nobjects is the responsibility of an "owner", which handled its\ninstantiation and manages its lifetime.

\n

getOwner fetches the owner object responsible for an instance. This can\nbe used to lookup or resolve other class instances, or register new factories\ninto the owner.

\n

For example, this component dynamically looks up a service based on the\naudioType passed as an argument:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
audio.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getOwner } from '@ember/application';\n\n// Usage:\n//\n//   <PlayAudio @audioType={{@model.audioType}} @audioFile={{@model.file}}/>\n//\nexport default class extends Component {\n  get audioService() {\n    let owner = getOwner(this);\n    return owner.lookup(`service:${this.args.audioType}`);\n  }\n\n  @action\n  onPlay() {\n    let player = this.audioService;\n    player.play(this.args.audioFile);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "getOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object with an owner.", + "type": "Object" + } + ], + "return": { + "description": "An owner object.", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 79, + "description": "

setOwner forces a new owner on a given object instance. This is primarily\nuseful in some testing cases.

\n", + "itemtype": "method", + "name": "setOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object instance.", + "type": "Object" + }, + { + "name": "object", + "description": "The new owner object of the object instance.", + "type": "Object" + } + ], + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 14, + "description": "

Detects when a specific package of Ember (e.g. 'Application')\nhas fully loaded and is available for extension.

\n

The provided callback will be called with the name passed\nresolved from a string into the object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { onLoad } from '@ember/application';\n\nonLoad('Ember.Application' function(hbars) {\n  hbars.registerHelper(...);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "onLoad", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "callback", + "description": "callback to be called", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 47, + "description": "

Called when an Ember.js package (e.g Application) has finished\nloading. Triggers any callbacks registered for this event.

\n", + "itemtype": "method", + "name": "runLoadHooks", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "object", + "description": "object to pass to callbacks", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/component/helper-b14af9e15f.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/component/helper-b14af9e15f.json new file mode 100644 index 000000000..33b211c5f --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/component/helper-b14af9e15f.json @@ -0,0 +1,61 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/component/helper", + "type": "class", + "attributes": { + "name": "@ember/component/helper", + "shortname": "@ember/component/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 272, + "description": "

In many cases it is not necessary to use the full Helper class.\nThe helper method create pure-function helpers without instances.\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n
import { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n  return `${currency}${cents * 0.01}`;\n});
\n
\n
\n \n", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/debug-31e2202332.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/debug-31e2202332.json new file mode 100644 index 000000000..83abe9d7e --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/debug-31e2202332.json @@ -0,0 +1,310 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/debug", + "type": "class", + "attributes": { + "name": "@ember/debug", + "shortname": "@ember/debug", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 918, + "description": "

Allows checking if a given property on an object is a computed property. For the most part,\nthis doesn't matter (you would normally just access the property directly and use its value),\nbut for some tooling specific scenarios (e.g. the ember-inspector) it is important to\ndifferentiate if a property is a computed property or a "normal" property.

\n

This will work on either a class's prototype or an instance itself.

\n", + "static": 1, + "itemtype": "method", + "name": "isComputed", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/object" + }, + { + "file": "packages/@ember/debug/lib/capture-render-tree.ts", + "line": 9, + "description": "

Ember Inspector calls this function to capture the current render tree.

\n

In production mode, this requires turning on ENV._DEBUG_RENDER_TREE\nbefore loading Ember.

\n", + "access": "private", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "captureRenderTree", + "params": [ + { + "name": "app", + "description": "An `ApplicationInstance`.", + "type": "ApplicationInstance" + } + ], + "since": "3.14.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 37, + "description": "

Allows for runtime registration of handler functions that override the default deprecation behavior.\nDeprecations are invoked by calls to @ember/debug/deprecate.\nThe following example demonstrates its usage by registering a handler that throws an error if the\nmessage contains the word "should", otherwise defers to the default handler.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { registerDeprecationHandler } from '@ember/debug';\n\nregisterDeprecationHandler((message, options, next) => {\n  if (message.indexOf('should') !== -1) {\n    throw new Error(`Deprecation message with should: ${message}`);\n  } else {\n    // defer to whatever handler was registered before this one\n    next(message, options);\n  }\n});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the deprecation call.
  • \n
  • options - An object passed in with the deprecation call containing additional information including:
  • \n
      \n
    • id - An id of the deprecation in the form of package-name.specific-deprecation.
    • \n
    • until - The Ember version number the feature and deprecation will be removed in.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerDeprecationHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle deprecation calls.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 182, + "description": "

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only).

\n

Ember itself leverages Semantic Versioning to aid\nprojects in keeping up with changes to the framework. Before any\nfunctionality or API is removed, it first flows linearly through a\ndeprecation staging process. The staging process currently contains two\nstages: available and enabled.

\n

Deprecations are initially released into the 'available' stage.\nDeprecations will stay in this stage until the replacement API has been\nmarked as a recommended practice via the RFC process and the addon\necosystem has generally adopted the change.

\n

Once a deprecation meets the above criteria, it will move into the\n'enabled' stage where it will remain until the functionality or API is\neventually removed.

\n

For application and addon developers, "available" deprecations are not\nurgent and "enabled" deprecations require action.

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { deprecate } from '@ember/debug';\n\ndeprecate(\n  'Use of `assign` has been deprecated. Please use `Object.assign` or the spread operator instead.',\n  false,\n  {\n    id: 'ember-polyfills.deprecate-assign',\n    until: '5.0.0',\n    url: 'https://deprecations.emberjs.com/v4.x/#toc_ember-polyfills-deprecate-assign',\n    for: 'ember-source',\n    since: {\n      available: '4.0.0',\n      enabled: '4.0.0',\n    },\n  }\n);
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecate", + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "test", + "description": "A boolean. If falsy, the deprecation will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "", + "type": "Object", + "props": [ + { + "name": "id", + "description": "A unique id for this deprecation. The id can be\n used by Ember debugging tools to change the behavior (raise, log or silence)\n for that specific deprecation. The id should be namespaced by dots, e.g.\n \"view.helper.select\".", + "type": "String" + }, + { + "name": "until", + "description": "The version of Ember when this deprecation\n warning will be removed.", + "type": "String" + }, + { + "name": "for", + "description": "A namespace for the deprecation, usually the package name", + "type": "String" + }, + { + "name": "since", + "description": "Describes when the deprecation became available and enabled.", + "type": "Object" + }, + { + "name": "url", + "description": "An optional url to the transition guide on the\n emberjs.com website.", + "type": "String", + "optional": true + } + ] + } + ], + "static": 1, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 24, + "description": "

Allows for runtime registration of handler functions that override the default warning behavior.\nWarnings are invoked by calls made to @ember/debug/warn.\nThe following example demonstrates its usage by registering a handler that does nothing overriding Ember's\ndefault warning behavior.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { registerWarnHandler } from '@ember/debug';\n\n// next is not called, so no warnings get the default behavior\nregisterWarnHandler(() => {});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the warn call.
  • \n
  • options - An object passed in with the warn call containing additional information including:
  • \n
      \n
    • id - An id of the warning in the form of package-name.specific-warning.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWarnHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle warnings.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 71, + "description": "

Display a warning with the provided message.

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { warn } from '@ember/debug';\nimport tomsterCount from './tomster-counter'; // a module in my project\n\n// Log a warning if we have more than 3 tomsters\nwarn('Too many tomsters!', tomsterCount <= 3, {\n  id: 'ember-debug.too-many-tomsters'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "warn", + "static": 1, + "params": [ + { + "name": "message", + "description": "A warning to display.", + "type": "String" + }, + { + "name": "test", + "description": "An optional boolean. If falsy, the warning\n will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "An object that can be used to pass a unique\n `id` for this warning. The `id` can be used by Ember debugging tools\n to change the behavior (raise, log, or silence) for that specific warning.\n The `id` should be namespaced by dots, e.g. \"ember-debug.feature-flag-with-features-stripped\"", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 136, + "description": "

Verify that a certain expectation is met, or throw a exception otherwise.

\n

This is useful for communicating assumptions in the code to other human\nreaders as well as catching bugs that accidentally violates these\nexpectations.

\n

Assertions are removed from production builds, so they can be freely added\nfor documentation and debugging purposes without worries of incuring any\nperformance penalty. However, because of that, they should not be used for\nchecks that could reasonably fail during normal usage. Furthermore, care\nshould be taken to avoid accidentally relying on side-effects produced from\nevaluating the condition itself, since the code will not run in production.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assert } from '@ember/debug';\n\n// Test for truthiness\nassert('Must pass a string', typeof str === 'string');\n\n// Fail unconditionally\nassert('This code path should never be run');
\n
\n
\n \n", + "itemtype": "method", + "name": "assert", + "static": 1, + "params": [ + { + "name": "description", + "description": "Describes the expectation. This will become the\n text of the Error thrown if the assertion fails.", + "type": "String" + }, + { + "name": "condition", + "description": "Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.", + "type": "Any" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 176, + "description": "

Display a debug notice.

\n

Calls to this function are not invoked in production builds.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { debug } from '@ember/debug';\n\ndebug('I\\'m a debug notice!');
\n
\n
\n \n", + "itemtype": "method", + "name": "debug", + "static": 1, + "params": [ + { + "name": "message", + "description": "A debug message to display.", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 203, + "description": "

Display an info notice.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n", + "itemtype": "method", + "name": "info", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 222, + "description": "

Alias an old, deprecated method with its new counterpart.

\n

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only) when the assigned method is called.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { deprecateFunc } from '@ember/debug';\n\nEmber.oldMethod = deprecateFunc('Please use the new, updated method', options, Ember.newMethod);
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecateFunc", + "static": 1, + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "options", + "description": "The options object for `deprecate`.", + "type": "Object", + "optional": true + }, + { + "name": "func", + "description": "The new function called to replace its deprecated counterpart.", + "type": "Function" + } + ], + "return": { + "description": "A new function that wraps the original function with a deprecation warning", + "type": "Function" + }, + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 267, + "description": "

Run a function meant for debugging.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport { runInDebug } from '@ember/debug';\n\nrunInDebug(() => {\n  Component.reopen({\n    didInsertElement() {\n      console.log("I'm happy");\n    }\n  });\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "runInDebug", + "static": 1, + "params": [ + { + "name": "func", + "description": "The function to be executed.", + "type": "Function" + } + ], + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/destroyable-d3db3664ab.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/destroyable-d3db3664ab.json new file mode 100644 index 000000000..7ab80571b --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/destroyable-d3db3664ab.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/destroyable", + "type": "class", + "attributes": { + "name": "@ember/destroyable", + "shortname": "@ember/destroyable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/destroyable", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/destroyable/index.ts", + "line": 31, + "description": "

This function is used to associate a destroyable object with a parent. When the parent\nis destroyed, all registered children will also be destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
class CustomSelect extends Component {\n  constructor(...args) {\n    super(...args);\n\n    // obj is now a child of the component. When the component is destroyed,\n    // obj will also be destroyed, and have all of its destructors triggered.\n    this.obj = associateDestroyableChild(this, {});\n  }\n}
\n
\n
\n \n

Returns the associated child for convenience.

\n", + "itemtype": "method", + "name": "associateDestroyableChild", + "params": [ + { + "name": "parent", + "description": "the destroyable to entangle the child destroyables lifetime with", + "type": "Object|Function" + }, + { + "name": "child", + "description": "the destroyable to be entangled with the parents lifetime", + "type": "Object|Function" + } + ], + "return": { + "description": "the child argument", + "type": "Object|Function" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 58, + "description": "

Receives a destroyable, and returns true if the destroyable has begun destroying. Otherwise returns\nfalse.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let obj = {};\nisDestroying(obj); // false\ndestroy(obj);\nisDestroying(obj); // true\n// ...sometime later, after scheduled destruction\nisDestroyed(obj); // true\nisDestroying(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroying", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 80, + "description": "

Receives a destroyable, and returns true if the destroyable has finished destroying. Otherwise\nreturns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let obj = {};\n\nisDestroyed(obj); // false\ndestroy(obj);\n\n// ...sometime later, after scheduled destruction\n\nisDestroyed(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroyed", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 103, + "description": "

Initiates the destruction of a destroyable object. It runs all associated destructors, and then\ndestroys all children recursively.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let obj = {};\n\nregisterDestructor(obj, () => console.log('destroyed!'));\n\ndestroy(obj); // this will schedule the destructor to be called\n\n// ...some time later, during scheduled destruction\n\n// destroyed!
\n
\n
\n \n

Destruction via destroy() follows these steps:

\n

1, Mark the destroyable such that isDestroying(destroyable) returns true\n2, Call destroy() on each of the destroyable's associated children\n3, Schedule calling the destroyable's destructors\n4, Schedule setting destroyable such that isDestroyed(destroyable) returns true

\n

This results in the entire tree of destroyables being first marked as destroying,\nthen having all of their destructors called, and finally all being marked as isDestroyed.\nThere won't be any in between states where some items are marked as isDestroying while\ndestroying, while others are not.

\n", + "itemtype": "method", + "name": "destroy", + "params": [ + { + "name": "destroyable", + "description": "the object to destroy", + "type": "Object|Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 138, + "description": "

This function asserts that all objects which have associated destructors or associated children\nhave been destroyed at the time it is called. It is meant to be a low level hook that testing\nframeworks can use to hook into and validate that all destroyables have in fact been destroyed.

\n

This function requires that enableDestroyableTracking was called previously, and is only\navailable in non-production builds.

\n", + "itemtype": "method", + "name": "assertDestroyablesDestroyed", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 152, + "description": "

This function instructs the destroyable system to keep track of all destroyables (their\nchildren, destructors, etc). This enables a future usage of assertDestroyablesDestroyed\nto be used to ensure that all destroyable tasks (registered destructors and associated children)\nhave completed when assertDestroyablesDestroyed is called.

\n", + "itemtype": "method", + "name": "enableDestroyableTracking", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 164, + "description": "

Receives a destroyable object and a destructor function, and associates the\nfunction with it. When the destroyable is destroyed with destroy, or when its\nparent is destroyed, the destructor function will be called.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, () => this.resize.unregister(this));\n  }\n}
\n
\n
\n \n

Multiple destructors can be associated with a given destroyable, and they can be\nassociated over time, allowing libraries to dynamically add destructors as needed.\nregisterDestructor also returns the associated destructor function, for convenience.

\n

The destructor function is passed a single argument, which is the destroyable itself.\nThis allows the function to be reused multiple times for many destroyables, rather\nthan creating a closure function per destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nfunction unregisterResize(instance) {\n  instance.resize.unregister(instance);\n}\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, unregisterResize);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "registerDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to register the destructor function with", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to run when the destroyable object is destroyed", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 229, + "description": "

Receives a destroyable and a destructor function, and de-associates the destructor\nfrom the destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor, unregisterDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service modals;\n\n  constructor(...args) {\n    super(...args);\n\n    this.modals.add(this);\n\n    this.modalDestructor = registerDestructor(this, () => this.modals.remove(this));\n  }\n\n  @action pinModal() {\n    unregisterDestructor(this, this.modalDestructor);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "unregisterDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to unregister the destructor function from", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to remove from the destroyable", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/destroyable", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/helper-f169988bcc.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/helper-f169988bcc.json new file mode 100644 index 000000000..8eb328cab --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/helper-f169988bcc.json @@ -0,0 +1,128 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/helper", + "type": "class", + "attributes": { + "name": "@ember/helper", + "shortname": "@ember/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/helper", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/helper/index.ts", + "line": 5, + "description": "

capabilities returns a capabilities configuration which can be used to modify\nthe behavior of the manager. Manager capabilities must be provided using the\ncapabilities function, as the underlying implementation can change over time.

\n

The first argument to capabilities is a version string, which is the version of\nEmber that the capabilities were defined in. Ember can add new versions at any\ntime, and these may have entirely different behaviors, but it will not remove\nold versions until the next major version.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
capabilities('3.23');
\n
\n
\n \n

The second argument is an object of capabilities and boolean values indicating\nwhether they are enabled or disabled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
capabilities('3.23', {\n  hasValue: true,\n  hasDestructor: true,\n});
\n
\n
\n \n

If no value is specified, then the default value will be used.

\n

3.23 capabilities

\n

hasDestroyable

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a destroyable to include in the destructor\nhierarchy. If enabled, the getDestroyable hook will be called, and its result\nwill be associated with the destroyable parent block.

\n

hasValue

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a value which can be used externally. The helper's\ngetValue hook will be run whenever the value of the helper is accessed if this\ncapability is enabled.

\n", + "itemtype": "method", + "name": "capabilities", + "static": 1, + "params": [ + { + "name": "managerApiVersion", + "description": "The version of capabilities that are being used", + "type": "String" + }, + { + "name": "options", + "description": "The capabilities values" + } + ], + "return": { + "description": "The capabilities object instance", + "type": "Capabilities" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 58, + "description": "

Sets the helper manager for an object or function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
setHelperManager((owner) => new ClassHelperManager(owner), Helper)
\n
\n
\n \n

When a value is used as a helper in a template, the helper manager is looked up\non the object by walking up its prototype chain and finding the first helper\nmanager. This manager then receives the value and can create and manage an\ninstance of a helper from it. This provides a layer of indirection that allows\nusers to design high-level helper APIs, without Ember needing to worry about the\ndetails. High-level APIs can be experimented with and iterated on while the\ncore of Ember helpers remains stable, and new APIs can be introduced gradually\nover time to existing code bases.

\n

setHelperManager receives two arguments:

\n
    \n
  1. A factory function, which receives the owner and returns an instance of a\n helper manager.
  2. \n
  3. A helper definition, which is the object or function to associate the factory function with.
  4. \n
\n

The first time the object is looked up, the factory function will be called to\ncreate the helper manager. It will be cached, and in subsequent lookups the\ncached helper manager will be used instead.

\n

Only one helper manager is guaranteed to exist per owner and per usage of\nsetHelperManager, so many helpers will end up using the same instance of the\nhelper manager. As such, you should only store state that is related to the\nmanager itself. If you want to store state specific to a particular helper\ndefinition, you should assign a unique helper manager to that helper. In\ngeneral, most managers should either be stateless, or only have the owner they\nwere created with as state.

\n

Helper managers must fulfill the following interface (This example uses\nTypeScript interfaces\nfor precision, you do not need to write helper managers using TypeScript):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
interface HelperManager<HelperStateBucket> {\n  capabilities: HelperCapabilities;\n\n  createHelper(definition: HelperDefinition, args: TemplateArgs): HelperStateBucket;\n\n  getValue?(bucket: HelperStateBucket): unknown;\n\n  runEffect?(bucket: HelperStateBucket): void;\n\n  getDestroyable?(bucket: HelperStateBucket): object;\n}
\n
\n
\n \n

The capabilities property must be provided using the capabilities() function\nimported from the same module as setHelperManager:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capabilities } from '@ember/helper';\n\nclass MyHelperManager {\n  capabilities = capabilities('3.21.0', { hasValue: true });\n\n  // ...snip...\n}
\n
\n
\n \n

Below is a description of each of the methods on the interface and their\nfunctions.

\n

createHelper

\n

createHelper is a required hook on the HelperManager interface. The hook is\npassed the definition of the helper that is currently being created, and is\nexpected to return a state bucket. This state bucket is what represents the\ncurrent state of the helper, and will be passed to the other lifecycle hooks at\nappropriate times. It is not necessarily related to the definition of the\nhelper itself - for instance, you could return an object containing an\ninstance of the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
class MyManager {\n  createHelper(Definition, args) {\n    return {\n      instance: new Definition(args);\n    };\n  }\n}
\n
\n
\n \n

This allows the manager to store metadata that it doesn't want to expose to the\nuser.

\n

This hook is not autotracked - changes to tracked values used within this hook\nwill not result in a call to any of the other lifecycle hooks. This is because\nit is unclear what should happen if it invalidates, and rather than make a\ndecision at this point, the initial API is aiming to allow as much expressivity\nas possible. This could change in the future with changes to capabilities and\ntheir behaviors.

\n

If users do want to autotrack some values used during construction, they can\neither create the instance of the helper in runEffect or getValue, or they\ncan use the cache API to autotrack the createHelper hook themselves. This\nprovides maximum flexibility and expressiveness to manager authors.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called as discovered during DOM construction
  • \n
  • called in definition order in the template
  • \n
\n

getValue

\n

getValue is an optional hook that should return the value of the helper. This\nis the value that is returned from the helper and passed into the template.

\n

This hook is called when the value is requested from the helper (e.g. when the\ntemplate is rendering and the helper value is needed). The hook is autotracked,\nand will rerun whenever any tracked values used inside of it are updated.\nOtherwise it does not rerun.

\n
\n

Note: This means that arguments which are not consumed within the hook will\nnot trigger updates.

\n
\n

This hook is only called for helpers with the hasValue capability enabled.\nThis hook has the following timing semantics:

\n

Always

\n
    \n
  • called the first time the helper value is requested
  • \n
  • called after autotracked state has changed
  • \n
\n

Never

\n
    \n
  • called if the hasValue capability is disabled
  • \n
\n

runEffect

\n

runEffect is an optional hook that should run the effect that the helper is\napplying, setting it up or updating it.

\n

This hook is scheduled to be called some time after render and prior to paint.\nThere is not a guaranteed, 1-to-1 relationship between a render pass and this\nhook firing. For instance, multiple render passes could occur, and the hook may\nonly trigger once. It may also never trigger if it was dirtied in one render\npass and then destroyed in the next.

\n

The hook is autotracked, and will rerun whenever any tracked values used inside\nof it are updated. Otherwise it does not rerun.

\n

The hook is also run during a time period where state mutations are disabled\nin Ember. Any tracked state mutation will throw an error during this time,\nincluding changes to tracked properties, changes made using Ember.set, updates\nto computed properties, etc. This is meant to prevent infinite rerenders and\nother antipatterns.

\n

This hook is only called for helpers with the hasScheduledEffect capability\nenabled. This hook is also not called in SSR currently, though this could be\nadded as a capability in the future. It has the following timing semantics:

\n

Always

\n
    \n
  • called after the helper was first created, if the helper has not been\ndestroyed since creation
  • \n
  • called after autotracked state has changed, if the helper has not been\ndestroyed during render
  • \n
\n

Never

\n
    \n
  • called if the hasScheduledEffect capability is disabled
  • \n
  • called in SSR
  • \n
\n

getDestroyable

\n

getDestroyable is an optional hook that users can use to register a\ndestroyable object for the helper. This destroyable will be registered to the\ncontaining block or template parent, and will be destroyed when it is destroyed.\nSee the Destroyables RFC\nfor more details.

\n

getDestroyable is only called if the hasDestroyable capability is enabled.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called immediately after the createHelper hook is called
  • \n
\n

Never

\n
    \n
  • called if the hasDestroyable capability is disabled
  • \n
\n", + "itemtype": "method", + "name": "setHelperManager", + "static": 1, + "params": [ + { + "name": "factory", + "description": "A factory function which receives an optional owner, and returns a helper manager", + "type": "Function" + }, + { + "name": "definition", + "description": "The definition to associate the manager factory with", + "type": "Object" + } + ], + "return": { + "description": "The definition passed into setHelperManager", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 251, + "description": "

The invokeHelper function can be used to create a helper instance in\nJavaScript.

\n

To access a helper's value you have to use getValue from\n@glimmer/tracking/primitives/cache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
// app/components/data-loader.js\nimport Component from '@glimmer/component';\nimport { getValue } from '@glimmer/tracking/primitives/cache';\nimport Helper from '@ember/component/helper';\nimport { invokeHelper } from '@ember/helper';\n\nclass PlusOne extends Helper {\n  compute([number]) {\n    return number + 1;\n  }\n}\n\nexport default class PlusOneComponent extends Component {\n  plusOne = invokeHelper(this, PlusOne, () => {\n    return {\n      positional: [this.args.number],\n    };\n  });\n\n  get value() {\n    return getValue(this.plusOne);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{this.value}}
\n
\n
\n \n

It receives three arguments:

\n
    \n
  • context: The parent context of the helper. When the parent is torn down and\nremoved, the helper will be as well.
  • \n
  • definition: The definition of the helper.
  • \n
  • computeArgs: An optional function that produces the arguments to the helper.\nThe function receives the parent context as an argument, and must return an\nobject with a positional property that is an array and/or a named\nproperty that is an object.
  • \n
\n

And it returns a Cache instance that contains the most recent value of the\nhelper. You can access the helper using getValue() like any other cache. The\ncache is also destroyable, and using the destroy() function on it will cause\nthe helper to be torn down.

\n

Note that using getValue() on helpers that have scheduled effects will not\ntrigger the effect early. Effects will continue to run at their scheduled time.

\n", + "itemtype": "method", + "name": "invokeHelper", + "static": 1, + "params": [ + { + "name": "context", + "description": "The parent context of the helper", + "type": "Object" + }, + { + "name": "definition", + "description": "The helper definition", + "type": "Object" + }, + { + "name": "computeArgs", + "description": "An optional function that produces args", + "type": "Function" + } + ], + "return": { + "description": "" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/helper", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/object-00bcd70b8f.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/object-00bcd70b8f.json new file mode 100644 index 000000000..41eb5864c --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/object-00bcd70b8f.json @@ -0,0 +1,521 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/object", + "type": "class", + "attributes": { + "name": "@ember/object", + "shortname": "@ember/object", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 730, + "description": "

This helper returns a new property descriptor that wraps the passed\ncomputed property function. You can use this helper to define properties with\nnative decorator syntax, mixins, or via defineProperty().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', function() {\n    return `${this.get('firstName')} ${this.get('lastName')}`;\n  })\n});\n\nlet client = Person.create();\n\nclient.get('fullName'); // 'Betty Jones'\n\nclient.set('lastName', 'Fuller');\nclient.get('fullName'); // 'Betty Fuller'
\n
\n
\n \n

You can also provide a setter, either directly on the class using native class\nsyntax, or by passing a hash with get and set functions.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(/\\s+/);\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n\n    return value;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', {\n    get(key) {\n      return `${this.get('firstName')} ${this.get('lastName')}`;\n    },\n    set(key, value) {\n      let [firstName, lastName] = value.split(/\\s+/);\n      this.setProperties({ firstName, lastName });\n      return value;\n    }\n  })\n});\n\nlet client = Person.create();\nclient.get('firstName'); // 'Betty'\n\nclient.set('fullName', 'Carroll Fuller');\nclient.get('firstName'); // 'Carroll'
\n
\n
\n \n

When passed as an argument, the set function should accept two parameters,\nkey and value. The value returned from set will be the new value of the\nproperty.

\n

Note: This is the preferred way to define computed properties when writing third-party\nlibraries that depend on or use Ember, since there is no guarantee that the user\nwill have prototype Extensions enabled.

\n", + "itemtype": "method", + "name": "computed", + "static": 1, + "params": [ + { + "name": "dependentKeys*", + "description": "Optional dependent keys that trigger this computed property.", + "type": "String", + "optional": true + }, + { + "name": "func", + "description": "The computed property function.", + "type": "Function" + } + ], + "return": { + "description": "property decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/get_properties.ts", + "line": 6, + "description": "

To get multiple properties at once, call getProperties\nwith an object followed by a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, 'firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, ['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + }, + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/properties.ts", + "line": 13, + "description": "

NOTE: This is a low-level method used by other parts of the API. You almost\nnever want to call this method directly. Instead you should use\nmixin() to define new properties.

\n

Defines a property on an object. This method works much like the ES5\nObject.defineProperty() method except that it can also accept computed\nproperties and other special descriptors.

\n

Normally this method takes only three parameters. However if you pass an\ninstance of Descriptor as the third param then you can pass an\noptional value as the fourth parameter. This is often more efficient than\ncreating new descriptor hashes for each property.

\n

Examples

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { defineProperty, computed } from '@ember/object';\n\n// ES5 compatible mode\ndefineProperty(contact, 'firstName', {\n  writable: true,\n  configurable: false,\n  enumerable: true,\n  value: 'Charles'\n});\n\n// define a simple property\ndefineProperty(contact, 'lastName', undefined, 'Jolley');\n\n// define a computed property\ndefineProperty(contact, 'fullName', computed('firstName', 'lastName', function() {\n  return this.firstName+' '+this.lastName;\n}));
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "defineProperty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "the object to define this property on. This may be a prototype.", + "type": "Object" + }, + { + "name": "keyName", + "description": "the name of the property", + "type": "String" + }, + { + "name": "desc", + "description": "an instance of `Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.", + "type": "Descriptor", + "optional": true + }, + { + "name": "data", + "description": "something other than a descriptor, that will\n become the explicit value of this property.", + "type": "*", + "optional": true + } + ], + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 32, + "description": "

This function is called just after an object property has changed.\nIt will notify any observers and clear caches among other things.

\n

Normally you will not need to call this method directly but if for some\nreason you can't directly watch a property you can invoke this method\nmanually.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "obj", + "description": "The object with the property that will change", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key (or path) that will change.", + "type": "String" + }, + { + "name": "_meta", + "description": "The objects meta.", + "type": "Meta", + "optional": true + }, + { + "name": "value", + "description": "The new value to set for the property", + "type": "Unknown", + "optional": true + } + ], + "return": { + "description": "", + "type": "Void" + }, + "since": "3.1.0", + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 83, + "itemtype": "method", + "name": "beginPropertyChanges", + "chainable": 1, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 93, + "itemtype": "method", + "name": "endPropertyChanges", + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 105, + "description": "

Make a series of property changes together in an\nexception-safe way.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
Ember.changeProperties(function() {\n  obj1.set('foo', mayBlowUpWhenSet);\n  obj2.set('bar', baz);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "changeProperties", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_get.ts", + "line": 50, + "description": "

Gets the value of a property on an object. If the property is computed,\nthe function will be invoked. If the property is not defined but the\nobject implements the unknownProperty method then that will be invoked.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { get } from '@ember/object';\nget(obj, "name");
\n
\n
\n \n

If you plan to run on IE8 and older browsers then you should use this\nmethod anytime you want to retrieve a property on an object that you don't\nknow for sure is private. (Properties beginning with an underscore '_'\nare considered private.)

\n

On all newer browsers, you only need to use this method to retrieve\nproperties if the property might not be defined on the object and you want\nto respect the unknownProperty handler. Otherwise you can ignore this\nmethod.

\n

Note that if the object itself is undefined, this method will throw\nan error.

\n", + "itemtype": "method", + "name": "get", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to retrieve from.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to retrieve", + "type": "String" + } + ], + "return": { + "description": "the property value or `null`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 18, + "description": "

Sets the value of a property on an object, respecting computed properties\nand notifying observers and other listeners of the change.\nIf the specified property is not defined on the object and the object\nimplements the setUnknownProperty method, then instead of setting the\nvalue of the property on the object, its setUnknownProperty handler\nwill be invoked with the two parameters keyName and value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { set } from '@ember/object';\nset(obj, "name", value);
\n
\n
\n \n", + "itemtype": "method", + "name": "set", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "return": { + "description": "the passed value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 124, + "description": "

Error-tolerant form of set. Will not blow up if any part of the\nchain is undefined, null, or destroyed.

\n

This is primarily used when syncing bindings, which may try to update after\nan object has been destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { trySet } from '@ember/object';\n\nlet obj = { name: "Zoey" };\ntrySet(obj, "contacts.twitter", "@emberjs");
\n
\n
\n \n", + "itemtype": "method", + "name": "trySet", + "static": 1, + "params": [ + { + "name": "root", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "path", + "description": "The property path to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/set_properties.ts", + "line": 6, + "description": "

Set a list of properties on an object. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nlet anObject = EmberObject.create();\n\nanObject.setProperties({\n  firstName: 'Stanley',\n  lastName: 'Stuart',\n  age: 21\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "properties", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "properties" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 617, + "description": "

Creates a new subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(thing);\n   }\n});
\n
\n
\n \n

This defines a new subclass of EmberObject: Person. It contains one method: say().

\n

You can also create a subclass from any existing class by calling its extend() method.\nFor example, you might want to create a subclass of Ember's built-in Component class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nconst PersonComponent = Component.extend({\n  tagName: 'li',\n  classNameBindings: ['isAdministrator']\n});
\n
\n
\n \n

When defining a subclass, you can override methods but still access the\nimplementation of your parent class by calling the special _super() method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    let name = this.get('name');\n    alert(`${name} says: ${thing}`);\n  }\n});\n\nconst Soldier = Person.extend({\n  say(thing) {\n    this._super(`${thing}, sir!`);\n  },\n  march(numberOfHours) {\n    alert(`${this.get('name')} marches for ${numberOfHours} hours.`);\n  }\n});\n\nlet yehuda = Soldier.create({\n  name: 'Yehuda Katz'\n});\n\nyehuda.say('Yes');  // alerts "Yehuda Katz says: Yes, sir!"
\n
\n
\n \n

The create() on line #17 creates an instance of the Soldier class.\nThe extend() on line #8 creates a subclass of Person. Any instance\nof the Person class will not have the march() method.

\n

You can also pass Mixin classes to add additional properties to the subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import EmberObject from '@ember/object';\nimport Mixin from '@ember/object/mixin';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(`${this.get('name')} says: ${thing}`);\n  }\n});\n\nconst SingingMixin = Mixin.create({\n  sing(thing) {\n    alert(`${this.get('name')} sings: la la la ${thing}`);\n  }\n});\n\nconst BroadwayStar = Person.extend(SingingMixin, {\n  dance() {\n    alert(`${this.get('name')} dances: tap tap tap tap `);\n  }\n});
\n
\n
\n \n

The BroadwayStar class contains three methods: say(), sing(), and dance().

\n", + "itemtype": "method", + "name": "extend", + "static": 1, + "params": [ + { + "name": "mixins", + "description": "One or more Mixin classes", + "type": "Mixin", + "optional": true, + "multiple": true + }, + { + "name": "arguments", + "description": "Object containing values to use within the new class", + "type": "Object", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 721, + "description": "

Creates an instance of a class. Accepts either no arguments, or an object\ncontaining values to initialize the newly instantiated object with.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  helloWorld() {\n    alert(`Hi, my name is ${this.get('name')}`);\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\n\ntom.helloWorld(); // alerts "Hi, my name is Tom Dale".
\n
\n
\n \n

create will call the init function if defined during\nAnyObject.extend

\n

If no arguments are passed to create, it will not set values to the new\ninstance during initialization:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let noName = Person.create();\nnoName.helloWorld(); // alerts undefined
\n
\n
\n \n

NOTE: For performance reasons, you cannot declare methods or computed\nproperties during create. You should instead declare methods and computed\nproperties when using extend.

\n", + "itemtype": "method", + "name": "create", + "static": 1, + "params": [ + { + "name": "arguments", + "description": "", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 786, + "description": "

Augments a constructor's prototype with additional\nproperties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\no = MyObject.create();\no.get('name'); // 'an object'\n\nMyObject.reopen({\n  say(msg) {\n    console.log(msg);\n  }\n});\n\no2 = MyObject.create();\no2.say('hello'); // logs "hello"\n\no.say('goodbye'); // logs "goodbye"
\n
\n
\n \n

To add functions and properties to the constructor itself,\nsee reopenClass

\n", + "itemtype": "method", + "name": "reopen", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 840, + "description": "

Augments a constructor's own properties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\nMyObject.reopenClass({\n  canBuild: false\n});\n\nMyObject.canBuild; // false\no = MyObject.create();
\n
\n
\n \n

In other words, this creates static properties and functions for the class.\nThese are only available on the class and not on any instance of that class.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  name: '',\n  sayHello() {\n    alert(`Hello. My name is ${this.get('name')}`);\n  }\n});\n\nPerson.reopenClass({\n  species: 'Homo sapiens',\n\n  createPerson(name) {\n    return Person.create({ name });\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\nlet yehuda = Person.createPerson('Yehuda Katz');\n\ntom.sayHello(); // "Hello. My name is Tom Dale"\nyehuda.sayHello(); // "Hello. My name is Yehuda Katz"\nalert(Person.species); // "Homo sapiens"
\n
\n
\n \n

Note that species and createPerson are not valid on the tom and yehuda\nvariables. They are only valid on Person.

\n

To add functions and properties to instances of\na constructor by extending the constructor's prototype\nsee reopen

\n", + "itemtype": "method", + "name": "reopenClass", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 923, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For\nexample, computed property functions may close over variables that are then\nno longer available for introspection.

\n

You can pass a hash of these values to a computed property like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { computed } from '@ember/object';\n\nperson: computed(function() {\n  let personId = this.get('personId');\n  return Person.create({ id: personId });\n}).meta({ type: Person })
\n
\n
\n \n

Once you've done this, you can retrieve the values saved to the computed\nproperty from your class like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyClass.metaForProperty('person');
\n
\n
\n \n

This will return the original hash that was passed to meta().

\n", + "static": 1, + "itemtype": "method", + "name": "metaForProperty", + "params": [ + { + "name": "key", + "description": "property name", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 966, + "description": "

Iterate over each computed property for the class, passing its name\nand any associated metadata (see metaForProperty) to the callback.

\n", + "static": 1, + "itemtype": "method", + "name": "eachComputedProperty", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "binding", + "description": "", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 1058, + "description": "

Provides lookup-time type validation for injected properties.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_onLookup", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 1079, + "description": "

Returns a hash of property names and container names that injected\nproperties will lookup on the container lazily.

\n", + "itemtype": "method", + "name": "_lazyInjections", + "return": { + "description": "Hash of all lazy injected property keys to container names", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/index.ts", + "line": 50, + "description": "

Decorator that turns the target function into an Action which can be accessed\ndirectly by reference.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action this.toggleShowing}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

Decorated actions also interop with the string style template actions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action "toggleShowing"}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

It also binds the function directly to the instance, so it can be used in any\ncontext and will correctly refer to the class it came from:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert this.toggleShowing}}\n  {{on "click" this.toggleShowing}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

This can also be used in JavaScript code directly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  constructor() {\n    super(...arguments);\n\n    // this.toggleShowing is still bound correctly when added to\n    // the event listener\n    document.addEventListener('click', this.toggleShowing);\n  }\n\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n

This is considered best practice, since it means that methods will be bound\ncorrectly no matter where they are used. By contrast, the {{action}} helper\nand modifier can also be used to bind context, but it will be required for\nevery usage of the method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert (action this.toggleShowing)}}\n  {{on "click" (action this.toggleShowing)}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

They also do not have equivalents in JavaScript directly, so they cannot be\nused for other situations where binding would be useful.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "action", + "static": 1, + "params": [ + { + "name": "callback", + "description": "The function to turn into an action,\n when used in classic classes", + "type": "Function|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/index.ts", + "line": 288, + "description": "

Specify a method that observes property changes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nimport { observer } from '@ember/object';\n\nexport default EmberObject.extend({\n  valueObserver: observer('value', function() {\n    // Executes whenever the "value" property changes\n  })\n});
\n
\n
\n \n

Also available as Function.prototype.observes if prototype extensions are\nenabled.

\n", + "itemtype": "method", + "name": "observer", + "params": [ + { + "name": "propertyNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "func" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/object", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/object/compat-bd64ed3f93.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/object/compat-bd64ed3f93.json new file mode 100644 index 000000000..0a86cd89e --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/object/compat-bd64ed3f93.json @@ -0,0 +1,64 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/object/compat", + "type": "class", + "attributes": { + "name": "@ember/object/compat", + "shortname": "@ember/object/compat", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/object/compat.ts", + "line": 40, + "description": "

@dependentKeyCompat is decorator that can be used on native getters that\nuse tracked properties. It exposes the getter to Ember's classic computed\nproperty and observer systems, so they can watch it for changes. It can be\nused in both native and classic classes.

\n

Native Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { computed, set } from '@ember/object';\n\nclass Person {\n  @tracked firstName;\n  @tracked lastName;\n\n  @dependentKeyCompat\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nclass Profile {\n  constructor(person) {\n    set(this, 'person', person);\n  }\n\n  @computed('person.fullName')\n  get helloMessage() {\n    return `Hello, ${this.person.fullName}!`;\n  }\n}
\n
\n
\n \n

Classic Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport EmberObject, { computed, observer, set } from '@ember/object';\n\nconst Person = EmberObject.extend({\n  firstName: tracked(),\n  lastName: tracked(),\n\n  fullName: dependentKeyCompat(function() {\n    return `${this.firstName} ${this.lastName}`;\n  }),\n});\n\nconst Profile = EmberObject.extend({\n  person: null,\n\n  helloMessage: computed('person.fullName', function() {\n    return `Hello, ${this.person.fullName}!`;\n  }),\n\n  onNameUpdated: observer('person.fullName', function() {\n    console.log('person name updated!');\n  }),\n});
\n
\n
\n \n

dependentKeyCompat() can receive a getter function or an object containing\nget/set methods when used in classic classes, like computed properties.

\n

In general, only properties which you expect to be watched by older,\nuntracked clases should be marked as dependency compatible. The decorator is\nmeant as an interop layer for parts of Ember's older classic APIs, and should\nnot be applied to every possible getter/setter in classes. The number of\ndependency compatible getters should be minimized wherever possible. New\napplication code should not need to use @dependentKeyCompat, since it is\nonly for interoperation with older code.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "dependentKeyCompat", + "static": 1, + "params": [ + { + "name": "desc", + "description": "A property descriptor containing\n the getter and setter (when used in\n classic classes)", + "type": "PropertyDescriptor|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object/compat", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/object/computed-4c06ab0354.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/object/computed-4c06ab0354.json new file mode 100644 index 000000000..72d8ec182 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/object/computed-4c06ab0354.json @@ -0,0 +1,903 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/object/computed", + "type": "class", + "attributes": { + "name": "@ember/object/computed", + "shortname": "@ember/object/computed", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/expand_properties.ts", + "line": 9, + "description": "

Expands pattern, invoking callback for each expansion.

\n

The only pattern supported is brace-expansion, anything else will be passed\nonce to callback directly.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { expandProperties } from '@ember/object/computed';\n\nfunction echo(arg){ console.log(arg); }\n\nexpandProperties('foo.bar', echo);              //=> 'foo.bar'\nexpandProperties('{foo,bar}', echo);            //=> 'foo', 'bar'\nexpandProperties('foo.{bar,baz}', echo);        //=> 'foo.bar', 'foo.baz'\nexpandProperties('{foo,bar}.baz', echo);        //=> 'foo.baz', 'bar.baz'\nexpandProperties('foo.{bar,baz}.[]', echo)      //=> 'foo.bar.[]', 'foo.baz.[]'\nexpandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs'\nexpandProperties('{foo}.bar.{baz}')             //=> 'foo.bar.baz'
\n
\n
\n \n", + "itemtype": "method", + "name": "expandProperties", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "pattern", + "description": "The property pattern to expand.", + "type": "String" + }, + { + "name": "callback", + "description": "The callback to invoke. It is invoked once per\nexpansion, and is passed the expansion.", + "type": "Function" + } + ], + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 60, + "description": "

A computed property macro that returns true if the value of the dependent\nproperty is null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { empty } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  @empty('todos') isDone;\n}\n\nlet todoList = new ToDoList(\n  ['Unit Test', 'Documentation', 'Release']\n);\n\ntodoList.isDone; // false\nset(todoList, 'todos', []);\ntodoList.isDone; // true
\n
\n
\n \n", + "since": "1.6.0", + "itemtype": "method", + "name": "empty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if the value\nof the dependent property is null, an empty string, empty array, or empty\nfunction and false if the underlying value is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 109, + "description": "

A computed property that returns true if the value of the dependent property\nis NOT null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { notEmpty } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(backpack) {\n    set(this, 'backpack', backpack);\n  }\n\n  @notEmpty('backpack') hasStuff\n}\n\nlet hamster = new Hamster(\n  ['Food', 'Sleeping Bag', 'Tent']\n);\n\nhamster.hasStuff; // true\nset(hamster, 'backpack', []);\nhamster.hasStuff; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "notEmpty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 155, + "description": "

A computed property that returns true if the value of the dependent property\nis null or undefined. This avoids errors from JSLint complaining about use of\n==, which can be technically confusing.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { none } from '@ember/object/computed';\n\nclass Hamster {\n  @none('food') isHungry;\n}\n\nlet hamster = new Hamster();\n\nhamster.isHungry; // true\n\nset(hamster, 'food', 'Banana');\nhamster.isHungry; // false\n\nset(hamster, 'food', null);\nhamster.isHungry; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "none", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is null or undefined.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 198, + "description": "

A computed property that returns the inverse boolean value of the original\nvalue for the dependent property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { not } from '@ember/object/computed';\n\nclass User {\n  loggedIn = false;\n\n  @not('loggedIn') isAnonymous;\n}\n\nlet user = new User();\n\nuser.isAnonymous; // true\nset(user, 'loggedIn', true);\nuser.isAnonymous; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "not", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns inverse of the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 240, + "description": "

A computed property that converts the provided dependent property into a\nboolean value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { bool } from '@ember/object/computed';\n\n\nclass Hamster {\n  @bool('numBananas') hasBananas\n}\n\nlet hamster = new Hamster();\n\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 0);\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 1);\nhamster.hasBananas; // true\n\nset(hamster, 'numBananas', null);\nhamster.hasBananas; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "bool", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which converts to boolean the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 288, + "description": "

A computed property which matches the original value for the dependent\nproperty against a given RegExp, returning true if the value matches the\nRegExp and false if it does not.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { match } from '@ember/object/computed';\n\nclass User {\n  @match('email', /^.+@.+\\..+$/) hasValidEmail;\n}\n\nlet user = new User();\n\nuser.hasValidEmail; // false\n\nset(user, 'email', '');\nuser.hasValidEmail; // false\n\nset(user, 'email', 'ember_hamster@example.com');\nuser.hasValidEmail; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "match", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "regexp", + "description": "", + "type": "RegExp" + } + ], + "return": { + "description": "computed property which match the original value\nfor property against a given RegExp", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 335, + "description": "

A computed property that returns true if the provided dependent property is\nequal to the given value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { equal } from '@ember/object/computed';\n\nclass Hamster {\n  @equal('percentCarrotsEaten', 100) satisfied;\n}\n\nlet hamster = new Hamster();\n\nhamster.satisfied; // false\n\nset(hamster, 'percentCarrotsEaten', 100);\nhamster.satisfied; // true\n\nset(hamster, 'percentCarrotsEaten', 50);\nhamster.satisfied; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "equal", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "String|Number|Object" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is equal to the given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 380, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gt } from '@ember/object/computed';\n\nclass Hamster {\n  @gt('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 11);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 425, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gte } from '@ember/object/computed';\n\nclass Hamster {\n  @gte('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 10);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater or equal then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 470, + "description": "

A computed property that returns true if the provided dependent property is\nless than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lt } from '@ember/object/computed';\n\nclass Hamster {\n  @lt('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 2);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 515, + "description": "

A computed property that returns true if the provided dependent property is\nless than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lte } from '@ember/object/computed';\n\nclass Hamster {\n  @lte('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 5);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less or equal than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 560, + "description": "

A computed property that performs a logical and on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first falsy value or last\ntruthy value just like JavaScript's && operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { and } from '@ember/object/computed';\n\nclass Hamster {\n  @and('hasTent', 'hasBackpack') readyForCamp;\n  @and('hasWalkingStick', 'hasBackpack') readyForHike;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForCamp; // false\n\nset(tomster, 'hasTent', true);\ntomster.readyForCamp; // false\n\nset(tomster, 'hasBackpack', true);\ntomster.readyForCamp; // true\n\nset(tomster, 'hasBackpack', 'Yes');\ntomster.readyForCamp; // 'Yes'\n\nset(tomster, 'hasWalkingStick', null);\ntomster.readyForHike; // null
\n
\n
\n \n", + "itemtype": "method", + "name": "and", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `and` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 606, + "description": "

A computed property which performs a logical or on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first truthy value or last\nfalsy value just like JavaScript's || operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { or } from '@ember/object/computed';\n\nclass Hamster {\n  @or('hasJacket', 'hasUmbrella') readyForRain;\n  @or('hasSunscreen', 'hasUmbrella') readyForBeach;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForRain; // undefined\n\nset(tomster, 'hasUmbrella', true);\ntomster.readyForRain; // true\n\nset(tomster, 'hasJacket', 'Yes');\ntomster.readyForRain; // 'Yes'\n\nset(tomster, 'hasSunscreen', 'Check');\ntomster.readyForBeach; // 'Check'
\n
\n
\n \n", + "itemtype": "method", + "name": "or", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `or` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 649, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { alias } from '@ember/object/computed';\n\nclass Person {\n  name = 'Alex Matchneer';\n\n  @alias('name') nomen;\n}\n\nlet alex = new Person();\n\nalex.nomen; // 'Alex Matchneer'\nalex.name;  // 'Alex Matchneer'\n\nset(alex, 'nomen', '@machty');\nalex.name;  // '@machty'
\n
\n
\n \n", + "itemtype": "method", + "name": "alias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates an alias to the\noriginal value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 684, + "description": "

Where the alias computed macro aliases get and set, and allows for\nbidirectional data flow, the oneWay computed macro only provides an aliased\nget. The set will not mutate the upstream property, rather causes the\ncurrent property to become the value set. This causes the downstream property\nto permanently diverge from the upstream property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { oneWay }from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @oneWay('firstName') nickName;\n}\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear');\nteddy.firstName; // 'Teddy'\nteddy.nickName; // 'TeddyBear'
\n
\n
\n \n", + "itemtype": "method", + "name": "oneWay", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 732, + "description": "

This is a more semantically meaningful alias of the oneWay computed macro,\nwhose name is somewhat ambiguous as to which direction the data flows.

\n", + "itemtype": "method", + "name": "reads", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\n property to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 745, + "description": "

Where oneWay computed macro provides oneWay bindings, the readOnly\ncomputed macro provides a readOnly one way binding. Very often when using\nthe oneWay macro one does not also want changes to propagate back up, as\nthey will replace the value.

\n

This prevents the reverse flow, and also throws an exception when it occurs.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { readOnly } from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @readOnly('firstName') nickName;\n});\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear'); // throws Exception\n// throw new EmberError('Cannot Set: nickName on: <User:ember27288>' );`\n\nteddy.firstName; // 'Teddy'
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 796, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property, but also print a deprecation warning.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { set } from '@ember/object';\nimport { deprecatingAlias } from '@ember/object/computed';\n\nclass Hamster {\n  @deprecatingAlias('cavendishCount', {\n    id: 'hamster.deprecate-banana',\n    until: '3.0.0'\n  })\n  bananaCount;\n}\n\nlet hamster = new Hamster();\n\nset(hamster, 'bananaCount', 5); // Prints a deprecation warning.\nhamster.cavendishCount; // 5
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecatingAlias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "Options for `deprecate`.", + "type": "Object" + } + ], + "return": { + "description": "computed property which creates an alias with a\ndeprecation to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 76, + "description": "

A computed property that returns the sum of the values in the dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { sum } from '@ember/object/computed';\n\nclass Invoice {\n  lineItems = [1.00, 2.50, 9.99];\n\n  @sum('lineItems') total;\n}\n\nlet invoice = new Invoice();\n\ninvoice.total; // 13.49
\n
\n
\n \n", + "itemtype": "method", + "name": "sum", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the sum of all values in the\ndependentKey's array", + "type": "ComputedProperty" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 113, + "description": "

A computed property that calculates the maximum value in the dependent array.\nThis will return -Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, max } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @max('childAges') maxChildAge;\n}\n\nlet lordByron = new Person();\n\nlordByron.maxChildAge; // -Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.maxChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.maxChildAge; // 8
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe max of a list of Date objects will be the highest timestamp as a Number.\nThis behavior is consistent with Math.max.

\n", + "itemtype": "method", + "name": "max", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the largest value in the dependentKey's\narray", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 177, + "description": "

A computed property that calculates the minimum value in the dependent array.\nThis will return Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, min } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @min('childAges') minChildAge;\n}\n\nlet lordByron = Person.create({ children: [] });\n\nlordByron.minChildAge; // Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.minChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.minChildAge; // 5
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe min of a list of Date objects will be the lowest timestamp as a Number.\nThis behavior is consistent with Math.min.

\n", + "itemtype": "method", + "name": "min", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the smallest value in the dependentKey's array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 240, + "description": "

Returns an array mapped via the callback

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function mapCallback(item, index);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', function(chore, index) {\n    return `${chore.toUpperCase()}!`;\n  })\n  excitingChores;\n});\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n

You can optionally pass an array of additional dependent keys as the second\nparameter to the macro, if your map function relies on any external values:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  shouldUpperCase = false;\n\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', ['shouldUpperCase'], function(chore, index) {\n    if (this.shouldUpperCase) {\n      return `${chore.toUpperCase()}!`;\n    } else {\n      return `${chore}!`;\n    }\n  })\n  excitingChores;\n}\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['clean!', 'write more unit tests!']\n\nset(hamster, 'shouldUpperCase', true);\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional\ndependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "an array mapped via the callback", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 364, + "description": "

Returns an array mapped to the specified key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import { set } from '@ember/object';\nimport { mapBy } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n}\n\nlet lordByron = new Person();\n\nlordByron.childAges; // []\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.childAges; // [7]\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.childAges; // [7, 5, 8]
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "an array mapped to the specified key", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 431, + "description": "

Filters the array by the callback.

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
  • array is the dependant array itself.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function filterCallback(item, index, array);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = Hamster.create([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]
\n
\n
\n \n

You can also use @each.property in your dependent key, the callback will\nstill use the underlying array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores.@each.done', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n\nset(hamster.chores[2], 'done', true);\nhamster.remainingChores; // []
\n
\n
\n \n

Finally, you can optionally pass an array of additional dependent keys as the\nsecond parameter to the macro, if your filter function relies on any external\nvalues:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  doneKey = 'finished';\n\n  @filter('chores', ['doneKey'], function(chore, index, array) {\n    return !chore[this.doneKey];\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', finished: true },\n  { name: 'clean', finished: true },\n  { name: 'write more unit tests', finished: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', finished: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional dependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 598, + "description": "

Filters the array by the property and value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { filterBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filterBy('chores', 'done', false) remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{ name: 'write more unit tests', done: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "*" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 654, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniq } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniq('fruits') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  'banana',\n  'grape',\n  'kale',\n  'banana'\n]);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale']
\n
\n
\n \n", + "itemtype": "method", + "name": "uniq", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 725, + "description": "

A computed property which returns a new array with all the unique elements\nfrom an array, with uniqueness determined by specific key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniqBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniqBy('fruits', 'id') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  { id: 1, 'banana' },\n  { id: 2, 'grape' },\n  { id: 3, 'peach' },\n  { id: 1, 'banana' }\n]);\n\nhamster.uniqueFruits; // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 779, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { union } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits, vegetables) {\n    set(this, 'fruits', fruits);\n    set(this, 'vegetables', vegetables);\n  }\n\n  @union('fruits', 'vegetables') uniqueFruits;\n});\n\nlet hamster = new, Hamster(\n  [\n    'banana',\n    'grape',\n    'kale',\n    'banana',\n    'tomato'\n  ],\n  [\n    'tomato',\n    'carrot',\n    'lettuce'\n  ]\n);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale', 'tomato', 'carrot', 'lettuce']
\n
\n
\n \n", + "itemtype": "method", + "name": "union", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the unique elements\nfrom one or more dependent arrays.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 826, + "description": "

A computed property which returns a new array with all the elements\ntwo or more dependent arrays have in common.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { intersect } from '@ember/object/computed';\n\nclass FriendGroups {\n  constructor(adaFriends, charlesFriends) {\n    set(this, 'adaFriends', adaFriends);\n    set(this, 'charlesFriends', charlesFriends);\n  }\n\n  @intersect('adaFriends', 'charlesFriends') friendsInCommon;\n}\n\nlet groups = new FriendGroups(\n  ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n  ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock']\n);\n\ngroups.friendsInCommon; // ['William King', 'Mary Somerville']
\n
\n
\n \n", + "itemtype": "method", + "name": "intersect", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the duplicated\nelements from the dependent arrays", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 907, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array that are not in the second dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { setDiff } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(likes, fruits) {\n    set(this, 'likes', likes);\n    set(this, 'fruits', fruits);\n  }\n\n  @setDiff('likes', 'fruits') wants;\n}\n\nlet hamster = new Hamster(\n  [\n    'banana',\n    'grape',\n    'kale'\n  ],\n  [\n    'grape',\n    'kale',\n  ]\n);\n\nhamster.wants; // ['banana']
\n
\n
\n \n", + "itemtype": "method", + "name": "setDiff", + "static": 1, + "params": [ + { + "name": "setAProperty", + "description": "", + "type": "String" + }, + { + "name": "setBProperty", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the items from the\nfirst dependent array that are not in the second dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 977, + "description": "

A computed property that returns the array of values for the provided\ndependent properties.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { collect } from '@ember/object/computed';\n\nclass Hamster {\n  @collect('hat', 'shirt') clothes;\n}\n\nlet hamster = new Hamster();\n\nhamster.clothes; // [null, null]\n\nset(hamster, 'hat', 'Camp Hat');\nset(hamster, 'shirt', 'Camp Shirt');\nhamster.clothes; // ['Camp Hat', 'Camp Shirt']
\n
\n
\n \n", + "itemtype": "method", + "name": "collect", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which maps values of all passed\nin properties to an array.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 1032, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array sorted based on a property or sort function. The sort\nmacro can be used in two different ways:

\n
    \n
  1. By providing a sort callback function
  2. \n
  3. By providing an array of keys to sort the array
  4. \n
\n

In the first form, the callback method you provide should have the following\nsignature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function sortCallback(itemA, itemB);
\n
\n
\n \n
    \n
  • itemA the first item to compare.
  • \n
  • itemB the second item to compare.
  • \n
\n

This function should return negative number (e.g. -1) when itemA should\ncome before itemB. It should return positive number (e.g. 1) when itemA\nshould come after itemB. If the itemA and itemB are equal this function\nshould return 0.

\n

Therefore, if this function is comparing some numeric values, simple itemA - itemB or itemA.get( 'foo' ) - itemB.get( 'foo' ) can be used instead of\nseries of if.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', function(a, b){\n    if (a.priority > b.priority) {\n      return 1;\n    } else if (a.priority < b.priority) {\n      return -1;\n    }\n\n    return 0;\n  })\n  priorityTodos;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

You can also optionally pass an array of additional dependent keys as the\nsecond parameter, if your sort function is dependent on additional values that\ncould changes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n
import EmberObject, { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  sortKey = 'priority';\n\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', ['sortKey'], function(a, b){\n    if (a[this.sortKey] > b[this.sortKey]) {\n      return 1;\n    } else if (a[this.sortKey] < b[this.sortKey]) {\n      return -1;\n    }\n\n    return 0;\n  })\n  sortedTodos;\n});\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

In the second form, you should provide the key of the array of sort values as\nthe second parameter:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using standard ascending sort\n  todosSorting = ['name'];\n  @sort('todos', 'todosSorting') sortedTodos;\n\n  // using descending sort\n  todosSortingDesc = ['name:desc'];\n  @sort('todos', 'todosSortingDesc') sortedTodosDesc;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.sortedTodos; // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\ntodoList.sortedTodosDesc; // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n", + "itemtype": "method", + "name": "sort", + "static": 1, + "params": [ + { + "name": "itemsKey", + "description": "", + "type": "String" + }, + { + "name": "sortDefinitionOrDependentKeys", + "description": "The key of the sort definition (an array of sort properties),\nthe sort function, or an array of additional dependent keys", + "type": "String|Function|Array" + }, + { + "name": "sortDefinition", + "description": "the sort function (when used with additional dependent keys)", + "type": "Function?" + } + ], + "return": { + "description": "computes a new sorted array based on the sort\nproperty array or callback function", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/object/evented-9d12e3e0b3.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/object/evented-9d12e3e0b3.json new file mode 100644 index 000000000..791570a17 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/object/evented-9d12e3e0b3.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/object/evented", + "type": "class", + "attributes": { + "name": "@ember/object/evented", + "shortname": "@ember/object/evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 180, + "description": "

Define a property as a function that should be executed when\na specified event or events are triggered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\nimport { on } from '@ember/object/evented';\nimport { sendEvent } from '@ember/object/events';\n\nlet Job = EmberObject.extend({\n  logCompleted: on('completed', function() {\n    console.log('Job completed!');\n  })\n});\n\nlet job = Job.create();\n\nsendEvent(job, 'completed'); // Logs 'Job completed!'
\n
\n
\n \n", + "itemtype": "method", + "name": "on", + "static": 1, + "params": [ + { + "name": "eventNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the listener function, passed as last argument to on(...)", + "type": "Function" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/polyfills-343778b45f.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/polyfills-343778b45f.json new file mode 100644 index 000000000..c4789ecc5 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/polyfills-343778b45f.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/polyfills", + "type": "class", + "attributes": { + "name": "@ember/polyfills", + "shortname": "@ember/polyfills", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/polyfills", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/polyfills/lib/assign.ts", + "line": 11, + "description": "

Copy properties from a source object to a target object. Source arguments remain unchanged.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assign } from '@ember/polyfills';\n\nvar a = { first: 'Yehuda' };\nvar b = { last: 'Katz' };\nvar c = { company: 'Other Company' };\nvar d = { company: 'Tilde Inc.' };\nassign(a, b, c, d); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' };
\n
\n
\n \n", + "itemtype": "method", + "name": "assign", + "params": [ + { + "name": "target", + "description": "The object to assign into", + "type": "Object" + }, + { + "name": "args", + "description": "The objects to copy properties from", + "type": "Object", + "multiple": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/polyfills", + "module": "@ember/polyfills" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/polyfills", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/runloop-14243f212a.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/runloop-14243f212a.json new file mode 100644 index 000000000..1d458f612 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/runloop-14243f212a.json @@ -0,0 +1,497 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/runloop", + "type": "class", + "attributes": { + "name": "@ember/runloop", + "shortname": "@ember/runloop", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/runloop", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 105, + "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

Normally 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { run } from '@ember/runloop';\n\nrun(function() {\n  // code to be executed within a RunLoop\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "run", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "return value from invoking the passed function.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 150, + "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

Please note: This is not for normal usage, and should be used sparingly.

\n

If invoked when not within a run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { join } from '@ember/runloop';\n\njoin(function() {\n  // creates a new run-loop\n});
\n
\n
\n \n

Alternatively, if called within an existing run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "join", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Return value from invoking the passed function. Please note,\nwhen called within an existing loop, no return value is possible.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 209, + "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

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

Let'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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import 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
\n \n

In 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.

\n", + "itemtype": "method", + "name": "bind", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "returns a new function that will always have a particular context", + "type": "Function" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 323, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "begin", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 346, + "description": "

Ends a RunLoop. This must be called sometime after you call\nbegin() to flush any deferred actions. This is a lower-level way\nto use a RunLoop instead of using run().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "end", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 369, + "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

At 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "schedule", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'", + "type": "String" + }, + { + "name": "target", + "description": "target object to use as the context when invoking a method.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.", + "type": "String|Function" + }, + { + "name": "arguments*", + "description": "Optional arguments to be passed to the queued method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 442, + "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

You 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "later", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 490, + "description": "

Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling scheduleOnce with the "actions" queue.

\n", + "itemtype": "method", + "name": "once", + "static": 1, + "params": [ + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 521, + "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

Note that although you can pass optional arguments these will not be\nconsidered when looking for duplicates. New arguments will replace previous\ncalls.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Also note that for scheduleOnce to prevent additional calls, you need to\npass the same function instance. The following case works as expected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
function log() {\n  console.log('Logging only once');\n}\n\nfunction scheduleIt() {\n  scheduleOnce('actions', myContext, log);\n}\n\nscheduleIt();\nscheduleIt();
\n
\n
\n \n

But this other case will schedule the function multiple times:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { 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
\n \n

Available queues, and their order, can be found at queues

\n", + "itemtype": "method", + "name": "scheduleOnce", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'.", + "type": "String", + "optional": true + }, + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 615, + "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\nlater with a wait time of 1ms.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { 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
\n \n

Multiple 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

Note 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

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

One 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

The 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.

\n", + "itemtype": "method", + "name": "next", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 700, + "description": "

Cancels a scheduled item. Must be a value returned by later(),\nonce(), scheduleOnce(), next(), debounce(), or\nthrottle().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n
import {\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
\n
\n \n", + "itemtype": "method", + "name": "cancel", + "static": 1, + "params": [ + { + "name": "timer", + "description": "Timer object to cancel", + "type": "Object" + } + ], + "return": { + "description": "true if canceled or false/undefined if it wasn't found", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 771, + "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

This 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { 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
\n \n

Immediate allows you to run the function immediately, but debounce\nother calls for this function until the wait time has elapsed. If\ndebounce 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "debounce", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to false.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 868, + "description": "

Ensure that the target method is never called more frequently than\nthe specified spacing period. The target method is called immediately.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "throttle", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "spacing", + "description": "Number of milliseconds to space out requests.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to true.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 62, + "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.

\n", + "itemtype": "property", + "name": "queues", + "type": "Array", + "default": "['actions', 'destroy']", + "access": "private", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/routing/router" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/runloop", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/service-f7cfc906ac.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/service-f7cfc906ac.json new file mode 100644 index 000000000..2470d0926 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/service-f7cfc906ac.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/service", + "type": "class", + "attributes": { + "name": "@ember/service", + "shortname": "@ember/service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/service/index.ts", + "line": 10, + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + }, + { + "file": "packages/@ember/service/index.ts", + "line": 30, + "description": "

Creates a property that lazily looks up a service in the container. There are\nno restrictions as to what objects a service can be injected into.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service('auth') authManager;\n\n  model() {\n    return this.authManager.findCurrentUser();\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default Route.extend({\n  authManager: service('auth'),\n\n  model() {\n    return this.get('authManager').findCurrentUser();\n  }\n});
\n
\n
\n \n

This example will create an authManager property on the application route\nthat looks up the auth service in the container, making it easily accessible\nin the model hook.

\n", + "itemtype": "method", + "name": "service", + "static": 1, + "since": "4.1.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/template-2c1cd7b648.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/template-2c1cd7b648.json new file mode 100644 index 000000000..1976eb225 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/template-2c1cd7b648.json @@ -0,0 +1,100 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/template", + "type": "class", + "attributes": { + "name": "@ember/template", + "shortname": "@ember/template", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/template", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/utils/managers.ts", + "line": 9, + "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).

\n", + "itemtype": "method", + "name": "setComponentManager", + "params": [ + { + "name": "factory", + "description": "a function to create the owner for an object", + "type": "Function" + }, + { + "name": "obj", + "description": "the object to associate with the componetn manager", + "type": "Object" + } + ], + "return": { + "description": "the same object passed in", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 61, + "description": "

Use this method to indicate that a string should be rendered as HTML\nwhen the string is used in a template. To say this another way,\nstrings marked with htmlSafe will not be HTML escaped.

\n

A word of warning - The htmlSafe method does not make the string safe;\nit only tells the framework to treat the string as if it is safe to render\nas HTML. If a string contains user inputs or other untrusted\ndata, you must sanitize the string before using the htmlSafe method.\nOtherwise your code is vulnerable to\nCross-Site Scripting.\nThere are many open source sanitization libraries to choose from,\nboth for front end and server-side sanitization.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { htmlSafe } from '@ember/template';\n\nconst someTrustedOrSanitizedString = "<div>Hello!</div>"\n\nhtmlSafe(someTrustedorSanitizedString)
\n
\n
\n \n", + "itemtype": "method", + "name": "htmlSafe", + "static": 1, + "return": { + "description": "A string that will not be HTML escaped by Handlebars.", + "type": "SafeString" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 98, + "description": "

Detects if a string was decorated using htmlSafe.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { htmlSafe, isHTMLSafe } from '@ember/template';\n\nvar plainString = 'plain string',\n    safeString = htmlSafe('<div>someValue</div>');\n\nisHTMLSafe(plainString); // false\nisHTMLSafe(safeString);  // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isHTMLSafe", + "static": 1, + "return": { + "description": "`true` if the string was decorated with `htmlSafe`, `false` otherwise.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/template", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/test-60244a0695.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/test-60244a0695.json new file mode 100644 index 000000000..9f85b0d63 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/test-60244a0695.json @@ -0,0 +1,395 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/test", + "type": "class", + "attributes": { + "name": "@ember/test", + "shortname": "@ember/test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/test", + "namespace": "", + "methods": [ + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 64, + "description": "

This hook defers the readiness of the application, so that you can start\nthe app when your tests are ready to run. It also sets the router's\nlocation to 'none', so that the window's location will not be modified\n(preventing both accidental leaking of state between tests and interference\nwith your testing framework). setupForTesting should only be called after\nsetting a custom router class (for example App.Router = Router.extend().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.setupForTesting();
\n
\n
\n \n", + "itemtype": "method", + "name": "setupForTesting", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 103, + "description": "

This injects the test helpers into the helperContainer object. If an object is provided\nit will be used as the helperContainer. If helperContainer is not set it will default\nto window. If a function of the same name has already been defined it will be cached\n(so that it can be reset if the helper is removed with unregisterHelper or\nremoveTestHelpers).

\n

Any callbacks registered with onInjectHelpers will be called once the\nhelpers have been injected.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.injectTestHelpers();
\n
\n
\n \n", + "itemtype": "method", + "name": "injectTestHelpers", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 148, + "description": "

This removes all helpers that have been registered, and resets and functions\nthat were overridden by the helpers.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.removeTestHelpers();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "removeTestHelpers", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/helpers/current_path.ts", + "line": 9, + "description": "

Returns the current path.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentPath(), 'some.path.index', "correct path was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentPath", + "return": { + "description": "The currently active path.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_route_name.ts", + "line": 8, + "description": "

Returns the currently active route name.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
function validateRouteName() {\nequal(currentRouteName(), 'some.path', "correct route was transitioned into.");\n}\nvisit('/some/path').then(validateRouteName)
\n
\n
\n \n", + "itemtype": "method", + "name": "currentRouteName", + "return": { + "description": "The name of the currently active route.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_url.ts", + "line": 9, + "description": "

Returns the current URL.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentURL(), '/some/path', "correct URL was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentURL", + "return": { + "description": "The currently active URL.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.ts", + "line": 9, + "description": "

Resumes a test paused by pauseTest.

\n", + "itemtype": "method", + "name": "resumeTest", + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.ts", + "line": 22, + "description": "

Pauses the current test - this is useful for debugging while testing or for test-driving.\nIt allows you to inspect the state of your application at any point.\nExample (The test will pause before clicking the button):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('/')\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

You may want to turn off the timeout before pausing.

\n

qunit (timeout available to use as of 2.4.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nassert.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

mocha (timeout happens automatically as of ember-mocha v0.14.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nthis.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n", + "since": "1.9.0", + "itemtype": "method", + "name": "pauseTest", + "return": { + "description": "A promise that will never resolve", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/visit.ts", + "line": 6, + "description": "

Loads a route, sets up any controllers, and renders any templates associated\nwith the route as though a real user had triggered the route change while\nusing your app.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('posts/index').then(function() {\n  // assert something\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/wait.ts", + "line": 12, + "description": "

Causes the run loop to process any pending events. This is used to ensure that\nany async operations from other helpers (or your assertions) have been processed.

\n

This is most often used as the return value for the helper functions (see 'click',\n'fillIn','visit',etc). However, there is a method to register a test helper which\nutilizes this method without the need to actually call wait() in your helpers.

\n

The wait helper is built into registerAsyncHelper by default. You will not need\nto return app.testHelpers.wait(); - the wait behavior is provided for you.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('loginUser', function(app, username, password) {\n  visit('secured/path/here')\n    .fillIn('#username', username)\n    .fillIn('#password', password)\n    .click('.submit');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "wait", + "params": [ + { + "name": "value", + "description": "The value to be returned.", + "type": "Object" + } + ], + "return": { + "description": "Promise that resolves to the passed value.", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 15, + "description": "

registerHelper is used to register a test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

This helper can later be called without arguments because it will be\ncalled with app as the first parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nApp = Application.create();\nApp.injectTestHelpers();\nboot();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 59, + "description": "

registerAsyncHelper is used to register an async test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerAsyncHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterAsyncHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

The advantage of an async helper is that it will not run\nuntil the last async helper has completed. All async helpers\nafter it will wait for it complete before running.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('deletePost', function(app, postId) {\n  click('.delete-' + postId);\n});\n\n// ... in your test\nvisit('/post/2');\ndeletePost(2);\nvisit('/post/3');\ndeletePost(3);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerAsyncHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 112, + "description": "

Remove a previously added helper method.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { unregisterHelper } from '@ember/test';\n\nunregisterHelper('wait');
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregisterHelper", + "static": 1, + "params": [ + { + "name": "name", + "description": "The helper to remove.", + "type": "String" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 7, + "description": "

This allows ember-testing to play nicely with other asynchronous\nevents, such as an application that is waiting for a CSS3\ntransition or an IndexDB transaction. The waiter runs periodically\nafter each async helper (i.e. click, andThen, visit, etc) has executed,\nuntil the returning result is truthy. After the waiters finish, the next async helper\nis executed and the process repeats.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(function() {\n  return myPendingTransactions() === 0;\n});
\n
\n
\n \n

The context argument allows you to optionally specify the this\nwith which your callback will be invoked.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(MyDB, MyDB.hasPendingTransactions);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 66, + "description": "

unregisterWaiter is used to unregister a callback that was\nregistered with registerWaiter.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "unregisterWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 94, + "description": "

Iterates through each registered test waiter, and invokes\nits callback. If any waiter returns false, this method will return\ntrue indicating that the waiters have not settled yet.

\n

This is generally used internally from the acceptance/integration test\ninfrastructure.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "checkWaiters", + "class": "@ember/test", + "module": "@ember/test" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 23, + "description": "

This property contains the testing helpers for the current application. These\nare created once you call injectTestHelpers on your Application\ninstance. The included helpers are also available on the window object by\ndefault, but can be used from this object on the individual application also.

\n", + "itemtype": "property", + "name": "testHelpers", + "type": "{Object}", + "default": "{}", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 36, + "description": "

This property will contain the original methods that were registered\non the helperContainer before injectTestHelpers is called.

\n

When removeTestHelpers is called, these methods are restored to the\nhelperContainer.

\n", + "itemtype": "property", + "name": "originalMethods", + "type": "{Object}", + "default": "{}", + "access": "private", + "tagname": "", + "since": "1.3.0", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 51, + "description": "

This property indicates whether or not this application is currently in\ntesting mode. This is set when setupForTesting is called on the current\napplication.

\n", + "itemtype": "property", + "name": "testing", + "type": "{Boolean}", + "default": "false", + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 91, + "description": "

This will be used as the container to inject the test helpers into. By\ndefault the helpers are injected into window.

\n", + "itemtype": "property", + "name": "helperContainer", + "type": "{Object} The object to be used for test helpers.", + "default": "window", + "since": "1.2.0", + "access": "private", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/test", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/utils-528db04803.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/utils-528db04803.json new file mode 100644 index 000000000..b809edb24 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@ember/utils-528db04803.json @@ -0,0 +1,213 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/utils", + "type": "class", + "attributes": { + "name": "@ember/utils", + "shortname": "@ember/utils", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/utils", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/utils/lib/compare.ts", + "line": 53, + "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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { compare } from '@ember/utils';\n\ncompare('hello', 'hello');  // 0\ncompare('abc', 'dfg');      // -1\ncompare(2, 1);              // 1
\n
\n
\n \n

If 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
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { compare } from '@ember/utils';\n\ncompare('hello', 50);       // 1\ncompare(50, 'hello');       // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "compare", + "static": 1, + "params": [ + { + "name": "v", + "description": "First value to compare", + "type": "Object" + }, + { + "name": "w", + "description": "Second value to compare", + "type": "Object" + } + ], + "return": { + "description": "-1 if v < w, 0 if v = w and 1 if v > w.", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is-equal.ts", + "line": 4, + "description": "

Compares two objects, returning true if they are equal.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { isEqual } from '@ember/utils';\n\nisEqual('hello', 'hello');                   // true\nisEqual(1, 2);                               // false
\n
\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { 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
\n \n

Due 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { isEqual } from '@ember/utils';\n\nisEqual([4, 2], [4, 2]);                     // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEqual", + "static": 1, + "params": [ + { + "name": "a", + "description": "first object to compare", + "type": "Object" + }, + { + "name": "b", + "description": "second object to compare", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_blank.ts", + "line": 5, + "description": "

A value is blank if it is empty or a whitespace string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "isBlank", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_empty.ts", + "line": 6, + "description": "

Verifies that a value is null or undefined, an empty string, or an empty\narray.

\n

Constrains the rules on isNone by returning true for empty strings and\nempty arrays.

\n

If the value is an object with a size property of type number, it is used\nto check emptiness.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
isEmpty(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
\n
\n \n", + "itemtype": "method", + "name": "isEmpty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_none.ts", + "line": 4, + "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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
isNone(null);          // true\nisNone(undefined);     // true\nisNone('');            // false\nisNone([]);            // false\nisNone(function() {}); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isNone", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_present.ts", + "line": 5, + "description": "

A value is present if it not isBlank.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
isPresent(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
\n
\n \n", + "itemtype": "method", + "name": "isPresent", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.8.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/type-of.ts", + "line": 40, + "description": "

Returns a consistent type for the passed object.

\n

Use 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\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
\n
\n \n

Examples:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { 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
\n
\n \n", + "itemtype": "method", + "name": "typeOf", + "params": [ + { + "name": "item", + "description": "the item to check" + } + ], + "return": { + "description": "the type", + "type": "String" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/utils", + "module": "@ember/utils" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/utils", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@glimmer/tracking-5342e8d52f.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@glimmer/tracking-5342e8d52f.json new file mode 100644 index 000000000..aa5cf21dd --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@glimmer/tracking-5342e8d52f.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.9.3-@glimmer/tracking", + "type": "class", + "attributes": { + "name": "@glimmer/tracking", + "shortname": "@glimmer/tracking", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 22, + "description": "

Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are static, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>Count: {{this.count}}</div>\n<div>Times Ten: {{this.timesTen}}</div>\n<div>\n  <button {{on "click" this.plusOne}}>\n    Plus One\n  </button>\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class CounterComponent extends Component {\n  @tracked count = 0;\n\n  get timesTen() {\n    return this.count * 10;\n  }\n\n  @action\n  plusOne() {\n    this.count += 1;\n  }\n}
\n
\n
\n \n

Both the {{this.count}} and the {{this.timesTen}} properties in the\ntemplate will update whenever the button is clicked. Any tracked properties\nthat are used in any way to calculate a value that is used in the template\nwill cause a rerender when updated - this includes through method calls and\nother means:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nclass Entry {\n  @tracked name;\n  @tracked phoneNumber;\n\n  constructor(name, phoneNumber) {\n    this.name = name;\n    this.phoneNumber = phoneNumber;\n  }\n}\n\nexport default class PhoneBookComponent extends Component {\n  entries = [\n    new Entry('Pizza Palace', 5551234),\n    new Entry('1st Street Cleaners', 5554321),\n    new Entry('Plants R Us', 5552468),\n  ];\n\n  // Any usage of this property will update whenever any of the names in the\n  // entries arrays are updated\n  get names() {\n    return this.entries.map(e => e.name);\n  }\n\n  // Any usage of this property will update whenever any of the numbers in the\n  // entries arrays are updated\n  get numbers() {\n    return this.getFormattedNumbers();\n  }\n\n  getFormattedNumbers() {\n    return this.entries\n      .map(e => e.phoneNumber)\n      .map(number => {\n        let numberString = '' + number;\n\n        return numberString.slice(0, 3) + '-' + numberString.slice(3);\n      });\n  }\n}
\n
\n
\n \n

It's important to note that setting tracked properties will always trigger an\nupdate, even if the property is set to the same value as it was before.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let entry = new Entry('Pizza Palace', 5551234);\n\n// if entry was used when rendering, this would cause a rerender, even though\n// the name is being set to the same value as it was before\nentry.name = entry.name;
\n
\n
\n \n

tracked can also be used with the classic Ember object model in a similar\nmanner to classic computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked(),\n  phoneNumber: tracked()\n});
\n
\n
\n \n

Often this is unnecessary, but to ensure robust auto-tracking behavior it is\nadvisable to mark tracked state appropriately wherever possible.

\n

This form of tracked also accepts an optional configuration object\ncontaining either an initial value or an initializer function (but not\nboth).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked({ value: 'Zoey' }),\n  favoriteSongs: tracked({\n    initializer: () => ['Raspberry Beret', 'Time After Time']\n  })\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "tracked", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 158, + "description": "

Gives the getter a caching behavior. The return value of the getter\nwill be cached until any of the properties it is entangled with\nare invalidated. This is useful when a getter is expensive and\nused very often.

\n

For instance, in this GuestList class, we have the sortedGuests\ngetter that sorts the guests alphabetically:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
  import { tracked } from '@glimmer/tracking';\n\n  class GuestList {\n    @tracked guests = ['Zoey', 'Tomster'];\n\n    get sortedGuests() {\n      return this.guests.slice().sort()\n    }\n  }
\n
\n
\n \n

Every time sortedGuests is accessed, a new array will be created and sorted,\nbecause JavaScript getters do not cache by default. When the guest list\nis small, like the one in the example, this is not a problem. However, if\nthe guest list were to grow very large, it would mean that we would be doing\na large amount of work each time we accessed sortedGuests. With @cached,\nwe can cache the value instead:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
  import { tracked, cached } from '@glimmer/tracking';\n\n  class GuestList {\n    @tracked guests = ['Zoey', 'Tomster'];\n\n    @cached\n    get sortedGuests() {\n      return this.guests.slice().sort()\n    }\n  }
\n
\n
\n \n

Now the sortedGuests getter will be cached based on autotracking.\nIt will only rerun and create a new sorted array when the guests tracked\nproperty is updated.

\n

Tradeoffs

\n

Overuse is discouraged.

\n

In general, you should avoid using @cached unless you have confirmed that\nthe getter you are decorating is computationally expensive, since @cached\nadds a small amount of overhead to the getter.\nWhile the individual costs are small, a systematic use of the @cached\ndecorator can add up to a large impact overall in your app.\nMany getters and tracked properties are only accessed once during rendering,\nand then never rerendered, so adding @cached when unnecessary can\nnegatively impact performance.

\n

Also, @cached may rerun even if the values themselves have not changed,\nsince tracked properties will always invalidate.\nFor example updating an integer value from 5 to an other 5 will trigger\na rerun of the cached properties building from this integer.

\n

Avoiding a cache invalidation in this case is not something that can\nbe achieved on the @cached decorator itself, but rather when updating\nthe underlying tracked values, by applying some diff checking mechanisms:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
if (nextValue !== this.trackedProp) {\n  this.trackedProp = nextValue;\n}
\n
\n
\n \n

Here equal values won't update the property, therefore not triggering\nthe subsequent cache invalidations of the @cached properties who were\nusing this trackedProp.

\n

As a reminder, do not use this piece of code inside a tracked getter,\nas the dependency chain could lead to an infinite loop. Mutating an adjacent\nproperty from a getter is not a good practice anyway, even with a caching\nmechanism reducing reruns.

\n

The cost of these edge-guards adds up to the trade-off calculation of using\na caching strategy, hence requiring a very sensitive and moderate approach\nregarding performance.

\n", + "itemtype": "method", + "name": "cached", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@glimmer/tracking", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-@glimmer/tracking/primitives/cache-0d4b890b27.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-@glimmer/tracking/primitives/cache-0d4b890b27.json new file mode 100644 index 000000000..9e3ba4c94 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-@glimmer/tracking/primitives/cache-0d4b890b27.json @@ -0,0 +1,77 @@ +{ + "data": { + "id": "ember-4.9.3-@glimmer/tracking/primitives/cache", + "type": "class", + "attributes": { + "name": "@glimmer/tracking/primitives/cache", + "shortname": "@glimmer/tracking/primitives/cache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking/primitives/cache", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 14, + "description": "

Receives a function, and returns a wrapped version of it that memoizes based on\nautotracking. The function will only rerun whenever any tracked values used\nwithin it have changed. Otherwise, it will return the previous value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state. Now, `counter` will\n  // only rerun if `state.value` changes.\n  state.value;\n\n  return ++computeCount;\n});\n\ngetValue(counter); // 1\n\n// returns the same value because no tracked state has changed\ngetValue(counter); // 1\n\nstate.value = 'foo';\n\n// reruns because a tracked value used in the function has changed,\n// incermenting the counter\ngetValue(counter); // 2
\n
\n
\n \n", + "itemtype": "method", + "name": "createCache", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 56, + "description": "

Gets the value of a cache created with createCache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  return ++computeCount;\n});\n\ngetValue(counter); // 1
\n
\n
\n \n", + "itemtype": "method", + "name": "getValue", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 78, + "description": "

Can be used to check if a memoized function is constant. If no tracked state\nwas used while running a memoized function, it will never rerun, because nothing\ncan invalidate its result. isConst can be used to determine if a memoized\nfunction is constant or not, in order to optimize code surrounding that\nfunction.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue, isConst } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state\n  state.value;\n\n  return computeCount++;\n});\n\nlet constCounter = createCache(() => {\n  return computeCount++;\n});\n\ngetValue(counter);\ngetValue(constCounter);\n\nisConst(counter); // false\nisConst(constCounter); // true
\n
\n
\n \n

If called on a cache that hasn't been accessed yet, it will throw an\nerror. This is because there's no way to know if the function will be constant\nor not yet, and so this helps prevent missing an optimization opportunity on\naccident.

\n", + "itemtype": "method", + "name": "isConst", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@glimmer/tracking/primitives/cache", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Application-43aed54654.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Application-43aed54654.json new file mode 100644 index 000000000..d6f2ae1a4 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Application-43aed54654.json @@ -0,0 +1,799 @@ +{ + "data": { + "id": "ember-4.9.3-Application", + "type": "class", + "attributes": { + "name": "Application", + "shortname": "Application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/index.ts", + "line": 33, + "description": "

An instance of Application is the starting point for every Ember\napplication. It instantiates, initializes and coordinates the\nobjects that make up your app.

\n

Each Ember app has one and only one Application object. Although\nEmber CLI creates this object implicitly, the Application class\nis defined in the app/app.js. You can define a ready method on the\nApplication class, which will be run by Ember when the application is\ninitialized.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
export default class App extends Application {\n  ready() {\n    // your code here\n  }\n}
\n
\n
\n \n

Because Application ultimately inherits from Ember.Namespace, any classes\nyou create will have useful string representations when calling toString().\nSee the Ember.Namespace documentation for more information.

\n

While you can think of your Application as a container that holds the\nother classes in your application, there are several other responsibilities\ngoing on under-the-hood that you may want to understand. It is also important\nto understand that an Application is different from an ApplicationInstance.\nRefer to the Guides to understand the difference between these.

\n

Event Delegation

\n

Ember uses a technique called event delegation. This allows the framework\nto set up a global, shared event listener instead of requiring each view to\ndo it manually. For example, instead of each view registering its own\nmousedown listener on its associated element, Ember sets up a mousedown\nlistener on the body.

\n

If a mousedown event occurs, Ember will look at the target of the event and\nstart walking up the DOM node tree, finding corresponding views and invoking\ntheir mouseDown method as it goes.

\n

Application has a number of default events that it listens for, as\nwell as a mapping from lowercase events to camel-cased view method names. For\nexample, the keypress event causes the keyPress method on the view to be\ncalled, the dblclick event causes doubleClick to be called, and so on.

\n

If there is a bubbling browser event that Ember does not listen for by\ndefault, you can specify custom events and their corresponding view method\nnames by setting the application's customEvents property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nexport default class App extends Application {\n  customEvents = {\n    // add support for the paste event\n    paste: 'paste'\n  }\n}
\n
\n
\n \n

To prevent Ember from setting up a listener for a default event,\nspecify the event name with a null value in the customEvents\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nexport default class App extends Application {\n  customEvents = {\n    // prevent listeners for mouseenter/mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n}
\n
\n
\n \n

By default, the application sets up these event listeners on the document\nbody. However, in cases where you are embedding an Ember application inside\nan existing page, you may want it to set up the listeners on an element\ninside the body.

\n

For example, if only events inside a DOM element with the ID of ember-app\nshould be delegated, set your application's rootElement property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nexport default class App extends Application {\n  rootElement = '#ember-app'\n}
\n
\n
\n \n

The rootElement can be either a DOM element or a CSS selector\nstring. Note that views appended to the DOM outside the root element will\nnot receive events. If you specify a custom root element, make sure you only\nappend views inside it!

\n

To learn more about the events Ember components use, see

\n

components/handling-events.

\n

Initializers

\n

To add behavior to the Application's boot process, you can define initializers in\nthe app/initializers directory, or with ember generate initializer using Ember CLI.\nThese files should export a named initialize function which will receive the created application\nobject as its first argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
export function initialize(application) {\n  // application.inject('route', 'foo', 'service:foo');\n}
\n
\n
\n \n

Application initializers can be used for a variety of reasons including:

\n
    \n
  • setting up external libraries
  • \n
  • injecting dependencies
  • \n
  • setting up event listeners in embedded apps
  • \n
  • deferring the boot process using the deferReadiness and advanceReadiness APIs.
  • \n
\n

Routing

\n

In addition to creating your application's router, Application is\nalso responsible for telling the router when to start routing. Transitions\nbetween routes can be logged with the LOG_TRANSITIONS flag, and more\ndetailed intra-transition logging can be logged with\nthe LOG_TRANSITIONS_INTERNAL flag:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  LOG_TRANSITIONS: true, // basic logging of successful transitions\n  LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n});
\n
\n
\n \n

By default, the router will begin trying to translate the current URL into\napplication state once the browser emits the DOMContentReady event. If you\nneed to defer routing, you can call the application's deferReadiness()\nmethod. Once routing can begin, call the advanceReadiness() method.

\n

If there is any setup required before routing begins, you can implement a\nready() method on your app that will be invoked immediately before routing\nbegins.

\n", + "extends": "Engine", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/application/index.ts", + "line": 187, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 434, + "description": "

Create an ApplicationInstance for this application.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the application instance", + "type": "ApplicationInstance" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 459, + "description": "

Start tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is created.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_watchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 470, + "description": "

Stop tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is about to be destroyed.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_unwatchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 483, + "description": "

Enable the legacy globals mode by allowing this application to act\nas a global namespace. See the docs on the _globalsMode property\nfor details.

\n

Most of these features are already deprecated in 1.x, so we can\nstop using them internally and try to remove them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareForGlobalsMode", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 530, + "description": "

Automatically kick-off the boot process for the application once the\nDOM has become ready.

\n

The initialization itself is scheduled on the actions queue which\nensures that code-loading finishes before booting.

\n

If you are asynchronously loading code, you should call deferReadiness()\nto defer booting, and then call advanceReadiness() once all of your code\nhas finished loading.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "waitForDOMReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 570, + "description": "

This is the autoboot flow:

\n
    \n
  1. Boot the app by calling this.boot()
  2. \n
  3. Create an instance (or use the __deprecatedInstance__ in globals mode)
  4. \n
  5. Boot the instance by calling instance.boot()
  6. \n
  7. Invoke the App.ready() callback
  8. \n
  9. Kick-off routing on the instance
  10. \n
\n

Ideally, this is all we would need to do:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
_autoBoot() {\n  this.boot().then(() => {\n    let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance();\n    return instance.boot();\n  }).then((instance) => {\n    App.ready();\n    instance.startRouting();\n  });\n}
\n
\n
\n \n

Unfortunately, we cannot actually write this because we need to participate\nin the "synchronous" boot process. While the code above would work fine on\nthe initial boot (i.e. DOM ready), when App.reset() is called, we need to\nboot a new instance synchronously (see the documentation on _bootSync()\nfor details).

\n

Because of this restriction, the actual logic of this method is located\ninside didBecomeReady().

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "domReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 615, + "description": "

Use this to defer readiness until some condition is true.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Application from '@ember/application';\n\nlet App = Application.create();\n\nApp.deferReadiness();\n\nfetch('/auth-token')\n.then(response => response.json())\n.then(data => {\n  App.token = data.token;\n  App.advanceReadiness();\n});
\n
\n
\n \n

This allows you to perform asynchronous setup logic and defer\nbooting your application until the setup has finished.

\n

However, if the setup requires a loading UI, it might be better\nto use the router for this purpose.

\n", + "itemtype": "method", + "name": "deferReadiness", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 665, + "description": "

Call advanceReadiness after any asynchronous setup logic has completed.\nEach call to deferReadiness must be matched by a call to advanceReadiness\nor the application will never become ready and routing will not begin.

\n", + "itemtype": "method", + "name": "advanceReadiness", + "see": [ + "{Application#deferReadiness}" + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 704, + "description": "

Initialize the application and return a promise that resolves with the Application\nobject when the boot process is complete.

\n

Run any application initializers and run the application load hook. These hooks may\nchoose to defer readiness. For example, an authentication hook might want to defer\nreadiness until the auth token has been retrieved.

\n

By default, this method is called automatically on "DOM ready"; however, if autoboot\nis disabled, this is automatically called when the first application instance is\ncreated via visit.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 785, + "description": "

Reset the application. This is typically used only in tests. It cleans up\nthe application in the following order:

\n
    \n
  1. Deactivate existing routes
  2. \n
  3. Destroy all objects in the container
  4. \n
  5. Create a new application container
  6. \n
  7. Re-route to the existing url
  8. \n
\n

Typical Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    App.reset();\n  }\n});\n\ntest('first test', function() {\n  // App is freshly reset\n});\n\ntest('second test', function() {\n  // App is again freshly reset\n});
\n
\n
\n \n

Advanced Example:

\n

Occasionally you may want to prevent the app from initializing during\nsetup. This could enable extra configuration, or enable asserting prior\nto the app becoming ready.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    run(function() {\n      App.reset();\n      App.deferReadiness();\n    });\n  }\n});\n\ntest('first test', function() {\n  ok(true, 'something before app is initialized');\n\n  run(function() {\n    App.advanceReadiness();\n  });\n\n  ok(true, 'something after app is initialized');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reset", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 889, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "didBecomeReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 967, + "description": "

Boot a new instance of ApplicationInstance for the current\napplication and navigate it to the given url. Returns a Promise that\nresolves with the instance when the initial routing and rendering is\ncomplete, or rejects with any error that occurred during the boot process.

\n

When autoboot is disabled, calling visit would first cause the\napplication to boot, which runs the application initializers.

\n

This method also takes a hash of boot-time configuration options for\ncustomizing the instance's behavior. See the documentation on\nApplicationInstance.BootOptions for details.

\n

ApplicationInstance.BootOptions is an interface class that exists\npurely to document the available options; you do not need to construct it\nmanually. Simply pass a regular JavaScript object containing of the\ndesired options:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Supported Scenarios

\n

While the BootOptions class exposes a large number of knobs, not all\ncombinations of them are valid; certain incompatible combinations might\nresult in unexpected behavior.

\n

For example, booting the instance in the full browser environment\nwhile specifying a foreign document object (e.g. { isBrowser: true, document: iframe.contentDocument }) does not work correctly today,\nlargely due to Ember's jQuery dependency.

\n

Currently, there are three officially supported scenarios/configurations.\nUsages outside of these scenarios are not guaranteed to work, but please\nfeel free to file bug reports documenting your experience and any issues\nyou encountered to help expand support.

\n

Browser Applications (Manual Boot)

\n

The setup is largely similar to how Ember works out-of-the-box. Normally,\nEmber will boot a default instance for your Application on "DOM ready".\nHowever, you can customize this behavior by disabling autoboot.

\n

For example, this allows you to render a miniture demo of your application\ninto a specific area on your marketing website:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let options = {\n    // Override the router's location adapter to prevent it from updating\n    // the URL in the address bar\n    location: 'none',\n\n    // Override the default `rootElement` on the app to render into a\n    // specific `div` on the page\n    rootElement: '#demo'\n  };\n\n  // Start the app at the special demo URL\n  App.visit('/demo', options);\n});
\n
\n
\n \n

Or perhaps you might want to boot two instances of your app on the same\npage for a split-screen multiplayer experience:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let sessionId = MyApp.generateSessionID();\n\n  let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' });\n  let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' });\n\n  Promise.all([player1, player2]).then(() => {\n    // Both apps have completed the initial render\n    $('#loading').fadeOut();\n  });\n});
\n
\n
\n \n

Do note that each app instance maintains their own registry/container, so\nthey will run in complete isolation by default.

\n

Server-Side Rendering (also known as FastBoot)

\n

This setup allows you to run your Ember app in a server environment using\nNode.js and render its content into static HTML for SEO purposes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap);\n\nfunction renderURL(url) {\n  let dom = new SimpleDOM.Document();\n  let rootElement = dom.body;\n  let options = { isBrowser: false, document: dom, rootElement: rootElement };\n\n  return MyApp.visit(options).then(instance => {\n    try {\n      return HTMLSerializer.serialize(rootElement.firstChild);\n    } finally {\n      instance.destroy();\n    }\n  });\n}
\n
\n
\n \n

In this scenario, because Ember does not have access to a global document\nobject in the Node.js environment, you must provide one explicitly. In practice,\nin the non-browser environment, the stand-in document object only needs to\nimplement a limited subset of the full DOM API. The SimpleDOM library is known\nto work.

\n

Since there is no DOM access in the non-browser environment, you must also\nspecify a DOM Element object in the same document for the rootElement option\n(as opposed to a selector string like "body").

\n

See the documentation on the isBrowser, document and rootElement properties\non ApplicationInstance.BootOptions for details.

\n

Server-Side Resource Discovery

\n

This setup allows you to run the routing layer of your Ember app in a server\nenvironment using Node.js and completely disable rendering. This allows you\nto simulate and discover the resources (i.e. AJAX requests) needed to fulfill\na given request and eagerly "push" these resources to the client.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
service.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import BrowserNetworkService from 'app/services/network/browser';\nimport NodeNetworkService from 'app/services/network/node';\n\n// Inject a (hypothetical) service for abstracting all AJAX calls and use\n// the appropriate implementation on the client/server. This also allows the\n// server to log all the AJAX calls made during a particular request and use\n// that for resource-discovery purpose.\n\nexport function initialize(application) {\n  if (window) { // browser\n    application.register('service:network', BrowserNetworkService);\n  } else { // node\n    application.register('service:network', NodeNetworkService);\n  }\n};\n\nexport default {\n  name: 'network-service',\n  initialize: initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\n// An example of how the (hypothetical) service is used in routes.\n\nexport default class IndexRoute extends Route {\n  @service network;\n\n  model(params) {\n    return this.network.fetch(`/api/posts/${params.post_id}.json`);\n  }\n\n  afterModel(post) {\n    if (post.isExternalContent) {\n      return this.network.fetch(`/api/external/?url=${post.externalURL}`);\n    } else {\n      return post;\n    }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
// Finally, put all the pieces together\n\nfunction discoverResourcesFor(url) {\n  return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => {\n    let networkService = instance.lookup('service:network');\n    return networkService.requests; // => { "/api/posts/123.json": "..." }\n  });\n}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "The initial URL to navigate to", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "ApplicationInstance.BootOptions" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 62, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 209, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 285, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 346, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 359, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 371, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 384, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 392, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 400, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 414, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 448, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Enginer" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 15, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "Application", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + } + ], + "events": [ + { + "file": "packages/@ember/application/index.ts", + "line": 942, + "description": "

Called when the Application has become ready, immediately before routing\nbegins. The call will be delayed until the DOM has become ready.

\n", + "itemtype": "event", + "name": "ready", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + } + ], + "properties": [ + { + "file": "packages/@ember/application/index.ts", + "line": 232, + "description": "

The root DOM element of the Application. This can be specified as an\nelement or a selector string.

\n

This is the element that will be passed to the Application's,\neventDispatcher, which sets up the listeners for event delegation. Every\nview in your application should be a child of the element you specify here.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 247, + "itemtype": "property", + "name": "_document", + "type": "Document | null", + "default": "'window.document'", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 256, + "description": "

The Ember.EventDispatcher responsible for delegating events to this\napplication's views.

\n

The event dispatcher is created by the application at initialization time\nand sets up event listeners on the DOM element described by the\napplication's rootElement property.

\n

See the documentation for Ember.EventDispatcher for more information.

\n", + "itemtype": "property", + "name": "eventDispatcher", + "type": "Ember.EventDispatcher", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 273, + "description": "

The DOM events for which the event dispatcher should listen.

\n

By default, the application's Ember.EventDispatcher listens\nfor a set of standard DOM events, such as mousedown and\nkeyup, and delegates them to your application's Ember.View\ninstances.

\n

If you would like additional bubbling events to be delegated to your\nviews, set your Application's customEvents property\nto a hash containing the DOM event name as the key and the\ncorresponding view method name as the value. Setting an event to\na value of null will prevent a default event listener from being\nadded for that event.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // add support for the paste event\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // remove support for mouseenter / mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "customEvents", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 321, + "description": "

Whether the application should automatically start routing and render\ntemplates to the rootElement on DOM ready. While default by true,\nother environments such as FastBoot or a testing harness can set this\nproperty to false and control the precise timing and behavior of the boot\nprocess.

\n", + "itemtype": "property", + "name": "autoboot", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 335, + "description": "

Whether the application should be configured for the legacy "globals mode".\nUnder this mode, the Application object serves as a global namespace for all\nclasses.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Application from '@ember/application';\nimport Component from '@ember/component';\n\nlet App = Application.create({\n  ...\n});\n\nApp.Router.reopen({\n  location: 'none'\n});\n\nApp.Router.map({\n  ...\n});\n\nApp.MyComponent = Component.extend({\n  ...\n});
\n
\n
\n \n

This flag also exposes other internal APIs that assumes the existence of\na special "default instance", like App.__container__.lookup(...).

\n

This option is currently not configurable, its value is derived from\nthe autoboot flag – disabling autoboot also implies opting-out of\nglobals mode support, although they are ultimately orthogonal concerns.

\n

Some of the global modes features are already deprecated in 1.x. The\nexistence of this flag is to untangle the globals mode code paths from\nthe autoboot code paths, so that these legacy features can be reviewed\nfor deprecation/removal separately.

\n

Forcing the (autoboot=true, _globalsMode=false) here and running the tests\nwould reveal all the places where we are still relying on these legacy\nbehavior internally (mostly just tests).

\n", + "itemtype": "property", + "name": "_globalsMode", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 384, + "description": "

An array of application instances created by buildInstance(). Used\ninternally to ensure that all instances get destroyed.

\n", + "itemtype": "property", + "name": "_applicationInstances", + "type": "Array", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 325, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 338, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-Engine", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-ApplicationInstance-b572dc6b03.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-ApplicationInstance-b572dc6b03.json new file mode 100644 index 000000000..6db28ebbb --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-ApplicationInstance-b572dc6b03.json @@ -0,0 +1,1052 @@ +{ + "data": { + "id": "ember-4.9.3-ApplicationInstance", + "type": "class", + "attributes": { + "name": "ApplicationInstance", + "shortname": "ApplicationInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/instance.ts", + "line": 19, + "description": "

The ApplicationInstance encapsulates all of the stateful aspects of a\nrunning Application.

\n

At a high-level, we break application boot into two distinct phases:

\n
    \n
  • Definition time, where all of the classes, templates, and other\ndependencies are loaded (typically in the browser).
  • \n
  • Run time, where we begin executing the application once everything\nhas loaded.
  • \n
\n

Definition time can be expensive and only needs to happen once since it is\nan idempotent operation. For example, between test runs and FastBoot\nrequests, the application stays the same. It is only the state that we want\nto reset.

\n

That state is what the ApplicationInstance manages: it is responsible for\ncreating the container that contains all application state, and disposing of\nit once the particular test run or FastBoot request has finished.

\n", + "access": "public", + "tagname": "", + "extends": "EngineInstance", + "methods": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 296, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 50, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 97, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 163, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 180, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 210, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 39, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 65, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 126, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 15, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 45, + "description": "

The Application for which this is an instance.

\n", + "itemtype": "property", + "name": "application", + "type": "Application", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 53, + "description": "

The root DOM element of the Application as an element or a\nCSS selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "String|DOMElement", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 58, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 31, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-EngineInstance", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-ApplicationInstance.BootOptions-3526def202.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-ApplicationInstance.BootOptions-3526def202.json new file mode 100644 index 000000000..a46cb9b3d --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-ApplicationInstance.BootOptions-3526def202.json @@ -0,0 +1,143 @@ +{ + "data": { + "id": "ember-4.9.3-ApplicationInstance.BootOptions", + "type": "class", + "attributes": { + "name": "ApplicationInstance.BootOptions", + "shortname": "ApplicationInstance.BootOptions", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "ApplicationInstance", + "file": "packages/@ember/application/instance.ts", + "line": 316, + "description": "

A list of boot-time configuration options for customizing the behavior of\nan ApplicationInstance.

\n

This is an interface class that exists purely to document the available\noptions; you do not need to construct it manually. Simply pass a regular\nJavaScript object containing the desired options into methods that require\none of these options object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Not all combinations of the supported options are valid. See the documentation\non Application#visit for the supported configurations.

\n

Internal, experimental or otherwise unstable flags are marked as private.

\n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 339, + "description": "

Interactive mode: whether we need to set up event delegation and invoke\nlifecycle callbacks on Components.

\n", + "itemtype": "property", + "name": "isInteractive", + "type": "boolean", + "default": "auto-detected", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 350, + "itemtype": "property", + "name": "_renderMode", + "type": "string", + "default": "undefined", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 358, + "description": "

Run in a full browser environment.

\n

When this flag is set to false, it will disable most browser-specific\nand interactive features. Specifically:

\n
    \n
  • It does not use jQuery to append the root view; the rootElement\n(either specified as a subsequent option or on the application itself)\nmust already be an Element in the given document (as opposed to a\nstring selector).

    \n
  • \n
  • It does not set up an EventDispatcher.

    \n
  • \n
  • It does not run any Component lifecycle hooks (such as didInsertElement).

    \n
  • \n
  • It sets the location option to "none". (If you would like to use\nthe location adapter specified in the app's router instead, you can also\nspecify { location: null } to specifically opt-out.)

    \n
  • \n
\n", + "itemtype": "property", + "name": "isBrowser", + "type": "boolean", + "default": "auto-detected", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 384, + "description": "

If present, overrides the router's location property with this\nvalue. This is useful for environments where trying to modify the\nURL would be inappropriate.

\n", + "itemtype": "property", + "name": "location", + "type": "string", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 396, + "description": "

Disable rendering completely.

\n

When this flag is set to false, it will disable the entire rendering\npipeline. Essentially, this puts the app into "routing-only" mode. No\ntemplates will be rendered, and no Components will be created.

\n", + "itemtype": "property", + "name": "shouldRender", + "type": "boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 410, + "description": "

If present, render into the given Document object instead of the\nglobal window.document object.

\n

In practice, this is only useful in non-browser environment or in\nnon-interactive mode, because Ember's jQuery dependency is\nimplicitly bound to the current document, causing event delegation\nto not work properly when the app is rendered into a foreign\ndocument object (such as an iframe's contentDocument).

\n

In non-browser mode, this could be a "Document-like" object as\nEmber only interact with a small subset of the DOM API in non-\ninteractive mode. While the exact requirements have not yet been\nformalized, the SimpleDOM library's implementation is known to\nwork.

\n", + "itemtype": "property", + "name": "document", + "type": "Document", + "default": "the global `document` object", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 433, + "description": "

If present, overrides the application's rootElement property on\nthe instance. This is useful for testing environment, where you\nmight want to append the root view to a fixture area.

\n

In non-browser mode, because Ember does not have access to jQuery,\nthis options must be specified as a DOM Element object instead of\na selector string.

\n

See the documentation on Application's rootElement for\ndetails.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "String|Element", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-ArrayProxy-ab15b0f49f.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-ArrayProxy-ab15b0f49f.json new file mode 100644 index 000000000..7ae3a8b8f --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-ArrayProxy-ab15b0f49f.json @@ -0,0 +1,1834 @@ +{ + "data": { + "id": "ember-4.9.3-ArrayProxy", + "type": "class", + "attributes": { + "name": "ArrayProxy", + "shortname": "ArrayProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/array/proxy", + "namespace": "", + "file": "packages/@ember/array/proxy.ts", + "line": 59, + "description": "

An ArrayProxy wraps any other object that implements Array and/or\nMutableArray, forwarding all requests. This makes it very useful for\na number of binding use cases or other cases where being able to swap\nout the underlying array is useful.

\n

A simple example of usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({ content: A(pets) });\n\nap.get('firstObject');                        // 'dog'\nap.set('content', ['amoeba', 'paramecium']);\nap.get('firstObject');                        // 'amoeba'
\n
\n
\n \n

This class can also be useful as a layer to transform the contents of\nan array, as they are accessed. This can be done by overriding\nobjectAtContent:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({\n    content: A(pets),\n    objectAtContent: function(idx) {\n        return this.get('content').objectAt(idx).toUpperCase();\n    }\n});\n\nap.get('firstObject'); // . 'DOG'
\n
\n
\n \n

When overriding this class, it is important to place the call to\n_super after setting content so the internal observers have\na chance to fire properly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nexport default ArrayProxy.extend({\n  init() {\n    this.set('content', A(['dog', 'cat', 'fish']));\n    this._super(...arguments);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/array/proxy.ts", + "line": 138, + "description": "

Should actually retrieve the object at the specified index from the\ncontent. You can override this method in subclasses to transform the\ncontent item to something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "objectAtContent", + "params": [ + { + "name": "idx", + "description": "The index to retrieve.", + "type": "Number" + } + ], + "return": { + "description": "the value or undefined if none found", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/array/proxy.ts", + "line": 151, + "description": "

Should actually replace the specified objects on the content array.\nYou can override this method in subclasses to transform the content item\ninto something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "replaceContent", + "params": [ + { + "name": "idx", + "description": "The starting index", + "type": "Number" + }, + { + "name": "amt", + "description": "The number of items to remove from the content.", + "type": "Number" + }, + { + "name": "objects", + "description": "Optional array of objects to insert.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1484, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1503, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1520, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1538, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1560, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1577, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1593, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1609, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1625, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1642, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1659, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1668, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1686, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1703, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1712, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1729, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/proxy.ts", + "line": 120, + "description": "

The content array. Must be an object that implements Array and/or\nMutableArray.

\n", + "itemtype": "property", + "name": "content", + "type": "EmberArray", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/array/proxy.ts", + "line": 129, + "description": "

The array that the proxy pretends to be. In the default ArrayProxy\nimplementation, this and content are the same. Subclasses of ArrayProxy\ncan override this property to provide things like sorting and filtering.

\n", + "itemtype": "property", + "name": "arrangedContent", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/array/proxy", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Component-40d7674a65.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Component-40d7674a65.json new file mode 100644 index 000000000..9d5891871 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Component-40d7674a65.json @@ -0,0 +1,1587 @@ +{ + "data": { + "id": "ember-4.9.3-Component", + "type": "class", + "attributes": { + "name": "Component", + "shortname": "Component", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 39, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault component's for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Classic components. If you are looking for the\nAPI documentation for Template-only or Glimmer components, it is\navailable here.

\n

Defining a Classic Component

\n

If you want to customize the component in order to handle events, transform\narguments or maintain internal state, you implement a subclass of Component.

\n

One example is to add computed properties to your component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  displayName: computed('person.title', 'person.firstName', 'person.lastName', function() {\n    let { title, firstName, lastName } = this.person;\n\n    if (title) {\n      return `${title} ${lastName}`;\n    } else {\n      return `${firstName} ${lastName}`;\n    }\n  })\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

Customizing a Classic Component's HTML Element in JavaScript

\n

HTML Tag

\n

The default HTML tag name used for a component's HTML representation is div.\nThis can be customized by setting the tagName property.

\n

Consider the following component class:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
paragraph.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'em'\n});
\n
\n
\n \n

When invoked, this component would produce output that looks something like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<em id="ember1" class="ember-view"></em>
\n
\n
\n \n

HTML class Attribute

\n

The HTML class attribute of a component's tag can be set by providing a\nclassNames property that is set to an array of strings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class']\n});
\n
\n
\n \n

Invoking this component will produce output that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class"></div>
\n
\n
\n \n

class attribute values can also be set by providing a classNameBindings\nproperty set to an array of properties names for the component. The return\nvalue of these properties will be added as part of the value for the\ncomponents's class attribute. These properties can be computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class'],\n  classNameBindings: ['propertyA', 'propertyB'],\n\n  propertyA: 'from-a',\n  propertyB: computed(function() {\n    if (someLogic) { return 'from-b'; }\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

Note that classNames and classNameBindings is in addition to the class\nattribute passed with the angle bracket invocation syntax. Therefore, if this\ncomponent was invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyWidget class="from-invocation" />
\n
\n
\n \n

The resulting HTML will look similar to this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="from-invocation ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

If the value of a class name binding returns a boolean the property name\nitself will be used as the class name if the property is true. The class name\nwill not be added if the value is false or undefined.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['hovered'],\n\n  hovered: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view hovered"></div>
\n
\n
\n \n

Custom Class Names for Boolean Values

\n

When using boolean class name bindings you can supply a string value other\nthan the property name for use as the class HTML attribute by appending the\npreferred value after a ":" character when defining the binding:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['awesome:so-very-cool'],\n\n  awesome: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view so-very-cool"></div>
\n
\n
\n \n

Boolean value class name bindings whose property names are in a\ncamelCase-style format will be converted to a dasherized format:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isUrgent'],\n\n  isUrgent: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view is-urgent"></div>
\n
\n
\n \n

Class name bindings can also refer to object values that are found by\ntraversing a path relative to the component itself:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport EmberObject from '@ember/object';\n\nexport default Component.extend({\n  classNameBindings: ['messages.empty'],\n\n  messages: EmberObject.create({\n    empty: true\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view empty"></div>
\n
\n
\n \n

If you want to add a class name for a property which evaluates to true and\nand a different class name if it evaluates to false, you can pass a binding\nlike this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isEnabled:enabled:disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view enabled"></div>
\n
\n
\n \n

When isEnabled is false, the resulting HTML representation looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

This syntax offers the convenience to add a class if a property is false:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\n// Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\nexport default Component.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component when the isEnabled property is true will produce\nHTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view"></div>
\n
\n
\n \n

Invoking it when the isEnabled property on the component is false will\nproduce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

Updates to the value of a class name binding will result in automatic update\nof the HTML class attribute in the component's rendered HTML\nrepresentation. If the value becomes false or undefined the class name\nwill be removed.

\n

Both classNames and classNameBindings are concatenated properties. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Other HTML Attributes

\n

The HTML attribute section of a component's tag can be set by providing an\nattributeBindings property set to an array of property names on the component.\nThe return value of these properties will be used as the value of the component's\nHTML associated attribute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['href'],\n\n  href: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

One property can be mapped on to another by placing a ":" between\nthe source property and the destination property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['url:href'],\n\n  url: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

HTML attributes passed with angle bracket invocations will take precedence\nover those specified in attributeBindings. Therefore, if this component was\ninvoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyAnchor href="http://bing.com" @url="http://google.com" />
\n
\n
\n \n

The resulting HTML will looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://bing.com"></a>
\n
\n
\n \n

Note that the href attribute is ultimately set to http://bing.com,\ndespite it having attribute binidng to the url property, which was\nset to http://google.com.

\n

Namespaced attributes (e.g. xlink:href) are supported, but have to be\nmapped, since : is not a valid character for properties in Javascript:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
use.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'use',\n  attributeBindings: ['xlinkHref:xlink:href'],\n\n  xlinkHref: '#triangle'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<use xlink:href="#triangle"></use>
\n
\n
\n \n

If the value of a property monitored by attributeBindings is a boolean, the\nattribute will be present or absent depending on the value:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: false\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id="ember1" class="ember-view" />
\n
\n
\n \n

attributeBindings can refer to computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: computed(function() {\n    if (someLogic) {\n      return true;\n    } else {\n      return false;\n    }\n  })\n});
\n
\n
\n \n

To prevent setting an attribute altogether, use null or undefined as the\nvalue of the property used in attributeBindings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'form',\n  attributeBindings: ['novalidate'],\n  novalidate: null\n});
\n
\n
\n \n

Updates to the property of an attribute binding will result in automatic\nupdate of the HTML attribute in the component's HTML output.

\n

attributeBindings is a concatenated property. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Layouts

\n

The layout property can be used to dynamically specify a template associated\nwith a component class, instead of relying on Ember to link together a\ncomponent class and a template based on file names.

\n

In general, applications should not use this feature, but it's commonly used\nin addons for historical reasons.

\n

The layout property should be set to the default export of a template\nmodule, which is the name of a template file without the .hbs extension.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>Person's Title</h1>\n<div class='details'>{{yield}}</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n
  import Component from '@ember/component';\n  import layout from '../templates/components/person-profile';\n\n  export default Component.extend({\n    layout\n  });
\n
\n
\n \n

If you invoke the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile>\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</PersonProfile>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#person-profile}}\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n{{/person-profile}}
\n
\n
\n \n

It will result in the following HTML output:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<h1>Person's Title</h1>\n  <div class="details">\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</div>
\n
\n
\n \n

Handling Browser Events

\n

Components can respond to user-initiated events in one of three ways: passing\nactions with angle bracket invocation, adding event handler methods to the\ncomponent's class, or adding actions to the component's template.

\n

Passing Actions With Angle Bracket Invocation

\n

For one-off events specific to particular instance of a component, it is possible\nto pass actions to the component's element using angle bracket invocation syntax.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyWidget {{action 'firstWidgetClicked'}} />\n\n<MyWidget {{action 'secondWidgetClicked'}} />
\n
\n
\n \n

In this case, when the first component is clicked on, Ember will invoke the\nfirstWidgetClicked action. When the second component is clicked on, Ember\nwill invoke the secondWidgetClicked action instead.

\n

Besides {{action}}, it is also possible to pass any arbitrary element modifiers\nusing the angle bracket invocation syntax.

\n

Event Handler Methods

\n

Components can also respond to user-initiated events by implementing a method\nthat matches the event name. This approach is appropriate when the same event\nshould be handled by all instances of the same component.

\n

An event object will be passed as the argument to the event handler method.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click(event) {\n    // `event.target` is either the component's element or one of its children\n    let tag = event.target.tagName.toLowerCase();\n    console.log('clicked on a `<${tag}>` HTML element!');\n  }\n});
\n
\n
\n \n

In this example, whenever the user clicked anywhere inside the component, it\nwill log a message to the console.

\n

It is possible to handle event types other than click by implementing the\nfollowing event handler methods. In addition, custom events can be registered\nby using Application.customEvents.

\n

Touch events:

\n
    \n
  • touchStart
  • \n
  • touchMove
  • \n
  • touchEnd
  • \n
  • touchCancel
  • \n
\n

Keyboard events:

\n
    \n
  • keyDown
  • \n
  • keyUp
  • \n
  • keyPress
  • \n
\n

Mouse events:

\n
    \n
  • mouseDown
  • \n
  • mouseUp
  • \n
  • contextMenu
  • \n
  • click
  • \n
  • doubleClick
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
\n

Form events:

\n
    \n
  • submit
  • \n
  • change
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
  • input
  • \n
\n

Drag and drop events:

\n
    \n
  • dragStart
  • \n
  • drag
  • \n
  • dragEnter
  • \n
  • dragLeave
  • \n
  • dragOver
  • \n
  • dragEnd
  • \n
  • drop
  • \n
\n

{{action}} Helper

\n

Instead of handling all events of a particular type anywhere inside the\ncomponent's element, you may instead want to limit it to a particular\nelement in the component's template. In this case, it would be more\nconvenient to implement an action instead.

\n

For example, you could implement the action hello for the person-profile\ncomponent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  actions: {\n    hello(name) {\n      console.log("Hello", name);\n    }\n  }\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
<h1>{{@person.name}}</h1>\n\n<button {{action 'hello' @person.name}}>\n  Say Hello to {{@person.name}}\n</button>
\n
\n
\n \n

When the user clicks the button, Ember will invoke the hello action,\npassing in the current value of @person.name as an argument.

\n

See Ember.Templates.helpers.action.

\n", + "extends": "Ember.CoreView", + "uses": [ + "Ember.ViewStateSupport", + "Ember.ViewMixin", + "Ember.ActionSupport", + "Ember.ClassNamesSupport", + "Ember.TargetActionSupport" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 656, + "description": "

Called when the attributes passed into the component have been updated.\n Called both during the initial render of a container and during a rerender.\n Can be used in place of an observer; code placed here will be executed\n every time any attribute updates.

\n", + "itemtype": "method", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 677, + "description": "

Called after a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "method", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 694, + "description": "

Called before a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "method", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 711, + "description": "

Called when the attributes passed into the component have been changed.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 728, + "description": "

Called when the component is about to update and rerender itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 745, + "description": "

Called when the component has updated and rerendered itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 951, + "description": "

Normally, Ember's component model is "write-only". The component takes a\nbunch of attributes that it got passed in, and uses them to render its\ntemplate.

\n

One nice thing about this model is that if you try to set a value to the\nsame thing as last time, Ember (through HTMLBars) will avoid doing any\nwork on the DOM.

\n

This is not just a performance optimization. If an attribute has not\nchanged, it is important not to clobber the element's "hidden state".\nFor example, if you set an input's value to the same value as before,\nit will clobber selection state and cursor position. In other words,\nsetting an attribute is not always idempotent.

\n

This method provides a way to read an element's attribute and also\nupdate the last value Ember knows about at the same time. This makes\nsetting an attribute idempotent.

\n

In particular, what this means is that if you get an <input> element's\nvalue attribute and then re-render the template with the same value,\nit will avoid clobbering the cursor and selection position.\nSince most attribute sets are idempotent in the browser, you typically\ncan get away with reading attributes using jQuery, but the most reliable\nway to do so is through this method.

\n", + "itemtype": "method", + "name": "readDOMAttr", + "params": [ + { + "name": "name", + "description": "the name of the attribute", + "type": "String" + } + ], + "return": { + "description": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 36, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 58, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 78, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 110, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 153, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 162, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 177, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 193, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 209, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 77, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 93, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 121, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 141, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 181, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 246, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 331, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 405, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 439, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 52, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.TargetActionSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/mixin.ts", + "line": 425, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/mixin", + "inherited": true, + "inheritedFrom": "Mixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 667, + "description": "

Called when the attributes passed into the component have been updated.\n Called both during the initial render of a container and during a rerender.\n Can be used in place of an observer; code placed here will be executed\n every time any attribute updates.

\n", + "itemtype": "event", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 686, + "description": "

Called after a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "event", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 703, + "description": "

Called before a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "event", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 720, + "description": "

Called when the attributes passed into the component have been changed.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 737, + "description": "

Called when the component is about to update and rerender itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 754, + "description": "

Called when the component has updated and rerendered itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 300, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 308, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 321, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 345, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 358, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 366, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 762, + "description": "

The HTML id of the component's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent @elementId="a-really-cool-id" />
\n
\n
\n \n

If not manually set a default value will be provided by the framework.\nOnce rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
export default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    var index = this.get('index');\n    this.set('elementId', `component-id${index}`);\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1011, + "description": "

Layout can be used to wrap content in a component.

\n", + "itemtype": "property", + "name": "layout", + "type": "Function", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1019, + "description": "

The name of the layout to lookup if no layout is provided.\nBy default Component will lookup a template with this name in\nEmber.TEMPLATES (a shared global object).

\n", + "itemtype": "property", + "name": "layoutName", + "type": "String", + "default": "undefined", + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1030, + "description": "

The WAI-ARIA role of the control represented by this view. For example, a\n button may have a role of type 'button', or a pane may have a role of\n type 'alertdialog'. This property is used by assistive software to help\n visually challenged users navigate rich web applications.

\n

The full list of valid WAI-ARIA roles is available at:\n https://www.w3.org/TR/wai-aria/#roles_categorization

\n", + "itemtype": "property", + "name": "ariaRole", + "type": "String", + "default": "undefined", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1055, + "description": "

Enables components to take a list of parameters as arguments.\n For example, a component that takes two parameters with the names\n name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: ['name', 'age']\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" 38}}
\n
\n
\n \n

The parameters can be referred to just like named parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Name: {{name}}, Age: {{age}}.
\n
\n
\n \n

Using a string instead of an array allows for an arbitrary number of\n parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nlet MyComponent = Component.extend();\n\nMyComponent.reopenClass({\n  positionalParams: 'names'\n});\n\nexport default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component "John" "Michael" "Scott"}}
\n
\n
\n \n

The parameters can then be referred to by enumerating over the list:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{#each names as |name|}}{{name}}{{/each}}
\n
\n
\n \n", + "static": 1, + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "positionalParams", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 38, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 35, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 166, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 267, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 378, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/child_views_support.ts", + "line": 14, + "description": "

Array of child views. You should never edit this array directly.

\n", + "itemtype": "property", + "name": "childViews", + "type": "Array", + "default": "[]", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 36, + "description": "

Standard CSS class names to apply to the view's outer element. This\nproperty automatically inherits any class names defined by the view's\nsuperclasses as well.

\n", + "itemtype": "property", + "name": "classNames", + "type": "Array", + "default": "['ember-view']", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 48, + "description": "

A list of properties of the view to apply as class names. If the property\nis a string value, the value of that string will be applied as a class\nname.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'high' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['priority'],\n  priority: 'high'\n});
\n
\n
\n \n

If the value of the property is a Boolean, the name of that property is\nadded as a dasherized class name.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'is-urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would prefer to use a custom value instead of the dasherized\nproperty name, you can pass a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent:urgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would like to specify a class that should only be added when the\nproperty is false, you can declare a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'disabled' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: false\n});
\n
\n
\n \n

This list of properties is inherited from the component's superclasses as well.

\n", + "itemtype": "property", + "name": "classNameBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-Ember.CoreView", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-ComputedProperty-fba3337884.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-ComputedProperty-fba3337884.json new file mode 100644 index 000000000..a7dc90b51 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-ComputedProperty-fba3337884.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-4.9.3-ComputedProperty", + "type": "class", + "attributes": { + "name": "ComputedProperty", + "shortname": "ComputedProperty", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 77, + "description": "

@computed is a decorator that turns a JavaScript getter and setter into a\ncomputed property, which is a cached, trackable value. By default the getter\nwill only be called once and the result will be cached. You can specify\nvarious properties that your computed property depends on. This will force the\ncached result to be cleared if the dependencies are modified, and lazily recomputed the next time something asks for it.

\n

In the following example we decorate a getter - fullName - by calling\ncomputed with the property dependencies (firstName and lastName) as\narguments. The fullName getter will be called once (regardless of how many\ntimes it is accessed) as long as its dependencies do not change. Once\nfirstName or lastName are updated any future calls to fullName will\nincorporate the new values, and any watchers of the value such as templates\nwill be updated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet tom = new Person('Tom', 'Dale');\n\ntom.fullName; // 'Tom Dale'
\n
\n
\n \n

You can also provide a setter, which will be used when updating the computed\nproperty. Ember's set function must be used to update the property\nsince it will also notify observers of the property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(' ');\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

You can also pass a getter function or object with get and set functions\nas the last argument to the computed decorator. This allows you to define\ncomputed property macros:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { computed } from '@ember/object';\n\nfunction join(...keys) {\n  return computed(...keys, function() {\n    return keys.map(key => this[key]).join(' ');\n  });\n}\n\nclass Person {\n  @join('firstName', 'lastName')\n  fullName;\n}
\n
\n
\n \n

Note that when defined this way, getters and setters receive the key of the\nproperty they are decorating as the first argument. Setters receive the value\nthey are setting to as the second argument instead. Additionally, setters must\nreturn the value that should be cached:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { computed, set } from '@ember/object';\n\nfunction fullNameMacro(firstNameKey, lastNameKey) {\n  return computed(firstNameKey, lastNameKey, {\n    get() {\n      return `${this[firstNameKey]} ${this[lastNameKey]}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, firstNameKey, firstName);\n      set(this, lastNameKey, lastName);\n\n      return value;\n    }\n  });\n}\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @fullNameMacro('firstName', 'lastName') fullName;\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

Computed properties can also be used in classic classes. To do this, we\nprovide the getter and setter as the last argument like we would for a macro,\nand we assign it to a property on the class definition. This is an anonymous\ncomputed macro:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import EmberObject, { computed, set } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  // these will be supplied by `create`\n  firstName: null,\n  lastName: null,\n\n  fullName: computed('firstName', 'lastName', {\n    get() {\n      return `${this.firstName} ${this.lastName}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, 'firstName', firstName);\n      set(this, 'lastName', lastName);\n\n      return value;\n    }\n  })\n});\n\nlet tom = Person.create({\n  firstName: 'Tom',\n  lastName: 'Dale'\n});\n\ntom.get('fullName') // 'Tom Dale'
\n
\n
\n \n

You can overwrite computed property without setters with a normal property (no\nlonger computed) that won't change if dependencies change. You can also mark\ncomputed property as .readOnly() and block all attempts to set it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName').readOnly()\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet person = new Person();\nperson.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX>
\n
\n
\n \n

Additional resources:

\n\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 607, + "description": "

Call on a computed property to set it into read-only mode. When in this\nmode the computed property will throw an error when set.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  @computed().readOnly()\n  get guid() {\n    return 'guid-guid-guid';\n  }\n}\n\nlet person = new Person();\nset(person, 'guid', 'new-guid'); // will throw an exception
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  guid: computed(function() {\n    return 'guid-guid-guid';\n  }).readOnly()\n});\n\nlet person = Person.create();\nperson.set('guid', 'new-guid'); // will throw an exception
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "return": { + "description": "this", + "type": "ComputedProperty" + }, + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 657, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For example,\ncomputed property functions may close over variables that are then no longer\navailable for introspection. You can pass a hash of these values to a\ncomputed property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nclass Store {\n  @computed().meta({ type: Person })\n  get person() {\n    let personId = this.personId;\n    return Person.create({ id: personId });\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nconst Store = EmberObject.extend({\n  person: computed(function() {\n    let personId = this.get('personId');\n    return Person.create({ id: personId });\n  }).meta({ type: Person })\n});
\n
\n
\n \n

The hash that you pass to the meta() function will be saved on the\ncomputed property descriptor under the _meta key. Ember runtime\nexposes a public API for retrieving these values from classes,\nvia the metaForProperty() function.

\n", + "itemtype": "method", + "name": "meta", + "params": [ + { + "name": "meta", + "description": "", + "type": "Object" + } + ], + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Container-43fb9ebfea.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Container-43fb9ebfea.json new file mode 100644 index 000000000..3f0a0457e --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Container-43fb9ebfea.json @@ -0,0 +1,175 @@ +{ + "data": { + "id": "ember-4.9.3-Container", + "type": "class", + "attributes": { + "name": "Container", + "shortname": "Container", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 53, + "description": "

A container used to instantiate and cache objects.

\n

Every Container must be associated with a Registry, which is referenced\nto determine the factory and options that should be used to instantiate\nobjects.

\n

The public API for Container is still in flux and should not be considered\nstable.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 112, + "description": "

Given a fullName return a corresponding instance.\n The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter');\ntwitter instanceof Twitter; // => true\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted, an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let registry = new Registry();\nlet container = registry.container();\nregistry.register('api:twitter', Twitter);\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "TypeOptions", + "optional": true + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 151, + "description": "

A depth first traversal, destroying the container, its descendant containers and all\ntheir managed objects.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "destroy", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 168, + "description": "

Clear either the entire cache or just the cache for a particular key.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "params": [ + { + "name": "fullName", + "description": "optional key to reset; if missing, resets everything", + "type": "String" + } + ], + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 185, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "return": { + "description": "", + "type": "Object" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 198, + "description": "

Given a fullName, return the corresponding factory. The consumer of the factory\nis responsible for the destruction of any factory instances, as there is no\nway for the container to ensure instances are destroyed when it itself is\ndestroyed.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 93, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registry", + "type": "Registry", + "since": "1.11.0", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 100, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "cache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 106, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "validationCache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-ContainerDebugAdapter-26645589bf.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-ContainerDebugAdapter-26645589bf.json new file mode 100644 index 000000000..3f4607730 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-ContainerDebugAdapter-26645589bf.json @@ -0,0 +1,592 @@ +{ + "data": { + "id": "ember-4.9.3-ContainerDebugAdapter", + "type": "class", + "attributes": { + "name": "ContainerDebugAdapter", + "shortname": "ContainerDebugAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug/container-debug-adapter", + "namespace": "", + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 15, + "description": "

The ContainerDebugAdapter helps the container and resolver interface\nwith tools that debug Ember such as the\nEmber Inspector\nfor Chrome and Firefox.

\n

This class can be extended by a custom resolver implementer\nto override some of the methods with library-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • canCatalogEntriesByType
  • \n
  • catalogEntriesByType
  • \n
\n

The adapter will need to be registered\nin the application's container as container-debug-adapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "containerDebugAdapter",\n\n  initialize(application) {\n    application.register('container-debug-adapter:main', require('app/container-debug-adapter'));\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "since": "1.5.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 66, + "description": "

Returns true if it is possible to catalog a list of available\nclasses in the resolver for a given type.

\n", + "itemtype": "method", + "name": "canCatalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "whether a list is available for this type.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug/container-debug-adapter" + }, + { + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 83, + "description": "

Returns the available classes a given type.

\n", + "itemtype": "method", + "name": "catalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "An array of strings.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug/container-debug-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 56, + "description": "

The resolver instance of the application\nbeing debugged. This property will be injected\non creation.

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug/container-debug-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/debug/container-debug-adapter", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-ContainerProxyMixin-f314a0b5f6.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-ContainerProxyMixin-f314a0b5f6.json new file mode 100644 index 000000000..f6e3cf24d --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-ContainerProxyMixin-f314a0b5f6.json @@ -0,0 +1,131 @@ +{ + "data": { + "id": "ember-4.9.3-ContainerProxyMixin", + "type": "class", + "attributes": { + "name": "ContainerProxyMixin", + "shortname": "ContainerProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 19, + "description": "

ContainerProxyMixin is used to provide public access to specific\ncontainer functionality.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 39, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "ContainerProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 65, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ContainerProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 126, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ContainerProxyMixin", + "module": "ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 31, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ContainerProxyMixin", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-CoreObject-a9be885c9f.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-CoreObject-a9be885c9f.json new file mode 100644 index 000000000..81ff4dee4 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-CoreObject-a9be885c9f.json @@ -0,0 +1,158 @@ +{ + "data": { + "id": "ember-4.9.3-CoreObject", + "type": "class", + "attributes": { + "name": "CoreObject", + "shortname": "CoreObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/core", + "namespace": "", + "file": "packages/@ember/object/core.ts", + "line": 172, + "description": "

CoreObject is the base class for all Ember constructs. It establishes a\nclass system based on Ember's Mixin system, and provides the basis for the\nEmber Object Model. CoreObject should generally not be used directly,\ninstead you should use EmberObject.

\n

Usage

\n

You can define a class by extending from CoreObject using the extend\nmethod:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Person = CoreObject.extend({\n  name: 'Tomster',\n});
\n
\n
\n \n

For detailed usage, see the Object Model\nsection of the guides.

\n

Usage with Native Classes

\n

Native JavaScript class syntax can be used to extend from any CoreObject\nbased class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
class Person extends CoreObject {\n  init() {\n    super.init(...arguments);\n    this.name = 'Tomster';\n  }\n}
\n
\n
\n \n

Some notes about class usage:

\n
    \n
  • new syntax is not currently supported with classes that extend from\nEmberObject or CoreObject. You must continue to use the create method\nwhen making new instances of classes, even if they are defined using native\nclass syntax. If you want to use new syntax, consider creating classes\nwhich do not extend from EmberObject or CoreObject. Ember features,\nsuch as computed properties and decorators, will still work with base-less\nclasses.
  • \n
  • Instead of using this._super(), you must use standard super syntax in\nnative classes. See the MDN docs on classes\nfor more details.
  • \n
  • Native classes support using constructors\nto set up newly-created instances. Ember uses these to, among other things,\nsupport features that need to retrieve other entities by name, like Service\ninjection and getOwner. To ensure your custom instance setup logic takes\nplace after this important work is done, avoid using the constructor in\nfavor of init.
  • \n
  • Properties passed to create will be available on the instance by the time\ninit runs, so any code that requires these values should work at that\ntime.
  • \n
  • Using native classes, and switching back to the old Ember Object model is\nfully supported.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.9.3-Helper" + }, + { + "type": "class", + "id": "ember-4.9.3-EmberObject" + } + ] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/object/core", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-DataAdapter-2fe326fb68.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-DataAdapter-2fe326fb68.json new file mode 100644 index 000000000..6228725aa --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-DataAdapter-2fe326fb68.json @@ -0,0 +1,935 @@ +{ + "data": { + "id": "ember-4.9.3-DataAdapter", + "type": "class", + "attributes": { + "name": "DataAdapter", + "shortname": "DataAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug/data-adapter", + "namespace": "", + "file": "packages/@ember/debug/data-adapter.ts", + "line": 173, + "description": "

The DataAdapter helps a data persistence library\ninterface with tools that debug Ember such\nas the Ember Inspector\nfor Chrome and Firefox.

\n

This class will be extended by a persistence library\nwhich will override some of the methods with\nlibrary-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • getFilters
  • \n
  • detect
  • \n
  • columnsForType
  • \n
  • getRecords
  • \n
  • getRecordColumnValues
  • \n
  • getRecordKeywords
  • \n
  • getRecordFilterValues
  • \n
  • getRecordColor
  • \n
\n

The adapter will need to be registered\nin the application's container as dataAdapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "data-adapter",\n\n  initialize: function(application) {\n    application.register('data-adapter:main', DS.DataAdapter);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 300, + "description": "

Specifies how records can be filtered.\nRecords returned will need to have a filterValues\nproperty with a key for every name in the returned array.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getFilters", + "return": { + "description": "List of objects defining filters.\n The object should have a `name` and `desc` property.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 314, + "description": "

Fetch the model types and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchModelTypes", + "params": [ + { + "name": "typesAdded", + "description": "Callback to call to add types.\nTakes an array of objects containing wrapped types (returned from `wrapModelType`).", + "type": "Function" + }, + { + "name": "typesUpdated", + "description": "Callback to call when a type has changed.\nTakes an array of objects containing wrapped types.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 362, + "description": "

Fetch the records of a given type and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchRecords", + "params": [ + { + "name": "modelName", + "description": "The model name.", + "type": "String" + }, + { + "name": "recordsAdded", + "description": "Callback to call to add records.\nTakes an array of objects containing wrapped records.\nThe object should have the following properties:\n columnValues: {Object} The key and value of a table cell.\n object: {Object} The actual record object.", + "type": "Function" + }, + { + "name": "recordsUpdated", + "description": "Callback to call when a record has changed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + }, + { + "name": "recordsRemoved", + "description": "Callback to call when a record has removed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 434, + "description": "

Clear all observers before destruction

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 452, + "description": "

Detect whether a class is a model.

\n

Test that against the model class\nof your persistence library.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "detect", + "return": { + "description": "boolean Whether the class is a model class or not." + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 466, + "description": "

Get the columns for a given model type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "columnsForType", + "return": { + "description": "An array of columns of the following format:\n name: {String} The name of the column.\n desc: {String} Humanized description (what would show in a table column name).", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 479, + "description": "

Adds observers to a model type class.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "observeModelType", + "params": [ + { + "name": "modelName", + "description": "The model type name.", + "type": "String" + }, + { + "name": "typesUpdated", + "description": "Called when a type is modified.", + "type": "Function" + } + ], + "return": { + "description": "The function to call to remove observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 516, + "description": "

Wraps a given model type and observes changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapModelType", + "params": [ + { + "name": "klass", + "description": "A model class.", + "type": "Class" + }, + { + "name": "modelName", + "description": "Name of the class.", + "type": "String" + } + ], + "return": { + "description": "The wrapped type has the following format:\n name: {String} The name of the type.\n count: {Integer} The number of records available.\n columns: {Columns} An array of columns to describe the record.\n object: {Class} The actual Model type class.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 540, + "description": "

Fetches all models defined in the application.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getModelTypes", + "return": { + "description": "Array of model types.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 565, + "description": "

Loops over all namespaces and all objects\nattached to them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getObjectsOnNamespaces", + "return": { + "description": "Array of model type strings.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 594, + "description": "

Fetches all loaded records for a given type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecords", + "return": { + "description": "An array of records.\n This array will be observed for changes,\n so it should update when new records are added/removed.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 607, + "description": "

Wraps a record and observers changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapRecord", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The wrapped record. Format:\ncolumnValues: {Array}\nsearchKeywords: {Array}", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 627, + "description": "

Gets the values for each column.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColumnValues", + "return": { + "description": "Keys should match column names defined\nby the model type.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 639, + "description": "

Returns keywords to match when searching records.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordKeywords", + "return": { + "description": "Relevant keywords for search.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 650, + "description": "

Returns the values of filters defined by getFilters.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordFilterValues", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The filter values.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 662, + "description": "

Each record can have a color that represents its state.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColor", + "params": [ + { + "name": "record", + "description": "The record instance", + "type": "Object" + } + ], + "return": { + "description": "The records color.\n Possible options: black, red, blue, green.", + "type": "String" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 229, + "description": "

The container-debug-adapter which is used\nto list all models.

\n", + "itemtype": "property", + "name": "containerDebugAdapter", + "default": "undefined", + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 239, + "description": "

The number of attributes to send\nas columns. (Enough to make the record\nidentifiable).

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "attributeLimit", + "default": "3", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 251, + "description": "

Ember Data > v1.0.0-beta.18\nrequires string model names to be passed\naround instead of the actual factories.

\n

This is a stamp for the Ember Inspector\nto differentiate between the versions\nto be able to support older versions too.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "acceptsModelName", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 265, + "description": "

Map from records arrays to RecordsWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "recordsWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 273, + "description": "

Map from records arrays to TypeWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "typeWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 281, + "description": "

Callback that is currently scheduled on backburner end to flush and check\nall active watchers.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "flushWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 291, + "description": "

Stores all methods that clear observers.\nThese methods will be called on destruction.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "releaseMethods", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/debug/data-adapter", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.@ember/controller-227e94ea2e.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.@ember/controller-227e94ea2e.json new file mode 100644 index 000000000..15c4c6318 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.@ember/controller-227e94ea2e.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-4.9.3-Ember.@ember/controller", + "type": "class", + "attributes": { + "name": "Ember.@ember/controller", + "shortname": "@ember/controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember/controller", + "namespace": "Ember", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 344, + "description": "

Creates a property that lazily looks up another controller in the container.\nCan only be used when defining another controller.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default class PostController extends Controller {\n  @controller posts;\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default Controller.extend({\n  posts: controller()\n});
\n
\n
\n \n

This example will create a posts property on the post controller that\nlooks up the posts controller in the container, making it easy to reference\nother controllers.

\n", + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the controller to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "Ember.@ember/controller", + "module": "ember/controller" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.ActionHandler-3db5b8f9ce.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.ActionHandler-3db5b8f9ce.json new file mode 100644 index 000000000..0936b992f --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.ActionHandler-3db5b8f9ce.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-4.9.3-Ember.ActionHandler", + "type": "class", + "attributes": { + "name": "Ember.ActionHandler", + "shortname": "Ember.ActionHandler", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.CoreView", + "Ember.ControllerMixin" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 9, + "description": "

Ember.ActionHandler is available on some familiar classes including\nRoute, Component, and Controller.\n(Internally the mixin is used by Ember.CoreView, Ember.ControllerMixin,\nand Route and available to the above classes through\ninheritance.)

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.Controller-96b81cc927.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.Controller-96b81cc927.json new file mode 100644 index 000000000..6283098e7 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.Controller-96b81cc927.json @@ -0,0 +1,729 @@ +{ + "data": { + "id": "ember-4.9.3-Ember.Controller", + "type": "class", + "attributes": { + "name": "Ember.Controller", + "shortname": "Controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember/controller", + "namespace": "Ember", + "file": "packages/@ember/controller/index.ts", + "line": 335, + "extends": "EmberObject", + "uses": [ + "Ember.ControllerMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 91, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 169, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 264, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 285, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 36, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 54, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 63, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.ControllerMixin-6be9d232ce.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.ControllerMixin-6be9d232ce.json new file mode 100644 index 000000000..e2b24fab0 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.ControllerMixin-6be9d232ce.json @@ -0,0 +1,228 @@ +{ + "data": { + "id": "ember-4.9.3-Ember.ControllerMixin", + "type": "class", + "attributes": { + "name": "Ember.ControllerMixin", + "shortname": "Ember.ControllerMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.Controller" + ], + "module": "ember/controller", + "namespace": "Ember", + "file": "packages/@ember/controller/index.ts", + "line": 24, + "uses": [ + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 91, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 169, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 264, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 285, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 36, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 54, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 63, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.CoreView-2353d30d5c.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.CoreView-2353d30d5c.json new file mode 100644 index 000000000..ca2af8a04 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.CoreView-2353d30d5c.json @@ -0,0 +1,933 @@ +{ + "data": { + "id": "ember-4.9.3-Ember.CoreView", + "type": "class", + "attributes": { + "name": "Ember.CoreView", + "shortname": "Ember.CoreView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 9, + "description": "

Ember.CoreView is an abstract class that exists to give view-like behavior\nto both Ember's main view class Component and other classes that don't need\nthe full functionality of Component.

\n

Unless you have specific needs for CoreView, you will use Component\nin your applications.

\n", + "extends": "EmberObject", + "deprecated": true, + "deprecationMessage": "Use `Component` instead.", + "uses": [ + "Evented", + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 36, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 58, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 78, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 110, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 153, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 162, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 177, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 193, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 209, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 77, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 38, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.9.3-Component" + } + ] + }, + "module": { + "data": { + "id": "ember-4.9.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.EventDispatcher-a03b3fcbaa.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.EventDispatcher-a03b3fcbaa.json new file mode 100644 index 000000000..db0b19c20 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.EventDispatcher-a03b3fcbaa.json @@ -0,0 +1,174 @@ +{ + "data": { + "id": "ember-4.9.3-Ember.EventDispatcher", + "type": "class", + "attributes": { + "name": "Ember.EventDispatcher", + "shortname": "Ember.EventDispatcher", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 19, + "description": "

Ember.EventDispatcher handles delegating browser events to their\ncorresponding Ember.Views. For example, when you click on a view,\nEmber.EventDispatcher ensures that that view's mouseDown method gets\ncalled.

\n", + "access": "private", + "tagname": "", + "extends": "Ember.Object", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 114, + "description": "

Sets up event listeners for standard browser events.

\n

This will be called after the browser sends a DOMContentReady event. By\ndefault, it will set up all of the listeners on the document body. If you\nwould like to register the listeners on a different element, set the event\ndispatcher's root property.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "params": [ + { + "name": "addedEvents", + "description": "", + "type": "Object" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 208, + "description": "

Setup event listeners for the given browser event name

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForBrowserEvent", + "params": [ + { + "name": "event", + "description": "the name of the event in the browser" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 221, + "description": "

Setup event listeners for the given Ember event name (camel case)

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForEmberEvent", + "params": [ + { + "name": "eventName", + "description": "" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 238, + "description": "

Registers an event listener on the rootElement. If the given event is\ntriggered, the provided event handler will be triggered on the target view.

\n

If the target view does not implement the event handler, or if the handler\nreturns false, the parent view will be called. The event will continue to\nbubble to each successive parent view until it reaches the top.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandler", + "params": [ + { + "name": "rootElement", + "description": "", + "type": "Element" + }, + { + "name": "event", + "description": "the name of the event in the browser", + "type": "String" + }, + { + "name": "eventName", + "description": "the name of the method to call on the view", + "type": "String" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/system/action_manager.ts", + "line": 9, + "description": "

Global action id hash.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registeredActions", + "type": "Object", + "class": "Ember.EventDispatcher", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 31, + "description": "

The set of events names (and associated handler function names) to be setup\nand dispatched by the EventDispatcher. Modifications to this list can be done\nat setup time, generally via the Application.customEvents hash.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "events", + "type": "Object", + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 91, + "description": "

The root DOM element to which event listeners should be attached. Event\nlisteners will be attached to the document unless this is overridden.

\n

Can be specified as a DOMElement or a selector string.

\n

The default body is a string since this may be evaluated before document.body\nexists in the DOM.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.Object", + "type": "missing" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.NativeArray-5bef79fe04.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.NativeArray-5bef79fe04.json new file mode 100644 index 000000000..964a9afa7 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.NativeArray-5bef79fe04.json @@ -0,0 +1,1636 @@ +{ + "data": { + "id": "ember-4.9.3-Ember.NativeArray", + "type": "class", + "attributes": { + "name": "Ember.NativeArray", + "shortname": "Ember.NativeArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/array/index.ts", + "line": 2062, + "description": "

The NativeArray mixin contains the properties needed to make the native\nArray support MutableArray and all of its dependent APIs. Unless you\nhave EmberENV.EXTEND_PROTOTYPES or EmberENV.EXTEND_PROTOTYPES.Array set to\nfalse, this will be applied automatically. Otherwise you can apply the mixin\nat anytime by calling Ember.NativeArray.apply(Array.prototype).

\n", + "uses": [ + "Observable", + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1484, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1503, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1520, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1538, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1560, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1577, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1593, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1609, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1625, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1642, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1659, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1668, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1686, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1703, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1712, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1729, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.TargetActionSupport-969eb23226.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.TargetActionSupport-969eb23226.json new file mode 100644 index 000000000..14bc38175 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.TargetActionSupport-969eb23226.json @@ -0,0 +1,101 @@ +{ + "data": { + "id": "ember-4.9.3-Ember.TargetActionSupport", + "type": "class", + "attributes": { + "name": "Ember.TargetActionSupport", + "shortname": "Ember.TargetActionSupport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 11, + "description": "

Ember.TargetActionSupport is a mixin that can be included in a class\nto add a triggerAction method with semantics similar to the Handlebars\n{{action}} helper. In normal Ember usage, the {{action}} helper is\nusually the best choice. This mixin is most often useful when you are\ndoing more complex event handling in Components.

\n", + "extends": "Mixin", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 52, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/object/mixin.ts", + "line": 425, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "@ember/object/mixin", + "inherited": true, + "inheritedFrom": "Mixin" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-Mixin", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.Templates.components-4a13188ac1.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.Templates.components-4a13188ac1.json new file mode 100644 index 000000000..98ced4890 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.Templates.components-4a13188ac1.json @@ -0,0 +1,85 @@ +{ + "data": { + "id": "ember-4.9.3-Ember.Templates.components", + "type": "class", + "attributes": { + "name": "Ember.Templates.components", + "shortname": "Ember.Templates.components", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 66, + "description": "

The Input component lets you create an HTML <input> element.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value="987" />
\n
\n
\n \n

creates an <input> element with type="text" and value set to 987.

\n

Text field

\n

If no type argument is specified, a default of type 'text' is used.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Search:\n<Input @value={{this.searchWord}} />
\n
\n
\n \n

In this example, the initial value in the <input> will be set to the value of\nthis.searchWord. If the user changes the text, the value of this.searchWord will also be\nupdated.

\n

Actions

\n

The Input component takes a number of arguments with callbacks that are invoked in response to\nuser events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-down
  • \n
  • key-press
  • \n
  • key-up
  • \n
\n

These callbacks are passed to Input like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Starting with Ember Octane, we recommend using the {{on}} modifier to call actions\non specific events, such as the input event.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
<label for="input-name">Name:</label>\n<Input\n  @id="input-name"\n  @value={{this.name}}\n  {{on "input" this.validateName}}\n/>
\n
\n
\n \n

The event name (e.g. focusout, input, keydown) always follows the casing\nthat the HTML standard uses.

\n

<input> HTML Attributes to Avoid

\n

In most cases, if you want to pass an attribute to the underlying HTML <input> element, you\ncan pass the attribute directly, just like any other Ember component.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @type="text" size="10" />
\n
\n
\n \n

In this example, the size attribute will be applied to the underlying <input> element in the\noutputted HTML.

\n

However, there are a few attributes where you must use the @ version.

\n
    \n
  • @type: This argument is used to control which Ember component is used under the hood
  • \n
  • @value: The @value argument installs a two-way binding onto the element. If you wanted a\none-way binding, use <input> with the value property and the input event instead.
  • \n
  • @checked (for checkboxes): like @value, the @checked argument installs a two-way binding\nonto the element. If you wanted a one-way binding, use <input type="checkbox"> with\nchecked and the input event instead.
  • \n
\n

Extending TextField

\n

Internally, <Input @type="text" /> creates an instance of TextField, passing arguments from\nthe helper to TextField's create method. Subclassing TextField is supported but not\nrecommended.

\n

See TextField

\n

Checkbox

\n

To create an <input type="checkbox">:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Emberize Everything:\n<Input @type="checkbox" @checked={{this.isEmberized}} name="isEmberized" />
\n
\n
\n \n

This will bind the checked state of this checkbox to the value of isEmberized -- if either one\nchanges, it will be reflected in the other.

\n

Extending Checkbox

\n

Internally, <Input @type="checkbox" /> creates an instance of Checkbox. Subclassing\nTextField is supported but not recommended.

\n

See Checkbox

\n", + "itemtype": "method", + "name": "Input", + "see": [ + "{TextField}", + "{Checkbox}" + ], + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 42, + "description": "

The LinkTo component renders a link to the supplied routeName passing an optionally\nsupplied model to the route as its model context of the route. The block for LinkTo\nbecomes the contents of the rendered element:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

Disabling the LinkTo component

\n

The LinkTo component can be disabled by using the disabled argument. A disabled link\ndoesn't result in a transition when activated, and adds the disabled class to the <a>\nelement.

\n

(The class name to apply to the element can be overridden by using the disabledClass\nargument)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @disabled={{true}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

Handling href

\n

<LinkTo> will use your application's Router to fill the element's href property with a URL\nthat matches the path to the supplied routeName.

\n

Handling current route

\n

The LinkTo component will apply a CSS class name of 'active' when the application's current\nroute matches the supplied routeName. For example, if the application's current route is\n'photoGallery.recent', then the following invocation of LinkTo:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

will result in

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="active">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

The CSS class used for active classes can be customized by passing an activeClass argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent' @activeClass="current-url">\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="current-url">\n  Great Hamster Photos\n</a>
\n
\n
\n \n\n

If you need a link to be 'active' even when it doesn't match the current route, you can use the\ncurrent-when argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @current-when='photos'>\n  Photo Gallery\n</LinkTo>
\n
\n
\n \n

This may be helpful for keeping links active for:

\n
    \n
  • non-nested routes that are logically related
  • \n
  • some secondary menu approaches
  • \n
  • 'top navigation' with 'sub navigation' scenarios
  • \n
\n

A link will be active if current-when is true or the current\nroute is the route this link would transition to.

\n

To match multiple routes 'space-separate' the routes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='gallery' @current-when='photos drawings paintings'>\n  Art Gallery\n</LinkTo>
\n
\n
\n \n

Supplying a model

\n

An optional model argument can be used for routes whose\npaths contain dynamic segments. This argument will become\nthe model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", {path: "hamster-photos/:photo_id"});\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{this.aPhoto}}>\n  {{aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

Supplying multiple models

\n

For deep-linking to route paths that contain multiple\ndynamic segments, the models argument can be used.

\n

As the router transitions through the route path, each\nsupplied model argument will become the context for the\nroute with the dynamic segments:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() {\n    this.route("comment", {path: "comments/:comment_id"});\n  });\n});
\n
\n
\n \n

This argument will become the model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.comment' @models={{array this.aPhoto this.comment}}>\n  {{comment.body}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42/comments/718">\n  A+++ would snuggle again.\n</a>
\n
\n
\n \n

Supplying an explicit dynamic segment value

\n

If you don't have a model object available to pass to LinkTo,\nan optional string or integer argument can be passed for routes whose\npaths contain dynamic segments. This argument will become the value\nof the dynamic segment:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{aPhotoId}}>\n  {{this.aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

When transitioning into the linked route, the model hook will\nbe triggered with parameters including this passed identifier.

\n

Supplying query parameters

\n

If you need to add optional key-value pairs that appear to the right of the ? in a URL,\nyou can use the query argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @query={{hash page=1 per_page=20}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos?page=1&per_page=20">\n  Great Hamster Photos\n</a>
\n
\n
\n \n", + "itemtype": "method", + "name": "LinkTo", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 9, + "description": "

The Textarea component inserts a new instance of <textarea> tag into the template.

\n

The @value argument provides the content of the <textarea>.

\n

This template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value="A bunch of text" />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  A bunch of text\n</textarea>
\n
\n
\n \n

The @value argument is two-way bound. If the user types text into the textarea, the @value\nargument is updated. If the @value argument is updated, the text in the textarea is updated.

\n

In the following example, the writtenWords property on the component will be updated as the user\ntypes 'Lots of text' into the text area of their browser's window.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class WordEditorComponent extends Component {\n  @tracked writtenWords = "Lots of text that IS bound";\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{writtenWords}} />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  Lots of text that IS bound\n</textarea>
\n
\n
\n \n

If you wanted a one way binding, you could use the <textarea> element directly, and use the\nvalue DOM property and the input event.

\n

Actions

\n

The Textarea component takes a number of arguments with callbacks that are invoked in\nresponse to user events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-press
  • \n
\n

These callbacks are passed to Textarea like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Classic Invocation Syntax

\n

The Textarea component can also be invoked using curly braces, just like any other Ember\ncomponent.

\n

For example, this is an invocation using angle-bracket notation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

You could accomplish the same thing using classic invocation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{textarea value=this.searchWord enter=this.query}}
\n
\n
\n \n

The main difference is that angle-bracket invocation supports any HTML attribute using HTML\nattribute syntax, because attributes and arguments have different syntax when using angle-bracket\ninvocation. Curly brace invocation, on the other hand, only has a single syntax for arguments,\nand components must manually map attributes onto component arguments.

\n

When using classic invocation with {{textarea}}, only the following attributes are mapped onto\narguments:

\n
    \n
  • rows
  • \n
  • cols
  • \n
  • name
  • \n
  • selectionEnd
  • \n
  • selectionStart
  • \n
  • autocomplete
  • \n
  • wrap
  • \n
  • lang
  • \n
  • dir
  • \n
  • value
  • \n
\n

Classic layout and layoutName properties

\n

Because HTML textarea elements do not contain inner HTML the layout and\nlayoutName properties will not be applied.

\n", + "itemtype": "method", + "name": "Textarea", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.Templates.helpers-b4679d4a7b.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.Templates.helpers-b4679d4a7b.json new file mode 100644 index 000000000..623d0a807 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.Templates.helpers-b4679d4a7b.json @@ -0,0 +1,508 @@ +{ + "data": { + "id": "ember-4.9.3-Ember.Templates.helpers", + "type": "class", + "attributes": { + "name": "Ember.Templates.helpers", + "shortname": "Ember.Templates.helpers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 86, + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 45, + "description": "

See Ember.Templates.components.Input.

\n", + "itemtype": "method", + "name": "input", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 254, + "description": "

See Ember.Templates.components.LinkTo.

\n", + "itemtype": "method", + "name": "link-to", + "see": [ + "{Ember.Templates.components.LinkTo}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 122, + "description": "

See Ember.Templates.components.Textarea.

\n", + "itemtype": "method", + "name": "textarea", + "see": [ + "{Ember.Templates.components.Textarea}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/action.ts", + "line": 18, + "description": "

The {{action}} helper provides a way to pass triggers for behavior (usually\njust a function) between components, and into components from controllers.

\n

Passing functions with the action helper

\n

There are three contexts an action helper can be used in. The first two\ncontexts to discuss are attribute context, and Handlebars value context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>\n{{! Examples of Handlebars value context }}\n{{input on-input=(action "save")}}\n{{yield (action "refreshData") andAnotherParam}}
\n
\n
\n \n

In these contexts,\nthe helper is called a "closure action" helper. Its behavior is simple:\nIf passed a function name, read that function off the actions property\nof the current context. Once that function is read, or immediately if a function was\npassed, create a closure over that function and any arguments.\nThe resulting value of an action helper used this way is simply a function.

\n

For example, in the attribute context:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>
\n
\n
\n \n

The resulting template render logic would be:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
var div = document.createElement('div');\nvar actionFunction = (function(context){\n  return function() {\n    return context.actions.save.apply(context, arguments);\n  };\n})(context);\ndiv.onclick = actionFunction;
\n
\n
\n \n

Thus when the div is clicked, the action on that context is called.\nBecause the actionFunction is just a function, closure actions can be\npassed between components and still execute in the correct context.

\n

Here is an example action handler on a component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  save() {\n    this.model.save();\n  }\n}
\n
\n
\n \n

Actions are always looked up on the actions property of the current context.\nThis avoids collisions in the naming of common actions, such as destroy.\nTwo options can be passed to the action helper when it is used in this way.

\n
    \n
  • target=someProperty will look to someProperty instead of the current\ncontext for the actions hash. This can be useful when targeting a\nservice for actions.
  • \n
  • value="target.value" will read the path target.value off the first\nargument to the action when it is called and rewrite the first argument\nto be that value. This is useful when attaching actions to event listeners.
  • \n
\n

Invoking an action

\n

Closure actions curry both their scope and any arguments. When invoked, any\nadditional arguments are added to the already curried list.\nActions are presented in JavaScript as callbacks, and are\ninvoked like any other JavaScript function.

\n

For example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.hbs
1\n
{{input on-input=(action (action 'setName' @model) value="target.value")}}
\n
\n
\n \n

The first argument (@model) was curried over, and the run-time argument (event)\nbecomes a second argument. Action calls can be nested this way because each simply\nreturns a function. Any function can be passed to the {{action}} helper, including\nother actions.

\n

Actions invoked with sendAction have the same currying behavior as demonstrated\nwith on-input above. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyInput @submit={{action 'setName' @model}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-input submit=(action 'setName' @model)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    // Note that model is not passed, it was curried in the template\n    this.submit('bob');\n  }\n});
\n
\n
\n \n

Attaching actions to DOM elements

\n

The third context of the {{action}} helper can be called "element space".\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of element space }}\n<div {{action "save"}}></div>
\n
\n
\n \n

Used this way, the {{action}} helper provides a useful shortcut for\nregistering an HTML element in a template for a single DOM event and\nforwarding that interaction to the template's context (controller or component).\nIf the context of a template is a controller, actions used this way will\nbubble to routes when the controller does not implement the specified action.\nOnce an action hits a route, it will bubble through the route hierarchy.

\n

Event Propagation

\n

{{action}} helpers called in element space can control event bubbling. Note\nthat the closure style actions cannot.

\n

Events triggered through the action helper will automatically have\n.preventDefault() called on them. You do not need to do so in your event\nhandlers. If you need to allow event propagation (to handle file inputs for\nexample) you can supply the preventDefault=false option to the {{action}} helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<div {{action "sayHello" preventDefault=false}}>\n  <input type="file" />\n  <input type="checkbox" />\n</div>
\n
\n
\n \n

To disable bubbling, pass bubbles=false to the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<button {{action 'edit' post bubbles=false}}>Edit</button>
\n
\n
\n \n

To disable bubbling with closure style actions you must create your own\nwrapper helper that makes use of event.stopPropagation():

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div onclick={{disable-bubbling (action "sayHello")}}>Hello</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
bubbling.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { helper } from '@ember/component/helper';\n\nexport function disableBubbling([action]) {\n  return function(event) {\n    event.stopPropagation();\n    return action(event);\n  };\n}\nexport default helper(disableBubbling);
\n
\n
\n \n

If you need the default handler to trigger you should either register your\nown event handler, or use event methods on your view class. See\n"Responding to Browser Events"\nin the documentation for Component for more information.

\n

Specifying DOM event type

\n

{{action}} helpers called in element space can specify an event type.\nBy default the {{action}} helper registers for DOM click events. You can\nsupply an on option to the helper to specify a different DOM event name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" on="doubleClick"}}>\n  click me\n</div>
\n
\n
\n \n

See "Event Names" for a list of\nacceptable DOM event names.

\n

Specifying whitelisted modifier keys

\n

{{action}} helpers called in element space can specify modifier keys.\nBy default the {{action}} helper will ignore click events with pressed modifier\nkeys. You can supply an allowedKeys option to specify which keys should not be ignored.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="alt"}}>\n  click me\n</div>
\n
\n
\n \n

This way the action will fire when clicking with the alt key pressed down.\nAlternatively, supply "any" to the allowedKeys option to accept any combination of modifier keys.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="any"}}>\n  click me with any key pressed\n</div>
\n
\n
\n \n

Specifying a Target

\n

A target option can be provided to the helper to change\nwhich object will receive the method call. This option must be a path\nto an object, accessible in the current context:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<div {{action "anActionName" target=someService}}>\n  click me\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n
import Controller from '@ember/controller';\nimport { service } from '@ember/service';\n\nexport default class extends Controller {\n  @service someService;\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "action", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/array.ts", + "line": 5, + "description": "

Use the {{array}} helper to create an array to pass as an option to your\ncomponents.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<MyComponent @people={{array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson}}\n/>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{my-component people=(array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson)\n}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Tom Dale', 'Yehuda Katz', this.get('myOtherPerson')]
\n
\n
\n \n

Where the 3rd item in the array is bound to updates of the myOtherPerson property.

\n", + "itemtype": "method", + "name": "array", + "params": [ + { + "name": "options", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "Array", + "type": "Array" + }, + "since": "3.8.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/component.ts", + "line": 5, + "description": "

The {{component}} helper lets you add instances of Component to a\ntemplate. See Component for\nadditional information on how a Component functions.\n{{component}}'s primary use is for cases where you want to dynamically\nchange which type of component is rendered as the state of your application\nchanges. This helper has three modes: inline, block, and nested.

\n

Inline Form

\n

Given the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/application.hbs
1\n
{{component this.infographicComponentName}}
\n
\n
\n \n

And the following application code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Controller from '@ember/controller';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

The live-updating-chart component will be appended when isMarketOpen is\ntrue, and the market-close-summary component will be appended when\nisMarketOpen is false. If the value changes while the app is running,\nthe component will be automatically swapped out accordingly.\nNote: You should not use this helper when you are consistently rendering the same\ncomponent. In that case, use standard component syntax, for example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LiveUpdatingChart />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{live-updating-chart}}
\n
\n
\n \n

Block Form

\n

Using the block form of this helper is similar to using the block form\nof a component. Given the following application template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
{{#component this.infographicComponentName}}\n  Last update: {{this.lastUpdateTimestamp}}\n{{/component}}
\n
\n
\n \n

The following controller code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Controller from '@ember/controller';\nimport { computed } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get lastUpdateTimestamp() {\n    return new Date();\n  }\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

And the following component template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
chart.hbs
1\n2\n
{{! chart }}\n{{yield}}
\n
\n
\n \n

The Last Update: {{this.lastUpdateTimestamp}} will be rendered in place of the {{yield}}.

\n

Nested Usage

\n

The component helper can be used to package a component path with initial attrs.\nThe included attrs can then be merged during the final invocation.\nFor example, given a person-form component with the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.hbs
1\n2\n3\n
{{yield (hash\n  nameInput=(component "my-input-component" value=@model.name placeholder="First Name")\n)}}
\n
\n
\n \n

When yielding the component via the hash helper, the component is invoked directly.\nSee the following snippet:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonForm as |form|>\n  <form.nameInput @placeholder="Username" />\n</PersonForm>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-form as |form|}}\n  {{form.nameInput placeholder="Username"}}\n{{/person-form}}
\n
\n
\n \n

Which outputs an input whose value is already bound to model.name and placeholder\nis "Username".

\n

When yielding the component without the hash helper use the component helper.\nFor example, below is a full-name component template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{yield (component "my-input-component" value=@model.name placeholder="Name")}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<FullName as |field|>\n  {{component field placeholder="Full name"}}\n</FullName>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#full-name as |field|}}\n  {{component field placeholder="Full name"}}\n{{/full-name}}
\n
\n
\n \n", + "itemtype": "method", + "name": "component", + "since": "1.11.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/concat.ts", + "line": 5, + "description": "

Concatenates the given arguments into a string.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{some-component name=(concat firstName " " lastName)}}\n\n{{! would pass name="<first name value> <last name value>" to the component}}
\n
\n
\n \n

or for angle bracket invocation, you actually don't need concat at all.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @name="{{firstName}} {{lastName}}" />
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "concat", + "since": "1.13.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 13, + "description": "

The {{#each}} helper loops over elements in a collection. It is an extension\nof the base Handlebars {{#each}} helper.

\n

The default behavior of {{#each}} is to yield its inner block once for every\nitem in an array passing the item as the first block parameter.

\n

Assuming the @developers argument contains this array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
[{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }];
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

The same rules apply to arrays of primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Yehuda', 'Tom', 'Paul']
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developerNames as |name|}}\n    <li>Hello, {{name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

During iteration, the index of each item in the array is provided as a second block\nparameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person index|}}\n    <li>Hello, {{person.name}}! You're number {{index}} in line</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

Specifying Keys

\n

In order to improve rendering speed, Ember will try to reuse the DOM elements\nwhere possible. Specifically, if the same item is present in the array both\nbefore and after the change, its DOM output will be reused.

\n

The key option is used to tell Ember how to determine if the items in the\narray being iterated over with {{#each}} has changed between renders. By\ndefault the item's object identity is used.

\n

This is usually sufficient, so in most cases, the key option is simply not\nneeded. However, in some rare cases, the objects' identities may change even\nthough they represent the same underlying data.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
people.map(person => {\n  return { ...person, type: 'developer' };\n});
\n
\n
\n \n

In this case, each time the people array is map-ed over, it will produce\nan new array with completely different objects between renders. In these cases,\nyou can help Ember determine how these objects related to each other with the\nkey option:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers key="name" as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

By doing so, Ember will use the value of the property specified (person.name\nin the example) to find a "match" from the previous render. That is, if Ember\nhas previously seen an object from the @developers array with a matching\nname, its DOM elements will be re-used.

\n

There are two special values for key:

\n
    \n
  • @index - The index of the item in the array.
  • \n
  • @identity - The item in the array itself.
  • \n
\n

{{else}} condition

\n

{{#each}} can have a matching {{else}}. The contents of this block will render\nif the collection is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<ul>\n  {{#each @developers as |person|}}\n    <li>{{person.name}} is available!</li>\n  {{else}}\n    <li>Sorry, nobody is available for this task.</li>\n  {{/each}}\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 124, + "description": "

The {{each-in}} helper loops over properties on an object.

\n

For example, given this component definition:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    "name": "Shelly Sails",\n    "age": 42\n  };\n}
\n
\n
\n \n

This template would display all properties on the developer\nobject in a list:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.hbs
1\n2\n3\n4\n5\n
<ul>\n  {{#each-in this.developer as |key value|}}\n    <li>{{key}}: {{value}}</li>\n  {{/each-in}}\n</ul>
\n
\n
\n \n

Outputting their name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<ul>\n  <li>name: Shelly Sails</li>\n  <li>age: 42</li>\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each-in", + "access": "public", + "tagname": "", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/fn.ts", + "line": 5, + "description": "

The fn helper allows you to ensure a function that you are passing off\nto another component, helper, or modifier has access to arguments that are\navailable in the template.

\n

For example, if you have an each helper looping over a number of items, you\nmay need to pass a function that expects to receive the item as an argument\nto a component invoked within the loop. Here's how you could use the fn\nhelper to pass both the function and its arguments together:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
listing.hbs
1\n2\n3\n
{{#each @items as |item|}}\n<DisplayItem @item=item @select={{fn this.handleSelected item}} />\n{{/each}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class ItemsList extends Component {\n  @action\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this case the display-item component will receive a normal function\nthat it can invoke. When it invokes the function, the handleSelected\nfunction will receive the item and any arguments passed, thanks to the\nfn helper.

\n

Let's take look at what that means in a couple circumstances:

\n
    \n
  • When invoked as this.args.select() the handleSelected function will\nreceive the item from the loop as its first and only argument.
  • \n
  • When invoked as this.args.select('foo') the handleSelected function\nwill receive the item from the loop as its first argument and the\nstring 'foo' as its second argument.
  • \n
\n

In the example above, we used @action to ensure that handleSelected is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class ItemsList extends Component {\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when handleSelected is invoked inside the display-item\ncomponent, it will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into fn!

\n

See also partial application.

\n", + "itemtype": "method", + "name": "fn", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/get.ts", + "line": 5, + "description": "

Dynamically look up a property on an object or an element in an array.\nThe second argument to {{get}} should have a string or number value,\nalthough it can be bound.

\n

For example, these two usages are equivalent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{this.developer.name}}\n{{get this.developer "name"}}
\n
\n
\n \n

If there were several facts about a person, the {{get}} helper can dynamically\npick one:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<DeveloperDetail @factName="language" />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.developer @factName}}
\n
\n
\n \n

For a more complex example, this template would allow the user to switch\nbetween showing the user's name and preferred coding language with a click:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n\n  @tracked currentFact = 'name'\n\n  @action\n  showFact(fact) {\n    this.currentFact = fact;\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
{{get this.developer this.currentFact}}\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

The {{get}} helper can also respect mutable values itself. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
<Input @value={{mut (get this.person this.currentFact)}} />\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

Would allow the user to swap what fact is being displayed, and also edit\nthat fact via a two-way mutable binding.

\n

The {{get}} helper can also be used for array element access via index.\nThis would display the value of the first element in the array this.names:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names 0}}
\n
\n
\n \n

Array element access also works with a dynamic second argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names @index}}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "get", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/hash.ts", + "line": 5, + "description": "

Use the {{hash}} helper to create a hash to pass as an option to your\ncomponents. This is specially useful for contextual components where you can\njust yield a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{yield (hash\n   name='Sarah'\n   title=office\n)}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ name: 'Sarah', title: this.get('office') }
\n
\n
\n \n

Where the title is bound to updates of the office property.

\n

Note that the hash is an empty object with no prototype chain, therefore\ncommon methods like toString are not available in the resulting hash.\nIf you need to use such a method, you can use the call or apply\napproach:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
function toString(obj) {\n  return Object.prototype.toString.apply(obj);\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "Hash", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/helper.ts", + "line": 5, + "description": "

Use the {{helper}} helper to create contextual helper so\nthat it can be passed around as first-class values in templates.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let (helper "join-words" "foo" "bar" separator=" ") as |foo-bar|}}\n\n  {{!-- this is equivalent to invoking `{{join-words "foo" "bar" separator=" "}}` --}}\n  {{foo-bar}}\n\n  {{!-- this will pass the helper itself into the component, instead of invoking it now --}}\n  <MyComponent @helper={{helper foo-bar "baz"}} />\n\n  {{!-- this will yield the helper itself ("contextual helper"), instead of invoking it now --}}\n  {{yield foo-bar}}\n{{/let}}
\n
\n
\n \n

Arguments

\n

The {{helper}} helper works similarly to the {{component}} and\n{{modifier}} helper:

\n
    \n
  • When passed a string (e.g. (helper "foo")) as the first argument,\nit will produce an opaque, internal "helper definition" object\nthat can be passed around and invoked elsewhere.

    \n
  • \n
  • Any additional positional and/or named arguments (a.k.a. params and hash)\nwill be stored ("curried") inside the definition object, such that, when invoked,\nthese arguments will be passed along to the referenced helper.

    \n
  • \n
\n", + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "3.27.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 5, + "description": "

The if helper allows you to conditionally render one of two branches,\ndepending on the "truthiness" of a property.\nFor example the following values are all falsey: false, undefined, null, "", 0, NaN or an empty array.

\n

This helper has two forms, block and inline.

\n

Block form

\n

You can use the block form of if to conditionally render a section of the template.

\n

To use it, pass the conditional value to the if helper,\nusing the block form to wrap the section of template you want to conditionally render.\nLike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n
{{! will not render because greeting is undefined}}\n{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{/if}}
\n
\n
\n \n

You can also define what to show if the property is falsey by using\nthe else helper.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n
{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{else}}\n  No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

You are also able to combine else and if helpers to create more complex\nconditional logic.

\n

For the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if @isRaining}}\n Yes, grab an umbrella!\n{{else if @isCold}}\n Grab a coat, it's chilly!\n{{else}}\n No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

If you call it by saying isCold is true:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather @isCold={{true}} />
\n
\n
\n \n

Then Grab a coat, it's chilly! will be rendered.

\n

Inline form

\n

The inline if helper conditionally renders a single property or string.

\n

In this form, the if helper receives three arguments, the conditional value,\nthe value to render when truthy, and the value to render when falsey.

\n

For example, if useLongGreeting is truthy, the following:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{true}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{if @useLongGreeting "Hello" "Hi"}} Alex
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hello Alex
\n
\n
\n \n

One detail to keep in mind is that both branches of the if helper will be evaluated,\nso if you have {{if condition "foo" (expensive-operation "bar"),\nexpensive-operation will always calculate.

\n", + "itemtype": "method", + "name": "if", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 97, + "description": "

The unless helper is the inverse of the if helper. It displays if a value\nis falsey ("not true" or "is false"). Example values that will display with\nunless: false, undefined, null, "", 0, NaN or an empty array.

\n

Inline form

\n

The inline unless helper conditionally renders a single property or string.\nThis helper acts like a ternary operator. If the first property is falsy,\nthe second argument will be displayed, otherwise, the third argument will be\ndisplayed

\n

For example, if you pass a falsey useLongGreeting to the Greeting component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{false}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{unless @useLongGreeting "Hi" "Hello"}} Ben
\n
\n
\n \n

Then it will display:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hi Ben
\n
\n
\n \n

Block form

\n

Like the if helper, the unless helper also has a block form.

\n

The following will not render anything:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n2\n3\n
{{#unless @greeting}}\n  No greeting was found. Why not set one?\n{{/unless}}
\n
\n
\n \n

You can also use an else helper with the unless block. The\nelse will display if the value is truthy.

\n

If you have the following component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
in.hbs
1\n2\n3\n4\n5\n
{{#unless @userData}}\n  Please login.\n{{else}}\n  Welcome back!\n{{/unless}}
\n
\n
\n \n

Calling it with a truthy userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{hash username="Zoey"}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Welcome back!
\n
\n
\n \n

and calling it with a falsey userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{false}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Please login.
\n
\n
\n \n", + "itemtype": "method", + "name": "unless", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/log.ts", + "line": 5, + "description": "

log allows you to output the value of variables in the current rendering\ncontext. log also accepts primitive types such as strings or numbers.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{log "myVariable:" myVariable }}
\n
\n
\n \n", + "itemtype": "method", + "name": "log", + "params": [ + { + "name": "params", + "description": "", + "type": "Array" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/modifier.ts", + "line": 5, + "description": "

Use the {{modifier}} helper to create contextual modifier so\nthat it can be passed around as first-class values in templates.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let (modifier "click-outside" click=this.submit) as |on-click-outside|}}\n\n  {{!-- this is equivalent to `<MyComponent {{click-outside click=this.submit}} />` --}}\n  <MyComponent {{on-click-outside}} />\n\n  {{!-- this will pass the modifier itself into the component, instead of invoking it now --}}\n  <MyComponent @modifier={{modifier on-click-outside "extra" "args"}} />\n\n  {{!-- this will yield the modifier itself ("contextual modifier"), instead of invoking it now --}}\n  {{yield on-click-outside}}\n{{/let}}
\n
\n
\n \n

Arguments

\n

The {{modifier}} helper works similarly to the {{component}} and\n{{helper}} helper:

\n
    \n
  • When passed a string (e.g. (modifier "foo")) as the first argument,\nit will produce an opaque, internal "modifier definition" object\nthat can be passed around and invoked elsewhere.

    \n
  • \n
  • Any additional positional and/or named arguments (a.k.a. params and hash)\nwill be stored ("curried") inside the definition object, such that, when invoked,\nthese arguments will be passed along to the referenced modifier.

    \n
  • \n
\n", + "itemtype": "method", + "name": "modifier", + "access": "public", + "tagname": "", + "since": "3.27.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/mut.ts", + "line": 9, + "description": "

The mut helper lets you clearly specify that a child Component can update the\n(mutable) value passed to it, which will change the value of the parent component.

\n

To specify that a parameter is mutable, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{fn (mut totalClicks)}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(mut totalClicks)}}
\n
\n
\n \n

The child Component can then modify the parent's value just by modifying its own\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

Note that for curly components ({{my-component}}) the bindings are already mutable,\nmaking the mut unnecessary.

\n

Additionally, the mut helper can be combined with the fn helper to\nmutate a value. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=totalClicks click-count-change=(fn (mut totalClicks))}}
\n
\n
\n \n

The child Component would invoke the function with the new click value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.get('click-count-change')(this.get('childClickCount') + 1);\n  }\n});
\n
\n
\n \n

The mut helper changes the totalClicks value to what was provided as the fn argument.

\n

The mut helper, when used with fn, will return a function that\nsets the value passed to mut to its first argument. As an example, we can create a\nbutton that increments a value passing the value directly to the fn:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{! inc helper is not provided by Ember }}\n<button onclick={{fn (mut count) (inc count)}}>\n  Increment count\n</button>
\n
\n
\n \n", + "itemtype": "method", + "name": "mut", + "params": [ + { + "name": "attr", + "description": "the \"two-way\" attribute that can be modified.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/page-title.ts", + "line": 5, + "description": "

page-title allows you to set the title of any page in your application and\nappend additional titles for each route. For complete documentation, see\nhttps://github.com/ember-cli/ember-page-title.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{page-title "My Page Title" }}
\n
\n
\n \n", + "itemtype": "method", + "name": "page-title", + "params": [ + { + "name": "param", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/readonly.ts", + "line": 9, + "description": "

The readonly helper let's you specify that a binding is one-way only,\ninstead of two-way.\nWhen you pass a readonly binding from an outer context (e.g. parent component),\nto to an inner context (e.g. child component), you are saying that changing that\nproperty in the inner context does not change the value in the outer context.

\n

To specify that a binding is read-only, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n
export default Component.extend({\n  totalClicks: 3\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} // -> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Now, when you update childClickCount:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n
export default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

The value updates in the child component, but not the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClickCount}} //-> 4
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Objects and Arrays

\n

When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string),\nonly the reference to the object is protected using the readonly helper.\nThis means that you can change properties of the object both on the parent component, as well as the child component.\nThe readonly binding behaves similar to the const keyword in JavaScript.

\n

Let's look at an example:

\n

First let's set up the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  clicks: null,\n\n  init() {\n    this._super(...arguments);\n    this.set('clicks', { total: 3 });\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n

Now, if you update the total property of childClicks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    this.get('clicks').incrementProperty('total');\n  }\n});
\n
\n
\n \n

You will see the following happen:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClicks.total}} //-> 4
\n
\n
\n \n", + "itemtype": "method", + "name": "readonly", + "params": [ + { + "name": "attr", + "description": "the read-only attribute.", + "type": "Object", + "optional": true + } + ], + "access": "private", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unbound.ts", + "line": 10, + "description": "

The {{unbound}} helper disconnects the one-way binding of a property,\nessentially freezing its value at the moment of rendering. For example,\nin this example the display of the variable name will not change even\nif it is set with a new value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{unbound this.name}}
\n
\n
\n \n

Like any helper, the unbound helper can accept a nested helper expression.\nThis allows for custom helpers to be rendered unbound:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{unbound (some-custom-helper)}}\n{{unbound (capitalize this.name)}}\n{{! You can use any helper, including unbound, in a nested expression }}\n{{capitalize (unbound this.name)}}
\n
\n
\n \n

The unbound helper only accepts a single argument, and it return an\nunbound value.

\n", + "itemtype": "method", + "name": "unbound", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts", + "line": 5, + "description": "

Use the {{unique-id}} helper to generate a unique ID string suitable for use as\nan ID attribute in the DOM.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id={{unique-id}} type="email" />
\n
\n
\n \n

Each 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#let (unique-id) as |emailId|}}\n  <label for={{emailId}}>Email address</label>\n  <input id={{emailId}} type="email" />\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "unique-id", + "since": "4.4.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/modifiers/on.ts", + "line": 5, + "description": "

The {{on}} modifier lets you easily add event listeners (it uses\nEventTarget.addEventListener\ninternally).

\n

For example, if you'd like to run a function on your component when a <button>\nin the components template is clicked you might do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' this.saveLike}}>Like this post!</button>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class LikePostComponent extends Component {\n  @action\n  saveLike() {\n    // someone likes your post!\n    // better send a request off to your server...\n  }\n}
\n
\n
\n \n

Arguments

\n

{{on}} accepts two positional arguments, and a few named arguments.

\n

The positional arguments are:

\n
    \n
  • event -- the name to use when calling addEventListener
  • \n
  • callback -- the function to be passed to addEventListener
  • \n
\n

The named arguments are:

\n
    \n
  • capture -- a true value indicates that events of this type will be dispatched\nto the registered listener before being dispatched to any EventTarget beneath it\nin the DOM tree.
  • \n
  • once -- indicates that the listener should be invoked at most once after being\nadded. If true, the listener would be automatically removed when invoked.
  • \n
  • passive -- if true, indicates that the function specified by listener will never\ncall preventDefault(). If a passive listener does call preventDefault(), the user\nagent will do nothing other than generate a console warning. See\nImproving scrolling performance with passive listeners\nto learn more.
  • \n
\n

The callback function passed to {{on}} will receive any arguments that are passed\nto the event handler. Most commonly this would be the event itself.

\n

If you would like to pass additional arguments to the function you should use\nthe {{fn}} helper.

\n

For example, in our example case above if you'd like to pass in the post that\nwas being liked when the button is clicked you could do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' (fn this.saveLike @post)}}>Like this post!</button>
\n
\n
\n \n

In this case, the saveLike function will receive two arguments: the click event\nand the value of @post.

\n

Function Context

\n

In the example above, we used @action to ensure that likePost is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class LikePostComponent extends Component {\n  saveLike() {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when the button is clicked saveLike will be invoked,\nit will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into on!

\n", + "itemtype": "method", + "name": "on", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/in-element.ts", + "line": 5, + "description": "

The in-element helper renders its block content outside of the regular flow,\ninto a DOM element given by its destinationElement positional argument.

\n

Common use cases - often referred to as "portals" or "wormholes" - are rendering\ndropdowns, modals or tooltips close to the root of the page to bypass CSS overflow\nrules, or to render content to parts of the page that are outside of the control\nof the Ember app itself (e.g. embedded into a static or server rendered HTML page).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#in-element this.destinationElement}}\n  <div>Some content</div>\n{{/in-element}}
\n
\n
\n \n

Arguments

\n

{{in-element}} requires a single positional argument:

\n
    \n
  • destinationElement -- the DOM element to render into. It must exist at the time\nof rendering.
  • \n
\n

It also supports an optional named argument:

\n
    \n
  • insertBefore -- by default the DOM element's content is replaced when used as\ndestinationElement. Passing null changes the behaviour to appended at the end\nof any existing content. Any other value than null is currently not supported.
  • \n
\n", + "itemtype": "method", + "name": "in-element", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/let.ts", + "line": 5, + "description": "

The let helper receives one or more positional arguments and yields\nthem out as block params.

\n

This allows the developer to introduce shorter names for certain computations\nin the template.

\n

This is especially useful if you are passing properties to a component\nthat receives a lot of options and you want to clean up the invocation.

\n

For the following example, the template receives a post object with\ncontent and title properties.

\n

We are going to call the my-post component, passing a title which is\nthe title of the post suffixed with the name of the blog, the content\nof the post, and a series of options defined in-place.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n    (concat post.title ' | The Ember.js Blog')\n    post.content\n    (hash\n      theme="high-contrast"\n      enableComments=true\n    )\n    as |title content options|\n}}\n  <MyPost @title={{title}} @content={{content}} @options={{options}} />\n{{/let}}
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n  (concat post.title ' | The Ember.js Blog')\n  post.content\n  (hash\n    theme="high-contrast"\n    enableComments=true\n  )\n  as |title content options|\n}}\n{{my-post title=title content=content options=options}}\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "let", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/mount.ts", + "line": 16, + "description": "

The {{mount}} helper lets you embed a routeless engine in a template.\nMounting an engine will cause an instance to be booted and its application\ntemplate to be rendered.

\n

For example, the following template mounts the ember-chat engine:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! application.hbs }}\n{{mount "ember-chat"}}
\n
\n
\n \n

Additionally, you can also pass in a model argument that will be\nset as the engines model. This can be an existing object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div>\n  {{mount 'admin' model=userSettings}}\n</div>
\n
\n
\n \n

Or an inline hash, and you can even pass components:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>\n  <h1>Application template!</h1>\n  {{mount 'admin' model=(hash\n      title='Secret Admin'\n      signInButton=(component 'sign-in-button')\n  )}}\n</div>
\n
\n
\n \n", + "itemtype": "method", + "name": "mount", + "params": [ + { + "name": "name", + "description": "Name of the engine to mount.", + "type": "String" + }, + { + "name": "model", + "description": "Object that will be set as\n the model of the engine.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/outlet.ts", + "line": 22, + "description": "

The {{outlet}} helper lets you specify where a child route will render in\nyour template. An important use of the {{outlet}} helper is in your\napplication's application.hbs file:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n7\n8\n
<MyHeader />\n\n<div class="my-dynamic-content">\n  <!-- this content will change based on the current route, which depends on the current URL -->\n  {{outlet}}\n</div>\n\n<MyFooter />
\n
\n
\n \n

See the routing guide for more\ninformation on how your route interacts with the {{outlet}} helper.\nNote: Your content will not render if there isn't an {{outlet}} for it.

\n", + "itemtype": "method", + "name": "outlet", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 91, + "description": "

{{yield}} denotes an area of a template that will be rendered inside\nof another template.

\n

Use with Component

\n

When designing components {{yield}} is used to denote where, inside the component's\ntemplate, an optional block passed to the component should render:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<LabeledTextfield @value={{@model.name}}>\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<label>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n

Additionally you can yield properties into the context for use by the consumer:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n
<LabeledTextfield @value={{@model.validation}} @validator={{this.firstNameValidator}} as |validationError|>\n  {{#if validationError}}\n    <p class="error">{{validationError}}</p>\n  {{/if}}\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield this.validationError}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<label>\n  <p class="error">First Name must be at least 3 characters long.</p>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n

yield can also be used with the hash helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n
<DateRanges @value={{@model.date}} as |range|>\n  Start date: {{range.start}}\n  End date: {{range.end}}\n</DateRanges>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
ranges.hbs
1\n2\n3\n
<div>\n  {{yield (hash start=@value.start end=@value.end)}}\n</div>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<div>\n  Start date: July 1st\n  End date: July 30th\n</div>
\n
\n
\n \n

Multiple values can be yielded as block params:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |title subtitle body|>\n  <h1>{{title}}</h1>\n  <h2>{{subtitle}}</h2>\n  {{body}}\n</Banner>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner.hbs
1\n2\n3\n
<div>\n  {{yield "Hello title" "hello subtitle" "body text"}}\n</div>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h1>Hello title</h1>\n  <h2>hello subtitle</h2>\n  body text\n</div>
\n
\n
\n \n

However, it is preferred to use the hash helper, as this can prevent breaking changes to your component and also simplify the api for the component.

\n

Multiple components can be yielded with the hash and component helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |banner|>\n  <banner.Title>Banner title</banner.Title>\n  <banner.Subtitle>Banner subtitle</banner.Subtitle>\n  <banner.Body>A load of body text</banner.Body>\n</Banner>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Title from './banner/title';\nimport Subtitle from './banner/subtitle';\nimport Body from './banner/body';\n\nexport default class Banner extends Component {\n  Title = Title;\n  Subtitle = Subtitle;\n  Body = Body;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner.hbs
1\n2\n3\n4\n5\n6\n7\n
<div>\n  {{yield (hash\n    Title=this.Title\n    Subtitle=this.Subtitle\n    Body=(component this.Body defaultArg="some value")\n  )}}\n</div>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h1>Banner title</h1>\n  <h2>Banner subtitle</h2>\n  A load of body text\n</div>
\n
\n
\n \n

A benefit of using this pattern is that the user of the component can change the order the components are displayed.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |banner|>\n  <banner.Subtitle>Banner subtitle</banner.Subtitle>\n  <banner.Title>Banner title</banner.Title>\n  <banner.Body>A load of body text</banner.Body>\n</Banner>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h2>Banner subtitle</h2>\n  <h1>Banner title</h1>\n  A load of body text\n</div>
\n
\n
\n \n

Another benefit to using yield with the hash and component helper\nis you can pass attributes and arguments to these components:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |banner|>\n  <banner.Subtitle class="mb-1">Banner subtitle</banner.Subtitle>\n  <banner.Title @variant="loud">Banner title</banner.Title>\n  <banner.Body>A load of body text</banner.Body>\n</Banner>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner/subtitle.hbs
1\n2\n3\n4\n
{{!-- note the use of ..attributes --}}\n<h2 ...attributes>\n  {{yield}}\n</h2>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner/title.hbs
1\n2\n3\n4\n5\n
{{#if (eq @variant "loud")}}\n    <h1 class="loud">{{yield}}</h1>\n{{else}}\n    <h1 class="quiet">{{yield}}</h1>\n{{/if}}
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h2 class="mb-1">Banner subtitle</h2>\n  <h1 class="loud">Banner title</h1>\n  A load of body text\n</div>
\n
\n
\n \n", + "itemtype": "method", + "name": "yield", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "return": { + "description": "HTML string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 303, + "description": "

{{(has-block)}} indicates if the component was invoked with a block.

\n

This component is invoked with a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component}}
\n
\n
\n \n

Using angle bracket invocation, this looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent>Hi Jen!</MyComponent> {{! with a block}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent/> {{! without a block}}
\n
\n
\n \n

This is useful when you want to create a component that can optionally take a block\nand then render a default template when it is not invoked with a block.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n
{{#if (has-block)}}\n  Welcome {{yield}}, we are happy you're here!\n{{else}}\n  Hey you! You're great!\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with a block", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 348, + "description": "

{{(has-block-params)}} indicates if the component was invoked with block params.

\n

This component is invoked with block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component as |favoriteFlavor|}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jenn!\n{{/my-component}}
\n
\n
\n \n

With angle bracket syntax, block params look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent as |favoriteFlavor|>\nHi Jen!\n</MyComponent>
\n
\n
\n \n

And without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent>\n  Hi Jen!\n</MyComponent>
\n
\n
\n \n

This is useful when you want to create a component that can render itself\ndifferently when it is not invoked with block params.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if (has-block-params)}}\n  Welcome {{yield this.favoriteFlavor}}, we're happy you're here and hope you\n  enjoy your favorite ice cream flavor.\n{{else}}\n  Welcome {{yield}}, we're happy you're here, but we're unsure what\n  flavor ice cream you would enjoy.\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block-params", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with block params", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 403, + "description": "

Execute the debugger statement in the current template's context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{debugger}}
\n
\n
\n \n

When using the debugger helper you will have access to a get function. This\nfunction retrieves values available in the context of the template.\nFor example, if you're wondering why a value {{foo}} isn't rendering as\nexpected within a template, you could place a {{debugger}} statement and,\nwhen the debugger; breakpoint is hit, you can attempt to retrieve this value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('foo')
\n
\n
\n \n

get is also aware of keywords. So in this situation

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#each this.items as |item|}}\n  {{debugger}}\n{{/each}}
\n
\n
\n \n

You'll be able to get values from the current item:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('item.name')
\n
\n
\n \n

You can also access the context of the view to make sure it is the object that\nyou expect:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> context
\n
\n
\n \n", + "itemtype": "method", + "name": "debugger", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.Test-88554b0c49.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.Test-88554b0c49.json new file mode 100644 index 000000000..639ff01f0 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.Test-88554b0c49.json @@ -0,0 +1,147 @@ +{ + "data": { + "id": "ember-4.9.3-Ember.Test", + "type": "class", + "attributes": { + "name": "Ember.Test", + "shortname": "Ember.Test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/ember-testing/lib/test.ts", + "line": 11, + "description": "

This is a container for an assortment of testing related functionality:

\n
    \n
  • Choose your default test adapter (for your framework of choice).
  • \n
  • Register/Unregister additional test helpers.
  • \n
  • Setup callbacks to be fired when the test helpers are injected into\nyour application.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/ember-testing/lib/test/on_inject_helpers.ts", + "line": 5, + "description": "

Used to register callbacks to be fired whenever App.injectTestHelpers\nis called.

\n

The callback will receive the current application as an argument.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import $ from 'jquery';\n\nEmber.Test.onInjectHelpers(function() {\n  $(document).ajaxSend(function() {\n    Test.pendingRequests++;\n  });\n\n  $(document).ajaxComplete(function() {\n    Test.pendingRequests--;\n  });\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "onInjectHelpers", + "params": [ + { + "name": "callback", + "description": "The function to be called.", + "type": "Function" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.ts", + "line": 32, + "description": "

This returns a thenable tailored for testing. It catches failed\nonSuccess callbacks and invokes the Ember.Test.adapter.exception\ncallback in the last chained then.

\n

This method should be returned by async helpers such as wait.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "promise", + "params": [ + { + "name": "resolver", + "description": "The function used to resolve the promise.", + "type": "Function" + }, + { + "name": "label", + "description": "An optional string for identifying the promise.", + "type": "String" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.ts", + "line": 50, + "description": "

Replacement for Ember.RSVP.resolve\nThe only difference is this uses\nan instance of Ember.Test.Promise

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "The", + "description": "value to resolve", + "type": "Mixed" + } + ], + "since": "1.2.0", + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/setup_for_testing.ts", + "line": 8, + "description": "

Sets Ember up for testing. This is useful to perform\nbasic setup steps in order to unit test.

\n

Use App.setupForTesting to perform integration tests (full\napplication testing).

\n", + "itemtype": "method", + "name": "setupForTesting", + "since": "1.5.0", + "access": "private", + "tagname": "", + "class": "Ember.Test", + "module": "@ember/test", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/test.ts", + "line": 24, + "description": "

Hash containing all known test helpers.

\n", + "itemtype": "property", + "name": "_helpers", + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/ember-testing/lib/test.ts", + "line": 45, + "description": "

Used to allow ember-testing to communicate with a specific testing\nframework.

\n

You can manually set it before calling App.setupForTesting().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Ember.Test.adapter = MyCustomAdapter.create()
\n
\n
\n \n

If you do not set it, ember-testing will default to Ember.Test.QUnitAdapter.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "adapter", + "type": "{Class} The adapter to be used.", + "default": "Ember.Test.QUnitAdapter", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.ViewMixin-6ab42457b6.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.ViewMixin-6ab42457b6.json new file mode 100644 index 000000000..8343d95d6 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Ember.ViewMixin-6ab42457b6.json @@ -0,0 +1,322 @@ +{ + "data": { + "id": "ember-4.9.3-Ember.ViewMixin", + "type": "class", + "attributes": { + "name": "Ember.ViewMixin", + "shortname": "Ember.ViewMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 15, + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 93, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 121, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 141, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 181, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 246, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 331, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 405, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 439, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 300, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 308, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 321, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 345, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 358, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 366, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 35, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 166, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 267, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 378, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-EmberArray-07e1e73433.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-EmberArray-07e1e73433.json new file mode 100644 index 000000000..098a3ebc6 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-EmberArray-07e1e73433.json @@ -0,0 +1,836 @@ +{ + "data": { + "id": "ember-4.9.3-EmberArray", + "type": "class", + "attributes": { + "name": "EmberArray", + "shortname": "EmberArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "MutableArray" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/array/index.ts", + "line": 219, + "description": "

This mixin implements Observer-friendly Array-like behavior. It is not a\nconcrete implementation, but it can be used up by other classes that want\nto appear like arrays.

\n

For example, ArrayProxy is a concrete class that can be instantiated to\nimplement array-like behavior. This class uses the Array Mixin by way of\nthe MutableArray mixin, which allows observable changes to be made to the\nunderlying array.

\n

This mixin defines methods specifically for collections that provide\nindex-ordered access to their contents. When you are designing code that\nneeds to accept any kind of Array-like object, you should use these methods\ninstead of Array primitives because these will properly notify observers of\nchanges to the array.

\n

Although these methods are efficient, they do add a layer of indirection to\nyour application so it is a good idea to use them only when you need the\nflexibility of using both true JavaScript arrays and "virtual" arrays such\nas controllers and collections.

\n

You can use the methods defined in this module to access and modify array\ncontents in an observable-friendly way. You can also be notified whenever\nthe membership of an array changes by using .observes('myArray.[]').

\n

To support EmberArray in your own class, you must override two\nprimitives to use it: length() and objectAt().

\n", + "uses": [ + "Enumerable" + ], + "since": "Ember 0.9.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-EmberObject-ba11cf0728.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-EmberObject-ba11cf0728.json new file mode 100644 index 000000000..accfd677d --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-EmberObject-ba11cf0728.json @@ -0,0 +1,596 @@ +{ + "data": { + "id": "ember-4.9.3-EmberObject", + "type": "class", + "attributes": { + "name": "EmberObject", + "shortname": "EmberObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/object/index.ts", + "line": 30, + "description": "

EmberObject is the main base class for all Ember objects. It is a subclass\nof CoreObject with the Observable mixin applied. For details,\nsee the documentation for each of these.

\n", + "extends": "CoreObject", + "uses": [ + "Observable" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.9.3-Ember.CoreView" + }, + { + "type": "class", + "id": "ember-4.9.3-Namespace" + }, + { + "type": "class", + "id": "ember-4.9.3-ArrayProxy" + }, + { + "type": "class", + "id": "ember-4.9.3-Ember.Controller" + }, + { + "type": "class", + "id": "ember-4.9.3-ContainerDebugAdapter" + }, + { + "type": "class", + "id": "ember-4.9.3-DataAdapter" + }, + { + "type": "class", + "id": "ember-4.9.3-EngineInstance" + }, + { + "type": "class", + "id": "ember-4.9.3-ObjectProxy" + }, + { + "type": "class", + "id": "ember-4.9.3-HashLocation" + }, + { + "type": "class", + "id": "ember-4.9.3-HistoryLocation" + }, + { + "type": "class", + "id": "ember-4.9.3-NoneLocation" + }, + { + "type": "class", + "id": "ember-4.9.3-Route" + }, + { + "type": "class", + "id": "ember-4.9.3-EmberRouter" + }, + { + "type": "class", + "id": "ember-4.9.3-Service" + } + ] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-EmberRouter-526f0b6750.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-EmberRouter-526f0b6750.json new file mode 100644 index 000000000..e5765c360 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-EmberRouter-526f0b6750.json @@ -0,0 +1,1192 @@ +{ + "data": { + "id": "ember-4.9.3-EmberRouter", + "type": "class", + "attributes": { + "name": "EmberRouter", + "shortname": "EmberRouter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/router", + "namespace": "", + "file": "packages/@ember/routing/router.ts", + "line": 140, + "description": "

The EmberRouter class manages the application state and URLs. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/router.ts", + "line": 219, + "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

The first parameter is the name of the route which is used by default as the\npath name as well.

\n

The 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\nsegments.
  • \n
  • resetNamespace: false by default; when nesting routes, ember will\ncombine the route names to form the fully-qualified route name, which is\nused with {{link-to}} or manually transitioning to routes. Setting\nresetNamespace: true will cause the route not to inherit from its\nparent route's names. This is handy for preventing extremely long route names.\nKeep in mind that the actual URL path behavior is still retained.
  • \n
\n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
Router.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
\n
\n \n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 554, + "description": "

Initializes the current router instance and sets up the change handling\nevent listeners used by the instances location implementation.

\n

A property named initialURL will be used to determine the initial URL.\nIf no value is found / will be used.

\n", + "itemtype": "method", + "name": "startRouting", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 677, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 722, + "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", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 749, + "description": "

Determines if the supplied route is currently active.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 761, + "description": "

An alternative form of isActive that doesn't require\nmanual concatenation of the arguments into a single\narray.

\n", + "itemtype": "method", + "name": "isActiveIntent", + "params": [ + { + "name": "routeName", + "description": "" + }, + { + "name": "models", + "description": "" + }, + { + "name": "queryParams", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 783, + "description": "

Does this router instance have the given route.

\n", + "itemtype": "method", + "name": "hasRoute", + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 794, + "description": "

Resets the state of the router by clearing the current route\nhandlers and deactivating them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 942, + "description": "

Serializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Arrray" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 972, + "description": "

Serializes the value of a query parameter based on a type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "type", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 990, + "description": "

Deserializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1018, + "description": "

Deserializes the value of a query parameter based on a default type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "defaultType", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1039, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_pruneDefaultQueryParamValues", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1120, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareQueryParams", + "params": [ + { + "name": "targetRouteName", + "description": "", + "type": "String" + }, + { + "name": "models", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + }, + { + "name": "keepDefaultQueryParamValues", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1147, + "description": "

Returns the meta information for the query params of a given route. This\nwill be overridden to allow support for lazy routes.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getQPMeta", + "params": [ + { + "name": "routeInfo", + "description": "", + "type": "RouteInfo" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1161, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_queryParamsFor", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1223, + "description": "

Maps all query param keys to their fully scoped property name of the form\ncontrollerName:propName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_fullyScopeQueryParams", + "params": [ + { + "name": "leafRouteName", + "description": "", + "type": "String" + }, + { + "name": "contexts", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1261, + "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.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_hydrateUnsuppliedQueryParams", + "params": [ + { + "name": "state", + "description": "", + "type": "TransitionState" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1432, + "description": "

Handles updating the paths and notifying any listeners of the URL\nchange.

\n

Triggers the router level didTransition hook.

\n

For example, to notify google analytics when the route changes,\nyou could use this hook. (Note: requires also including GA scripts, etc.)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "didTransition", + "access": "private", + "tagname": "", + "since": "1.2.0", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1469, + "description": "

Handles notifying any listeners of an impending URL\nchange.

\n

Triggers the router level willTransition hook.

\n", + "itemtype": "method", + "name": "willTransition", + "access": "private", + "tagname": "", + "since": "1.11.0", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/router.ts", + "line": 150, + "description": "

Represents the URL of the root of the application, often '/'. This prefix is\n assumed on all routes defined on this router.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 161, + "description": "

The location property determines the type of URL's that your\n application will use.

\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 history by the locationType setting of /config/environment.js

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1482, + "description": "

Represents the current URL.

\n", + "itemtype": "property", + "name": "url", + "type": "{String}", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/routing/router", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Engine-8591e7b717.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Engine-8591e7b717.json new file mode 100644 index 000000000..48b979066 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Engine-8591e7b717.json @@ -0,0 +1,499 @@ +{ + "data": { + "id": "ember-4.9.3-Engine", + "type": "class", + "attributes": { + "name": "Engine", + "shortname": "Engine", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/index.ts", + "line": 40, + "description": "

The Engine class contains core functionality for both applications and\nengines.

\n

Each engine manages a registry that's used for dependency injection and\nexposed through RegistryProxy.

\n

Engines also manage initializers and instance initializers.

\n

Engines can spawn EngineInstance instances via buildInstance().

\n", + "extends": "Ember.Namespace", + "uses": [ + "RegistryProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/engine/index.ts", + "line": 62, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 209, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 285, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 346, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 359, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 371, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 384, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 392, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 400, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 414, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 448, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Enginer" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 15, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "Engine", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/index.ts", + "line": 325, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 338, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Engine", + "module": "@ember/engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.Namespace", + "type": "missing" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.9.3-Application" + } + ] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-EngineInstance-9456711f8f.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-EngineInstance-9456711f8f.json new file mode 100644 index 000000000..32228a768 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-EngineInstance-9456711f8f.json @@ -0,0 +1,1003 @@ +{ + "data": { + "id": "ember-4.9.3-EngineInstance", + "type": "class", + "attributes": { + "name": "EngineInstance", + "shortname": "EngineInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/instance.ts", + "line": 37, + "description": "

The EngineInstance encapsulates all of the stateful aspects of a\nrunning Engine.

\n", + "access": "public", + "tagname": "", + "extends": "EmberObject", + "uses": [ + "RegistryProxyMixin", + "ContainerProxyMixin" + ], + "methods": [ + { + "file": "packages/@ember/engine/instance.ts", + "line": 50, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 97, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 163, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 180, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 210, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 15, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "RegistryProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 39, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 65, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 126, + "description": "

Given a fullName return a factory manager.

\n

This method returns a manager which can be used for introspection of the\n factory's class or for the creation of factory instances with initial\n properties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\n manually by the caller of .create(). Typically, this is done during the creating\n objects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/instance.ts", + "line": 58, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 31, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.9.3-ApplicationInstance" + } + ] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Evented-9140abcf3e.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Evented-9140abcf3e.json new file mode 100644 index 000000000..b41abce21 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Evented-9140abcf3e.json @@ -0,0 +1,190 @@ +{ + "data": { + "id": "ember-4.9.3-Evented", + "type": "class", + "attributes": { + "name": "Evented", + "shortname": "Evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.CoreView", + "Route", + "EmberRouter" + ], + "module": "@ember/object/evented", + "namespace": "", + "file": "packages/@ember/object/evented.ts", + "line": 10, + "description": "

This mixin allows for Ember objects to subscribe to and emit events.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/utils/person.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport Evented from '@ember/object/evented';\n\nexport default EmberObject.extend(Evented, {\n  greet() {\n    // ...\n    this.trigger('greet');\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
var person = Person.create();\n\nperson.on('greet', function() {\n  console.log('Our person has greeted');\n});\n\nperson.greet();\n\n// outputs: 'Our person has greeted'
\n
\n
\n \n

You can also chain multiple event subscriptions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
person.on('greet', function() {\n  console.log('Our person has greeted');\n}).one('greet', function() {\n  console.log('Offer one-time special');\n}).off('event', this, forgetThis);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/object/evented", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-HashLocation-3819338815.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-HashLocation-3819338815.json new file mode 100644 index 000000000..2cb6cefc3 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-HashLocation-3819338815.json @@ -0,0 +1,641 @@ +{ + "data": { + "id": "ember-4.9.3-HashLocation", + "type": "class", + "attributes": { + "name": "HashLocation", + "shortname": "HashLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/hash-location", + "namespace": "", + "file": "packages/@ember/routing/hash-location.ts", + "line": 10, + "description": "

HashLocation implements the location API using the browser's\nhash. At present, it relies on a hashchange event existing in the\nbrowser.

\n

Using HashLocation results in URLs with a # (hash sign) separating the\nserver side URL portion of the URL from the portion that is used by Ember.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'hash'\n});
\n
\n
\n \n

This will result in a posts.new url of /#/posts/new.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 50, + "access": "private", + "tagname": "Returns normalized location.hash", + "since": "1.5.1", + "itemtype": "method", + "name": "getHash", + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 62, + "description": "

Returns the normalized URL, constructed from location.hash.

\n

e.g. #/foo => /foo as well as #/foo#bar => /foo#bar.

\n

By convention, hashed paths must begin with a forward slash, otherwise they\nare not treated as a path so we can distinguish intent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 92, + "description": "

Set the location.hash and remembers what was set. This prevents\nonUpdateURL callbacks from triggering when the hash was set by\nHashLocation.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 106, + "description": "

Uses location.replace to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 121, + "description": "

Register a callback to be invoked when the hash changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 146, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 161, + "description": "

Cleans up the HashLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/routing/hash-location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Helper-4b33087d53.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Helper-4b33087d53.json new file mode 100644 index 000000000..fb108b4f2 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Helper-4b33087d53.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-4.9.3-Helper", + "type": "class", + "attributes": { + "name": "Helper", + "shortname": "Helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 47, + "description": "

Ember Helpers are functions that can compute values, and are used in templates.\nFor example, this code calls a helper named format-currency:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Cost @cents={{230}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/cost.hbs
1\n
<div>{{format-currency @cents currency="$"}}</div>
\n
\n
\n \n

Additionally a helper can be called as a nested helper.\nIn this example, we show the formatted currency value if the showMoney\nnamed argument is truthy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{if @showMoney (format-currency @cents currency="$")}}
\n
\n
\n \n

Helpers defined using a class must provide a compute function. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n6\n7\n
import Helper from '@ember/component/helper';\n\nexport default class extends Helper {\n  compute([cents], { currency }) {\n    return `${currency}${cents * 0.01}`;\n  }\n}
\n
\n
\n \n

Each time the input to a helper changes, the compute function will be\ncalled again.

\n

As instances, these helpers also have access to the container and will accept\ninjected dependencies.

\n

Additionally, class helpers can call recompute to force a new computation.

\n", + "extends": "CoreObject", + "access": "public", + "tagname": "", + "since": "1.13.0", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 93, + "description": "

Override this function when writing a class-based helper.

\n", + "itemtype": "method", + "name": "compute", + "params": [ + { + "name": "params", + "description": "The positional arguments to the helper", + "type": "Array" + }, + { + "name": "hash", + "description": "The named arguments to the helper", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 120, + "description": "

On a class-based helper, it may be useful to force a recomputation of that\nhelpers value. This is akin to rerender on a component.

\n

For example, this component will rerender when the currentUser on a\nsession service changes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
email.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Helper from '@ember/component/helper'\nimport { service } from '@ember/service'\nimport { observer } from '@ember/object'\n\nexport default Helper.extend({\n  session: service(),\n\n  onNewUser: observer('session.currentUser', function() {\n    this.recompute();\n  }),\n\n  compute() {\n    return this.get('session.currentUser.email');\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "recompute", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-HistoryLocation-49e9172b4d.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-HistoryLocation-49e9172b4d.json new file mode 100644 index 000000000..462aefe0d --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-HistoryLocation-49e9172b4d.json @@ -0,0 +1,707 @@ +{ + "data": { + "id": "ember-4.9.3-HistoryLocation", + "type": "class", + "attributes": { + "name": "HistoryLocation", + "shortname": "HistoryLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/history-location", + "namespace": "", + "file": "packages/@ember/routing/history-location.ts", + "line": 20, + "description": "

HistoryLocation implements the location API using the browser's\nhistory.pushState API.

\n

Using HistoryLocation results in URLs that are indistinguishable from a\nstandard URL. This relies upon the browser's history API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'history'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new.

\n

Keep in mind that your server must serve the Ember app at all the routes you\ndefine.

\n

Using HistoryLocation will also result in location states being recorded by\nthe browser history API with the following schema:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
window.history.state -> { path: '/', uuid: '3552e730-b4a6-46bd-b8bf-d8c3c1a97e0a' }
\n
\n
\n \n

This allows each in-app location state to be tracked uniquely across history\nstate changes via the uuid field.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/history-location.ts", + "line": 78, + "access": "private", + "tagname": "Returns normalized location.hash", + "itemtype": "method", + "name": "getHash", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 104, + "description": "

Used to set state on first call to setURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initState", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 125, + "description": "

Returns the current location.pathname without rootURL or baseURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 152, + "description": "

Uses history.pushState to update the url without a page reload.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 168, + "description": "

Uses history.replaceState to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 185, + "description": "

Pushes a new state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "pushState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 201, + "description": "

Replaces the current state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 217, + "description": "

Register a callback to be invoked whenever the browser\nhistory changes, including using forward and back buttons.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 242, + "description": "

Used when using {{action}} helper. The url is always appended to the rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "formatted url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 266, + "description": "

Cleans up the HistoryLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/history-location.ts", + "line": 70, + "description": "

Will be pre-pended to path upon state change

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/routing/history-location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Location-1e225d9147.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Location-1e225d9147.json new file mode 100644 index 000000000..ec3b5c0be --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Location-1e225d9147.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-4.9.3-Location", + "type": "class", + "attributes": { + "name": "Location", + "shortname": "Location", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/location", + "namespace": "", + "file": "packages/@ember/routing/location.ts", + "line": 21, + "description": "

Location returns an instance of the correct implementation of\nthe location API.

\n

Implementations

\n

You can pass an implementation name (hash, history, none, auto) to force a\nparticular implementation to be used in your application.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n

Location API

\n

Each location implementation must provide the following methods:

\n
    \n
  • implementation: returns the string name used to reference the implementation.
  • \n
  • getURL: returns the current URL.
  • \n
  • setURL(path): sets the current URL.
  • \n
  • replaceURL(path): replace the current URL (optional).
  • \n
  • onUpdateURL(callback): triggers the callback when the URL changes.
  • \n
  • formatURL(url): formats url to be placed into href attribute.
  • \n
  • detect() (optional): instructs the location to do any feature detection\n necessary. If the location needs to redirect to a different URL, it\n can cancel routing by setting the cancelRouterSetup property on itself\n to false.
  • \n
\n

Calling setURL or replaceURL will not trigger onUpdateURL callbacks.

\n

Custom implementation

\n

Ember scans app/locations/* for extending the Location API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import HistoryLocation from '@ember/routing/history-location';\n\nexport default class MyHistory {\n  implementation = 'my-custom-history';\n\n  constructor() {\n    this._history = HistoryLocation.create(...arguments);\n  }\n\n  create() {\n    return new this(...arguments);\n  }\n\n  pushState(path) {\n     this._history.pushState(path);\n  }\n}
\n
\n
\n \n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/location.ts", + "line": 82, + "description": "

This is deprecated in favor of using the container to lookup the location\nimplementation as desired.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
// Given a location registered as follows:\ncontainer.register('location:history-test', HistoryTestLocation);\n\n// You could create a new instance via:\ncontainer.lookup('location:history-test');
\n
\n
\n \n", + "itemtype": "method", + "name": "create", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "an instance of an implementation of the `location` API", + "type": "Object" + }, + "deprecated": true, + "deprecationMessage": "Use the container to lookup the location implementation that you\n need.", + "access": "private", + "tagname": "", + "class": "Location", + "module": "@ember/routing/location" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/routing/location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Mixin-95dd4a2b86.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Mixin-95dd4a2b86.json new file mode 100644 index 000000000..13aab7b51 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Mixin-95dd4a2b86.json @@ -0,0 +1,75 @@ +{ + "data": { + "id": "ember-4.9.3-Mixin", + "type": "class", + "attributes": { + "name": "Mixin", + "shortname": "Mixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/mixin", + "namespace": "", + "file": "packages/@ember/object/mixin.ts", + "line": 439, + "description": "

The Mixin class allows you to create mixins, whose properties can be\nadded to other classes. For instance,

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nconst EditableMixin = Mixin.create({\n  edit() {\n    console.log('starting to edit');\n    this.set('isEditing', true);\n  },\n  isEditing: false\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import EmberObject from '@ember/object';\nimport EditableMixin from '../mixins/editable';\n\n// Mix mixins into classes by passing them as the first arguments to\n// `.extend.`\nconst Comment = EmberObject.extend(EditableMixin, {\n  post: null\n});\n\nlet comment = Comment.create({\n  post: somePost\n});\n\ncomment.edit(); // outputs 'starting to edit'
\n
\n
\n \n

Note that Mixins are created with Mixin.create, not\nMixin.extend.

\n

Note that mixins extend a constructor's prototype so arrays and object literals\ndefined as properties will be shared amongst objects that implement the mixin.\nIf you want to define a property in a mixin that is not shared, you can define\nit either as a computed property or have it be created on initialization of the object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
// filters array will be shared amongst any object implementing mixin\nimport Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\nconst FilterableMixin = Mixin.create({\n  filters: A()\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\nimport { computed } from '@ember/object';\n\n// filters will be a separate array for every object implementing the mixin\nconst FilterableMixin = Mixin.create({\n  filters: computed(function() {\n    return A();\n  })\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\n// filters will be created as a separate array during the object's initialization\nconst Filterable = Mixin.create({\n  filters: null,\n\n  init() {\n    this._super(...arguments);\n    this.set("filters", A());\n  }\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/mixin.ts", + "line": 425, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Mixin", + "module": "@ember/object/mixin" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.9.3-Ember.TargetActionSupport" + } + ] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/object/mixin", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-MutableArray-cf1b6eb8d5.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-MutableArray-cf1b6eb8d5.json new file mode 100644 index 000000000..1e70dd0aa --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-MutableArray-cf1b6eb8d5.json @@ -0,0 +1,1240 @@ +{ + "data": { + "id": "ember-4.9.3-MutableArray", + "type": "class", + "attributes": { + "name": "MutableArray", + "shortname": "MutableArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "ArrayProxy" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/array/index.ts", + "line": 1463, + "description": "

This mixin defines the API for modifying array-like objects. These methods\ncan be applied only to a collection that keeps its items in an ordered set.\nIt builds upon the Array mixin and adds methods to modify the array.\nOne concrete implementations of this class include ArrayProxy.

\n

It is important to use the methods in this class to modify arrays so that\nchanges are observable. This allows the binding system in Ember to function\ncorrectly.

\n

Note that an Array can change even if it does not implement this mixin.\nFor example, one might implement a SparseArray that cannot be directly\nmodified, but if its underlying enumerable changes, it will change also.

\n", + "uses": [ + "MutableEnumerable", + "EmberArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/array/index.ts", + "line": 1484, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1503, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1520, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1538, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1560, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1577, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1593, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1609, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1625, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1642, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1659, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1668, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1686, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1703, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1712, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1729, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Namespace-80572768a4.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Namespace-80572768a4.json new file mode 100644 index 000000000..51a8b4be9 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Namespace-80572768a4.json @@ -0,0 +1,536 @@ +{ + "data": { + "id": "ember-4.9.3-Namespace", + "type": "class", + "attributes": { + "name": "Namespace", + "shortname": "Namespace", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application/namespace", + "namespace": "", + "file": "packages/@ember/application/namespace.ts", + "line": 20, + "description": "

A Namespace is an object usually used to contain other objects or methods\nsuch as an application or framework. Create a namespace anytime you want\nto define one of these new containers.

\n

Example Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
MyFramework = Ember.Namespace.create({\n  VERSION: '1.0.0'\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/application/namespace", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-NoneLocation-4c293ea8d5.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-NoneLocation-4c293ea8d5.json new file mode 100644 index 000000000..56829d8ba --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-NoneLocation-4c293ea8d5.json @@ -0,0 +1,639 @@ +{ + "data": { + "id": "ember-4.9.3-NoneLocation", + "type": "class", + "attributes": { + "name": "NoneLocation", + "shortname": "NoneLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/none-location", + "namespace": "", + "file": "packages/@ember/routing/none-location.ts", + "line": 9, + "description": "

NoneLocation does not interact with the browser. It is useful for\ntesting, or when you need to manage state with your Router, but temporarily\ndon't want it to muck with the URL (for example when you embed your\napplication in a larger page).

\n

Using NoneLocation causes Ember to not store the applications URL state\nin the actual URL. This is generally used for testing purposes, and is one\nof the changes made when calling App.setupForTesting().

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/none-location.ts", + "line": 54, + "description": "

Returns the current path without rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "path", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 71, + "description": "

Set the path and remembers what was set. Using this method\nto change the path will not invoke the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 83, + "description": "

Register a callback to be invoked when the path changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 96, + "description": "

Sets the path and calls the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "handleURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 108, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/none-location.ts", + "line": 30, + "description": "

Will be pre-pended to path.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/routing/none-location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-ObjectProxy-88d1a3960d.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-ObjectProxy-88d1a3960d.json new file mode 100644 index 000000000..4434fb6fb --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-ObjectProxy-88d1a3960d.json @@ -0,0 +1,571 @@ +{ + "data": { + "id": "ember-4.9.3-ObjectProxy", + "type": "class", + "attributes": { + "name": "ObjectProxy", + "shortname": "ObjectProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/proxy", + "namespace": "", + "file": "packages/@ember/object/proxy.ts", + "line": 8, + "description": "

ObjectProxy forwards all properties not defined by the proxy itself\nto a proxied content object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nlet exampleObject = EmberObject.create({\n  name: 'Foo'\n});\n\nlet exampleProxy = ObjectProxy.create({\n  content: exampleObject\n});\n\n// Access and change existing properties\nexampleProxy.get('name');          // 'Foo'\nexampleProxy.set('name', 'Bar');\nexampleObject.get('name');         // 'Bar'\n\n// Create new 'description' property on `exampleObject`\nexampleProxy.set('description', 'Foo is a whizboo baz');\nexampleObject.get('description');  // 'Foo is a whizboo baz'
\n
\n
\n \n

While content is unset, setting a property to be delegated will throw an\nError.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import ObjectProxy from '@ember/object/proxy';\n\nlet exampleProxy = ObjectProxy.create({\n  content: null,\n  flag: null\n});\nexampleProxy.set('flag', true);\nexampleProxy.get('flag');         // true\nexampleProxy.get('foo');          // undefined\nexampleProxy.set('foo', 'data');  // throws Error
\n
\n
\n \n

Delegated properties can be bound to and will change when content is updated.

\n

Computed properties on the proxy itself can depend on delegated properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { computed } from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nProxyWithComputedProperty = ObjectProxy.extend({\n  fullName: computed('firstName', 'lastName', function() {\n    var firstName = this.get('firstName'),\n        lastName = this.get('lastName');\n    if (firstName && lastName) {\n      return firstName + ' ' + lastName;\n    }\n    return firstName || lastName;\n  })\n});\n\nlet exampleProxy = ProxyWithComputedProperty.create();\n\nexampleProxy.get('fullName');  // undefined\nexampleProxy.set('content', {\n  firstName: 'Tom', lastName: 'Dale'\n}); // triggers property change for fullName on proxy\n\nexampleProxy.get('fullName');  // 'Tom Dale'
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "Ember.ProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 72, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 94, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/object/proxy", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Observable-d45600817c.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Observable-d45600817c.json new file mode 100644 index 000000000..5449c213b --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Observable-d45600817c.json @@ -0,0 +1,388 @@ +{ + "data": { + "id": "ember-4.9.3-Observable", + "type": "class", + "attributes": { + "name": "Observable", + "shortname": "Observable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "EmberObject" + ], + "module": "@ember/object/observable", + "namespace": "", + "file": "packages/@ember/object/observable.ts", + "line": 22, + "description": "

Overview

\n

This mixin provides properties and property observing functionality, core\nfeatures of the Ember object model.

\n

Properties and observers allow one object to observe changes to a\nproperty on another object. This is one of the fundamental ways that\nmodels, controllers and views communicate with each other in an Ember\napplication.

\n

Any object that has this mixin applied can be used in observer\noperations. That includes EmberObject and most objects you will\ninteract with as you write your Ember application.

\n

Note that you will not generally apply this mixin to classes yourself,\nbut you will use the features provided by this module frequently, so it\nis important to understand how to use it.

\n

Using get() and set()

\n

Because of Ember's support for bindings and observers, you will always\naccess properties using the get method, and set properties using the\nset method. This allows the observing objects to be notified and\ncomputed properties to be handled properly.

\n

More documentation about get and set are below.

\n

Observing Property Changes

\n

You typically observe property changes simply by using the observer\nfunction in classes that you write.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { observer } from '@ember/object';\nimport EmberObject from '@ember/object';\n\nEmberObject.extend({\n  valueObserver: observer('value', function(sender, key, value, rev) {\n    // Executes whenever the "value" property changes\n    // See the addObserver method for more information about the callback arguments\n  })\n});
\n
\n
\n \n

Although this is the most common way to add an observer, this capability\nis actually built into the EmberObject class on top of two methods\ndefined in this mixin: addObserver and removeObserver. You can use\nthese two methods to add and remove observers yourself if you need to\ndo so at runtime.

\n

To add an observer for a property, call:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
object.addObserver('propertyKey', targetObject, targetAction)
\n
\n
\n \n

This will call the targetAction method on the targetObject whenever\nthe value of the propertyKey changes.

\n

Note that if propertyKey is a computed property, the observer will be\ncalled when any of the property dependencies are changed, even if the\nresulting value of the computed property is unchanged. This is necessary\nbecause computed properties are not computed until get is called.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/object/observable", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Promise-ba66e387f5.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Promise-ba66e387f5.json new file mode 100644 index 000000000..9579cbff4 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Promise-ba66e387f5.json @@ -0,0 +1,246 @@ +{ + "data": { + "id": "ember-4.9.3-Promise", + "type": "class", + "attributes": { + "name": "Promise", + "shortname": "Promise", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 26, + "description": "

Promise objects represent the eventual result of an asynchronous operation. The\nprimary way of interacting with a promise is through its then method, which\nregisters callbacks to receive either a promise’s eventual value or the reason\nwhy the promise cannot be fulfilled.

\n

Terminology

\n
    \n
  • promise is an object or function with a then method whose behavior conforms to this specification.
  • \n
  • thenable is an object or function that defines a then method.
  • \n
  • value is any legal JavaScript value (including undefined, a thenable, or a promise).
  • \n
  • exception is a value that is thrown using the throw statement.
  • \n
  • reason is a value that indicates why a promise was rejected.
  • \n
  • settled the final resting state of a promise, fulfilled or rejected.
  • \n
\n

A promise can be in one of three states: pending, fulfilled, or rejected.

\n

Promises that are fulfilled have a fulfillment value and are in the fulfilled\nstate. Promises that are rejected have a rejection reason and are in the\nrejected state. A fulfillment value is never a thenable.

\n

Promises can also be said to resolve a value. If this value is also a\npromise, then the original promise's settled state will match the value's\nsettled state. So a promise that resolves a promise that rejects will\nitself reject, and a promise that resolves a promise that fulfills will\nitself fulfill.

\n

Basic Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
let promise = new Promise(function(resolve, reject) {\n  // on success\n  resolve(value);\n\n  // on failure\n  reject(reason);\n});\n\npromise.then(function(value) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Advanced Usage:

\n

Promises shine when abstracting away asynchronous interactions such as\nXMLHttpRequests.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
function getJSON(url) {\n  return new Promise(function(resolve, reject){\n    let xhr = new XMLHttpRequest();\n\n    xhr.open('GET', url);\n    xhr.onreadystatechange = handler;\n    xhr.responseType = 'json';\n    xhr.setRequestHeader('Accept', 'application/json');\n    xhr.send();\n\n    function handler() {\n      if (this.readyState === this.DONE) {\n        if (this.status === 200) {\n          resolve(this.response);\n        } else {\n          reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n        }\n      }\n    };\n  });\n}\n\ngetJSON('/posts.json').then(function(json) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Unlike callbacks, promises are great composable primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Promise.all([\n  getJSON('/posts'),\n  getJSON('/comments')\n]).then(function(values){\n  values[0] // => postsJSON\n  values[1] // => commentsJSON\n\n  return values;\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "params": [ + { + "name": "resolver", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "is_constructor": 1, + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/promise/all.js", + "line": 3, + "description": "

Promise.all accepts an array of promises, and returns a new promise which\nis fulfilled with an array of fulfillment values for the passed promises, or\nrejected with the reason of the first passed promise to be rejected. It casts all\nelements of the passed iterable to promises as it runs this algorithm.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Promise, { resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // The array here would be [ 1, 2, 3 ];\n});
\n
\n
\n \n

If any of the promises given to RSVP.all are rejected, the first promise\nthat is rejected will be given as an argument to the returned promises's\nrejection handler. For example:

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Promise, { resolve, reject } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error("2"));\nlet promise3 = reject(new Error("3"));\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(error) {\n  // error.message === "2"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "all", + "params": [ + { + "name": "entries", + "description": "array of promises", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all `promises` have been\nfulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "static": 1, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/race.js", + "line": 9, + "description": "

Promise.race returns a new promise which is settled in the same way as the\nfirst passed promise to settle.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 2');\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // result === 'promise 2' because it was resolved before promise1\n  // was resolved.\n});
\n
\n
\n \n

Promise.race is deterministic in that only the state of the first\nsettled promise matters. For example, even if other promises given to the\npromises array argument are resolved, but the first settled promise has\nbecome rejected before the other promises became fulfilled, the returned\npromise will become rejected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    reject(new Error('promise 2'));\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // Code here never runs\n}, function(reason){\n  // reason.message === 'promise 2' because promise 2 became rejected before\n  // promise 1 became fulfilled\n});
\n
\n
\n \n

An example real-world use case is implementing timeouts:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import Promise from 'rsvp';\n\nPromise.race([ajax('foo.json'), timeout(5000)])
\n
\n
\n \n", + "itemtype": "method", + "name": "race", + "static": 1, + "params": [ + { + "name": "entries", + "description": "array of promises to observe", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for describing the promise returned.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise which settles in the same way as the first passed\npromise to settle.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/reject.js", + "line": 6, + "description": "

Promise.reject returns a promise rejected with the passed reason.\nIt is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  reject(new Error('WHOOPS'));\n});\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = Promise.reject(new Error('WHOOPS'));\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/resolve.js", + "line": 6, + "description": "

Promise.resolve returns a promise that will become resolved with the\npassed value. It is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  resolve(1);\n});\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Promise from 'rsvp';\n\nlet promise = RSVP.Promise.resolve(1);\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "resolve", + "static": 1, + "params": [ + { + "name": "object", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 155, + "description": "

catch is simply sugar for then(undefined, onRejection) which makes it the same\nas the catch block of a try/catch statement.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
function findAuthor(){\n  throw new Error('couldn\\'t find that author');\n}\n\n// synchronous\ntry {\n  findAuthor();\n} catch(reason) {\n  // something went wrong\n}\n\n// async with promises\nfindAuthor().catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 187, + "description": "

finally will be invoked regardless of the promise's fate just as native\ntry/catch/finally behaves

\n

Synchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
findAuthor() {\n  if (Math.random() > 0.5) {\n    throw new Error();\n  }\n  return new Author();\n}\n\ntry {\n  return findAuthor(); // succeed or fail\n} catch(error) {\n  return findOtherAuthor();\n} finally {\n  // always runs\n  // doesn't affect the return value\n}
\n
\n
\n \n

Asynchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findAuthor().catch(function(reason){\n  return findOtherAuthor();\n}).finally(function(){\n  // author was either found, or not\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 248, + "description": "

The primary way of interacting with a promise is through its then method,\nwhich registers callbacks to receive either a promise's eventual value or the\nreason why the promise cannot be fulfilled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function(user){\n  // user is available\n}, function(reason){\n  // user is unavailable, and you are given the reason why\n});
\n
\n
\n \n

Chaining

\n

The return value of then is itself a promise. This second, 'downstream'\npromise is resolved with the return value of the first promise's fulfillment\nor rejection handler, or rejected if the handler throws an exception.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
findUser().then(function (user) {\n  return user.name;\n}, function (reason) {\n  return 'default name';\n}).then(function (userName) {\n  // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n  // will be `'default name'`\n});\n\nfindUser().then(function (user) {\n  throw new Error('Found user, but still unhappy');\n}, function (reason) {\n  throw new Error('`findUser` rejected and we\\'re unhappy');\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n  // If `findUser` rejected, `reason` will be '`findUser` rejected and we\\'re unhappy'.\n});
\n
\n
\n \n

If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
findUser().then(function (user) {\n  throw new PedagogicalException('Upstream error');\n}).then(function (value) {\n  // never reached\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // The `PedgagocialException` is propagated all the way down to here\n});
\n
\n
\n \n

Assimilation

\n

Sometimes the value you want to propagate to a downstream promise can only be\nretrieved asynchronously. This can be achieved by returning a promise in the\nfulfillment or rejection handler. The downstream promise will then be pending\nuntil the returned promise is settled. This is called assimilation.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // The user's comments are now available\n});
\n
\n
\n \n

If the assimliated promise rejects, then the downstream promise will also reject.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // If `findCommentsByAuthor` fulfills, we'll have the value here\n}, function (reason) {\n  // If `findCommentsByAuthor` rejects, we'll have the reason here\n});
\n
\n
\n \n

Simple Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let result;\n\ntry {\n  result = findResult();\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findResult(function(result, err){\n  if (err) {\n    // failure\n  } else {\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findResult().then(function(result){\n  // success\n}, function(reason){\n  // failure\n});
\n
\n
\n \n

Advanced Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let author, books;\n\ntry {\n  author = findAuthor();\n  books  = findBooksByAuthor(author);\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
function foundBooks(books) {\n\n}\n\nfunction failure(reason) {\n\n}\n\nfindAuthor(function(author, err){\n  if (err) {\n    failure(err);\n    // failure\n  } else {\n    try {\n      findBoooksByAuthor(author, function(books, err) {\n        if (err) {\n          failure(err);\n        } else {\n          try {\n            foundBooks(books);\n          } catch(reason) {\n            failure(reason);\n          }\n        }\n      });\n    } catch(error) {\n      failure(err);\n    }\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findAuthor().\n  then(findBooksByAuthor).\n  then(function(books){\n    // found books\n}).catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "onFulfillment", + "description": "", + "type": "Function" + }, + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-PromiseProxyMixin-cd6cc55779.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-PromiseProxyMixin-cd6cc55779.json new file mode 100644 index 000000000..c92eea66e --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-PromiseProxyMixin-cd6cc55779.json @@ -0,0 +1,186 @@ +{ + "data": { + "id": "ember-4.9.3-PromiseProxyMixin", + "type": "class", + "attributes": { + "name": "PromiseProxyMixin", + "shortname": "PromiseProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/promise-proxy-mixin", + "namespace": "", + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 47, + "description": "

A low level mixin making ObjectProxy promise-aware.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { resolve } from 'rsvp';\nimport $ from 'jquery';\nimport ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nlet ObjectPromiseProxy = ObjectProxy.extend(PromiseProxyMixin);\n\nlet proxy = ObjectPromiseProxy.create({\n  promise: resolve($.getJSON('/some/remote/data.json'))\n});\n\nproxy.then(function(json){\n   // the json\n}, function(reason) {\n   // the reason why you have no json\n});
\n
\n
\n \n

the proxy has bindable attributes which\ntrack the promises life cycle

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> true\nproxy.get('isSettled')  //=> false\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> false
\n
\n
\n \n

When the $.getJSON completes, and the promise is fulfilled\nwith json, the life cycle attributes will update accordingly.\nNote that $.getJSON doesn't return an ECMA specified promise,\nit is useful to wrap this with an RSVP.resolve so that it behaves\nas a spec compliant promise.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> false\nproxy.get('isSettled')   //=> true\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> true
\n
\n
\n \n

As the proxy is an ObjectProxy, and the json now its content,\nall the json properties will be available directly from the proxy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// Assuming the following json:\n{\n  firstName: 'Stefan',\n  lastName: 'Penner'\n}\n\n// both properties will accessible on the proxy\nproxy.get('firstName') //=> 'Stefan'\nproxy.get('lastName')  //=> 'Penner'
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 177, + "description": "

An alias to the proxied promise's then.

\n

See RSVP.Promise.then.

\n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 188, + "description": "

An alias to the proxied promise's catch.

\n

See RSVP.Promise.catch.

\n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 200, + "description": "

An alias to the proxied promise's finally.

\n

See RSVP.Promise.finally.

\n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 111, + "description": "

If the proxied promise is rejected this will contain the reason\nprovided.

\n", + "itemtype": "property", + "name": "reason", + "default": "null", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 121, + "description": "

Once the proxied promise has settled this will become false.

\n", + "itemtype": "property", + "name": "isPending", + "default": "true", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 129, + "description": "

Once the proxied promise has settled this will become true.

\n", + "itemtype": "property", + "name": "isSettled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 138, + "description": "

Will become true if the proxied promise is rejected.

\n", + "itemtype": "property", + "name": "isRejected", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 146, + "description": "

Will become true if the proxied promise is fulfilled.

\n", + "itemtype": "property", + "name": "isFulfilled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 155, + "description": "

The promise whose fulfillment value is being proxied by this object.

\n

This property must be specified upon creation, and should not be\nchanged once created.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nObjectProxy.extend(PromiseProxyMixin).create({\n  promise: <thenable>\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "promise", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/object/promise-proxy-mixin", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Registry-71dfb8d80c.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Registry-71dfb8d80c.json new file mode 100644 index 000000000..792a1c7a0 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Registry-71dfb8d80c.json @@ -0,0 +1,407 @@ +{ + "data": { + "id": "ember-4.9.3-Registry", + "type": "class", + "attributes": { + "name": "Registry", + "shortname": "Registry", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 57, + "description": "

A registry used to store factory and option information keyed\nby type.

\n

A Registry stores the factory and option information needed by a\nContainer to instantiate and cache objects.

\n

The API for Registry is still in flux and should not be considered stable.

\n", + "access": "private", + "tagname": "", + "since": "1.11.0", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 146, + "description": "

Creates a container based on this registry.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "container", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "created container", + "type": "Container" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 158, + "description": "

Registers a factory for later injection.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let registry = new Registry();\n\nregistry.register('model:user', Person, {singleton: false });\nregistry.register('fruit:favorite', Orange);\nregistry.register('communication:main', Email, {singleton: false});
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "factory", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 195, + "description": "

Unregister a fullName

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.register('model:user', User);\n\nregistry.resolve('model:user').create() instanceof User //=> true\n\nregistry.unregister('model:user')\nregistry.resolve('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 223, + "description": "

Given a fullName return the corresponding factory.

\n

By default resolve will retrieve the factory from\nthe registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let registry = new Registry();\nregistry.register('api:twitter', Twitter);\n\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n

Optionally the registry can be provided with a custom resolver.\nIf provided, resolve will first provide the custom resolver\nthe opportunity to resolve the fullName, otherwise it will fallback\nto the registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.resolver = function(fullName) {\n   // lookup via the module system of choice\n };\n\n// the twitter factory is added to the module system\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 264, + "description": "

A hook that can be used to describe how the resolver will\nattempt to find the factory.

\n

For example, the default Ember .describe returns the full\nclass name (including namespace) where Ember's resolver expects\nto find the fullName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "describe", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "described fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 287, + "description": "

A hook to enable custom fullName normalization behavior

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalizeFullName", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 305, + "description": "

Normalize a fullName based on the application's conventions

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalize", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 320, + "itemtype": "method", + "name": "makeToString", + "access": "private", + "tagname": "", + "params": [ + { + "name": "factory", + "description": "", + "type": "Any" + }, + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "toString function", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 338, + "description": "

Given a fullName check if the container is aware of its factory\nor singleton instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "the fullname of the request source (used for local lookups)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 357, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let registry = new Registry();\nlet container = registry.container();\n\n// if all of type `connection` must not be singletons\nregistry.optionsForType('connection', { singleton: false });\n\nregistry.register('connection:twitter', TwitterConnection);\nregistry.register('connection:facebook', FacebookConnection);\n\nlet twitter = container.lookup('connection:twitter');\nlet twitter2 = container.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = container.lookup('connection:facebook');\nlet facebook2 = container.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "optionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 398, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "options", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 471, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "knownForType", + "params": [ + { + "name": "type", + "description": "the type to iterate over", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 96, + "description": "

A backup registry for resolving registrations when no matches can be found.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "fallback", + "type": "Registry", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 104, + "description": "

An object that has a resolve method that resolves a name.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "resolver", + "type": "Resolver", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 112, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registrations", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 118, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_normalizeCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 125, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_resolveCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 132, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_options", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 139, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_typeOptions", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-RegistryProxyMixin-2e5044d4cd.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-RegistryProxyMixin-2e5044d4cd.json new file mode 100644 index 000000000..4b5630b77 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-RegistryProxyMixin-2e5044d4cd.json @@ -0,0 +1,285 @@ +{ + "data": { + "id": "ember-4.9.3-RegistryProxyMixin", + "type": "class", + "attributes": { + "name": "RegistryProxyMixin", + "shortname": "RegistryProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Engine", + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 45, + "description": "

RegistryProxyMixin is used to provide public access to specific\nregistry functionality.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 15, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 64, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Any" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 134, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 157, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 167, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 178, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 188, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 198, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 231, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "RegistryProxyMixin", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 241, + "description": "

Define a dependency injection onto a specific factory or all factories\nof a type.

\n

When Ember instantiates a controller, view, or other framework component\nit can attach a dependency to that component. This is often used to\nprovide services to a set of framework components.

\n

An example of providing a session object to all controllers:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { alias } from '@ember/object/computed';\nimport Application from '@ember/application';\nimport Controller from '@ember/controller';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet Session = EmberObject.extend({ isAuthenticated: false });\n\n// A factory must be registered before it can be injected\nApp.register('session:main', Session);\n\n// Inject 'session:main' onto all factories of the type 'controller'\n// with the name 'session'\nApp.inject('controller', 'session', 'session:main');\n\nApp.IndexController = Controller.extend({\n  isLoggedIn: alias('session.isAuthenticated')\n});
\n
\n
\n \n

Injections can also be performed on specific factories.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
App.inject(<full_name or type>, <property name>, <full_name>)\nApp.inject('route', 'source', 'source:main')\nApp.inject('route:application', 'email', 'model:email')
\n
\n
\n \n

It is important to note that injections can only be performed on\nclasses that are instantiated by Ember itself. Instantiating a class\ndirectly (via create or new) bypasses the dependency injection\nsystem.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "inject", + "params": [ + { + "name": "factoryNameOrType", + "description": "", + "type": "String" + }, + { + "name": "property", + "description": "", + "type": "String" + }, + { + "name": "injectionName", + "description": "", + "type": "String" + } + ], + "deprecated": true, + "class": "RegistryProxyMixin", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Route-7fb7f0ac0c.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Route-7fb7f0ac0c.json new file mode 100644 index 000000000..974aec1a2 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Route-7fb7f0ac0c.json @@ -0,0 +1,1706 @@ +{ + "data": { + "id": "ember-4.9.3-Route", + "type": "class", + "attributes": { + "name": "Route", + "shortname": "Route", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/route", + "namespace": "", + "file": "packages/@ember/routing/route.ts", + "line": 76, + "description": "

The Route class is used to define individual routes. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented", + "ActionHandler" + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/route.ts", + "line": 302, + "description": "

A hook you can implement to convert the route's model into parameters\nfor the URL.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model({ post_id }) {\n    // the server returns `{ id: 12 }`\n    return fetch(`/posts/${post_id}`;\n  }\n\n  serialize(model) {\n    // this will make the URL `/posts/12`\n    return { post_id: model.id };\n  }\n}
\n
\n
\n \n

The default serialize method will insert the model's id into the\nroute's dynamic segment (in this case, :post_id) if the segment contains '_id'.\nIf the route has multiple dynamic segments or does not contain '_id', serialize\nwill return getProperties(model, params)

\n

This method is called when transitionTo is called with a context\nin order to populate the URL.

\n", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "model", + "description": "the routes model", + "type": "Object" + }, + { + "name": "params", + "description": "an Array of parameter names for the current\n route (in the example, `['post_id']`.", + "type": "Array" + } + ], + "return": { + "description": "the serialized parameters", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 539, + "description": "

Sets the name for this route, including a fully resolved name for routes\ninside engines.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_setRouteName", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 554, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_stashNames", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 597, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_updatingQPChanged", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 605, + "description": "

Returns a hash containing the parameters of an ancestor route.

\n

You may notice that this.paramsFor sometimes works when referring to a\nchild route, but this behavior should not be relied upon as only ancestor\nroutes are certain to be loaded in time.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('member', { path: ':name' }, function() {\n    this.route('interest', { path: ':interest' });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class MemberRoute extends Route {\n  queryParams = {\n    memberQp: { refreshModel: true }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member/interest.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default class MemberInterestRoute extends Route {\n  queryParams = {\n    interestQp: { refreshModel: true }\n  }\n\n  model() {\n    return this.paramsFor('member');\n  }\n}
\n
\n
\n \n

If we visit /turing/maths?memberQp=member&interestQp=interest the model for\nthe member.interest route is a hash with:

\n
    \n
  • name: turing
  • \n
  • memberQp: member
  • \n
\n", + "itemtype": "method", + "name": "paramsFor", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "return": { + "description": "hash containing the parameters of the route `name`", + "type": "Object" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 686, + "description": "

Serializes the query parameter key

\n", + "itemtype": "method", + "name": "serializeQueryParamKey", + "params": [ + { + "name": "controllerPropertyName", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 697, + "description": "

Serializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 713, + "description": "

Deserializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 745, + "description": "

A hook you can use to reset controller values either when the model\nchanges or the route is exiting.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/articles.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class ArticlesRoute extends Route {\n  resetController(controller, isExiting, transition) {\n    if (isExiting && transition.targetName !== 'error') {\n      controller.set('page', 1);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "resetController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "isExiting", + "description": "", + "type": "Boolean" + }, + { + "name": "transition", + "description": "", + "type": "Object" + } + ], + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 772, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "exit", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 783, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_internalReset", + "since": "3.6.0", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 797, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "enter", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 848, + "description": "

This hook is executed when the router completely exits this route. It is\nnot executed when the model for the route changes.

\n", + "itemtype": "method", + "name": "deactivate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 859, + "description": "

This hook is executed when the router enters the route. It is not executed\nwhen the model for the route changes.

\n", + "itemtype": "method", + "name": "activate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 870, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogPosts');\nthis.transitionTo('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
this.transitionTo('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('blogPost', { path:':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
this.transitionTo('blogComment', aPost, aComment);\nthis.transitionTo('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
this.transitionTo('/');\nthis.transitionTo('/blog/post/1/comment/13');\nthis.transitionTo('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
this.transitionTo('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\nthis.transitionTo({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceWith.

\n

Simple Transition Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n  this.route('fourOhFour', { path: '*:' });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToSecret(context) {\n    if (authorized()) {\n      this.transitionTo('secret', context);\n    } else {\n      this.transitionTo('fourOhFour');\n    }\n  }\n}
\n
\n
\n \n

Transition to a nested route

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('articles', { path: '/articles' }, function() {\n    this.route('new');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToNewArticle() {\n    this.transitionTo('articles.new');\n  }\n}
\n
\n
\n \n

Multiple Models Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n\n  this.route('breakfast', { path: ':breakfastId' }, function() {\n    this.route('cereal', { path: ':cerealId' });\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  moveToChocolateCereal() {\n    let cereal = { cerealId: 'ChocolateYumminess' };\n    let breakfast = { breakfastId: 'CerealAndMilk' };\n\n    this.transitionTo('breakfast.cereal', breakfast, cereal);\n  }\n}
\n
\n
\n \n

Nested Route with Query String Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('fruits', function() {\n    this.route('apples');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default class IndexRoute extends Route {\n  @action\n  transitionToApples() {\n    this.transitionTo('fruits.apples', { queryParams: { color: 'red' } });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL.", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1068, + "description": "

Perform a synchronous transition into another route without attempting\nto resolve promises, update the URL, or abort any currently active\nasynchronous transitions (i.e. regular transitions caused by\ntransitionTo or URL changes).

\n

This method is handy for performing intermediate transitions on the\nway to a final destination route, and is called internally by the\ndefault implementations of the error and loading handlers.

\n", + "itemtype": "method", + "name": "intermediateTransitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) to be used while transitioning\nto the route.", + "type": "...Object" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1090, + "description": "

Refresh the model on this route and any child routes, firing the\nbeforeModel, model, and afterModel hooks in a similar fashion\nto how routes are entered when transitioning in from other route.\nThe current route params (e.g. article_id) will be passed in\nto the respective model hooks, and if a different model is returned,\nsetupController and associated route hooks will re-fire as well.

\n

An example usage of this method is re-querying the server for the\nlatest information using the same parameters as when the route\nwas first entered.

\n

Note that this will cause model hooks to fire even on routes\nthat were provided a model object when the route was initially\nentered.

\n", + "itemtype": "method", + "name": "refresh", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1116, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionTo in all other respects. See\n'transitionTo' for additional information regarding multiple models.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n  this.route('secret');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/secret.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class SecretRoute Route {\n  afterModel() {\n    if (!authorized()){\n      this.replaceWith('index');\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.0.0", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1164, + "description": "

This hook is the entry point for router.js

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1239, + "description": "

This hook is the first of the route entry validation hooks\ncalled when an attempt is made to transition into a route\nor one of its children. It is called before model and\nafterModel, and is appropriate for cases when:

\n
    \n
  1. A decision can be made to redirect elsewhere without\nneeding to resolve the model first.
  2. \n
  3. Any async operations need to occur first before the\nmodel is attempted to be resolved.
  4. \n
\n

This hook is provided the current transition attempt\nas a parameter, which can be used to .abort() the transition,\nsave it for a later .retry(), or retrieve values set\non it from a previous hook. You can also just call\nthis.transitionTo to another route to implicitly\nabort the transition.

\n

You can return a promise from this hook to pause the\ntransition until the promise resolves (or rejects). This could\nbe useful, for instance, for retrieving async code from\nthe server that is required to enter a route.

\n", + "itemtype": "method", + "name": "beforeModel", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1274, + "description": "

This hook is called after this route's model has resolved.\nIt follows identical async/promise semantics to beforeModel\nbut is provided the route's resolved model in addition to\nthe transition, and is therefore suited to performing\nlogic that can only take place after the model has already\nresolved.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n  afterModel(posts, transition) {\n    if (posts.get('length') === 1) {\n      this.transitionTo('post.show', posts.get('firstObject'));\n    }\n  }\n}
\n
\n
\n \n

Refer to documentation for beforeModel for a description\nof transition-pausing semantics when a promise is returned\nfrom this hook.

\n", + "itemtype": "method", + "name": "afterModel", + "params": [ + { + "name": "resolvedModel", + "description": "the value returned from `model`,\n or its resolved value if it was a promise", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1312, + "description": "

A hook you can implement to optionally redirect to another route.

\n

Calling this.transitionTo from inside of the redirect hook will\nabort the current transition (into the route that has implemented redirect).

\n

redirect and afterModel behave very similarly and are\ncalled almost at the same time, but they have an important\ndistinction when calling this.transitionTo to a child route\nof the current route. From afterModel, this new transition\ninvalidates the current transition, causing beforeModel,\nmodel, and afterModel hooks to be called again. But the\nsame transition started from redirect does not invalidate\nthe current transition. In other words, by the time the redirect\nhook has been called, both the resolved model and the attempted\nentry into this route are considered fully validated.

\n", + "itemtype": "method", + "name": "redirect", + "params": [ + { + "name": "model", + "description": "the model for this route", + "type": "Object" + }, + { + "name": "transition", + "description": "the transition object associated with the current transition", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1337, + "description": "

Called when the context is changed by router.js.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "contextDidChange", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1347, + "description": "

A hook you can implement to convert the URL into the model for\nthis route.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

The model for the post route is store.findRecord('post', params.post_id).

\n

By default, if your route has a dynamic segment ending in _id:

\n
    \n
  • The model class is determined from the segment (post_id's\nclass is App.Post)
  • \n
  • The find method is called on the model class with the value of\nthe dynamic segment.
  • \n
\n

Note that for routes with dynamic segments, this hook is not always\nexecuted. If the route is entered through a transition (e.g. when\nusing the link-to Handlebars helper or the transitionTo method\nof routes), and a model context is already provided this hook\nis not called.

\n

A model context does not include a primitive string or number,\nwhich does cause the model hook to be called.

\n

Routes without dynamic segments will always execute the model hook.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
// no dynamic segment, model hook always called\nthis.transitionTo('posts');\n\n// model passed in, so model hook not called\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost);\n\n// integer passed in, model hook is called\nthis.transitionTo('post', 1);\n\n// model id passed in, model hook is called\n// useful for forcing the hook to execute\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost.id);
\n
\n
\n \n

This hook follows the asynchronous/promise semantics\ndescribed in the documentation for beforeModel. In particular,\nif a promise returned from model fails, the error will be\nhandled by the error hook on Route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model(params) {\n    return this.store.findRecord('post', params.post_id);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "model", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route. If\n a promise is returned, the transition will pause until\n the promise resolves, and the resolved value of the promise\n will be used as the model for this route.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1462, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "deserialize", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route.\n\nRouter.js hook.", + "type": "Any | Promise" + }, + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1475, + "itemtype": "method", + "name": "findModel", + "params": [ + { + "name": "type", + "description": "the model type", + "type": "String" + }, + { + "name": "value", + "description": "the value passed to find", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1486, + "description": "

A hook you can use to setup the controller for the current route.

\n

This method is called with the controller for the current route and the\nmodel supplied by the model hook.

\n

By default, the setupController hook sets the model property of\nthe controller to the specified model when it is not undefined.

\n

If you implement the setupController hook in your Route, it will\nprevent this default behavior. If you want to preserve that behavior\nwhen implementing your setupController function, make sure to call\nsuper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/photos.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PhotosRoute extends Route {\n  model() {\n    return this.store.findAll('photo');\n  }\n\n  setupController(controller, model) {\n    super.setupController(controller, model);\n\n    this.controllerFor('application').set('showingPhotos', true);\n  }\n}
\n
\n
\n \n

The provided controller will be one resolved based on the name\nof this route.

\n

If no explicit controller is defined, Ember will automatically create one.

\n

As an example, consider the router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

If you have defined a file for the post controller,\nthe framework will use it.\nIf it is not defined, a basic Controller instance would be used.

\n", + "example": [ + " Behavior of a basic Controller\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, model) {\n controller.set('model', model);\n }\n});\n```" + ], + "itemtype": "method", + "name": "setupController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "model", + "description": "", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition", + "optional": true + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1562, + "description": "

Returns the controller of the current route, or a parent (or any ancestor)\nroute in a route hierarchy.

\n

The controller instance must already have been created, either through entering the\nassociated route or using generateController.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.controllerFor('posts').set('currentPost', post);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "controllerFor", + "params": [ + { + "name": "name", + "description": "the name of the route or controller", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Controller | undefined" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1616, + "description": "

Generates a controller for a route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class Post extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.generateController('posts');\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "generateController", + "params": [ + { + "name": "name", + "description": "the name of the controller", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1644, + "description": "

Returns the resolved model of a parent (or any ancestor) route\nin a route hierarchy. During a transition, all routes\nmust resolve a model object, and if a route\nneeds access to a parent route's model in order to\nresolve a model (or just reuse the model from a parent),\nit can call this.modelFor(theNameOfParentRoute) to\nretrieve it. If the ancestor route's model was a promise,\nits resolved result is returned.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' }, function() {\n    this.route('comments');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post/comments.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostCommentsRoute extends Route {\n  model() {\n    let post = this.modelFor('post');\n\n    return post.comments;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "modelFor", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "the model object", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1716, + "description": "

this[RENDER] is used to render a template into a region of another template\n(indicated by an {{outlet}}).

\n", + "itemtype": "method", + "name": "this[RENDER]", + "params": [ + { + "name": "name", + "description": "the name of the template to render", + "type": "String" + }, + { + "name": "options", + "description": "the options", + "type": "Object", + "optional": true, + "props": [ + { + "name": "into", + "description": "the template to render into,\n referenced by name. Defaults to the parent template", + "type": "String", + "optional": true + }, + { + "name": "outlet", + "description": "the outlet inside `options.into` to render into.\n Defaults to 'main'", + "type": "String", + "optional": true + }, + { + "name": "controller", + "description": "the controller to use for this template,\n referenced by name or as a controller instance. Defaults to the Route's paired controller", + "type": "String|Object", + "optional": true + }, + { + "name": "model", + "description": "the model object to set on `options.controller`.\n Defaults to the return value of the Route's model hook", + "type": "Object", + "optional": true + } + ] + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1743, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "teardownViews", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1756, + "description": "

Allows you to produce custom metadata for the route.\nThe return value of this method will be attached to\nits corresponding RouteInfoWithAttributes object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostsIndexRoute extends Route {\n  buildRouteInfoMetadata() {\n    return { title: 'Posts Page' }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service router\n\n  constructor() {\n    super(...arguments);\n\n    this.router.on('routeDidChange', transition => {\n      document.title = transition.to.metadata.title;\n      // would update document's title to "Posts Page"\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "buildRouteInfoMetadata", + "return": { + "description": "any" + }, + "since": "3.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 2012, + "description": "

Sends an action to the router, which will delegate it to the currently\nactive route hierarchy per the bubbling rules explained under actions.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  track(arg) {\n    console.log(arg, 'was clicked');\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  trackIfDebug(arg) {\n    if (debug) {\n      this.send('track', arg);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "name", + "description": "the name of the action to trigger", + "type": "String" + }, + { + "name": "args", + "description": "", + "type": "...*" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 2428, + "description": "

This action is called when one or more query params have changed. Bubbles.

\n", + "itemtype": "method", + "name": "queryParamsDidChange", + "params": [ + { + "name": "changed", + "description": "Keys are names of query params that have changed.", + "type": "Object" + }, + { + "name": "totalPresent", + "description": "Keys are names of query params that are currently set.", + "type": "Object" + }, + { + "name": "removed", + "description": "Keys are names of query params that have been removed.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/routing/route.ts", + "line": 88, + "description": "

The willTransition action 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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ContactFormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData')) {\n      this.controller.displayNavigationConfirm();\n      transition.abort();\n    }\n  }\n}
\n
\n
\n \n

You can also redirect elsewhere by calling\nthis.transitionTo('elsewhere') from within willTransition.\nNote that willTransition will not be fired for the\nredirecting transitionTo, since willTransition doesn't\nfire when there is already a transition underway. If you want\nsubsequent willTransition actions to fire for the redirecting\ntransition, you must first explicitly call\ntransition.abort().

\n

To allow the willTransition event to continue bubbling to the parent\nroute, use return true;. When the willTransition method has a\nreturn value of true then the parent route's willTransition method\nwill be fired, enabling "bubbling" behavior for the event.

\n", + "itemtype": "event", + "name": "willTransition", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 133, + "description": "

The didTransition action is fired after a transition has\nsuccessfully been completed. This occurs after the normal model\nhooks (beforeModel, model, afterModel, setupController)\nhave resolved. The didTransition action has no arguments,\nhowever, it can be useful for tracking page views or resetting\nstate on the controller.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/login.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class LoginRoute extends Route {\n  @action\n  didTransition() {\n    this.controller.get('errors.base').clear();\n    return true; // Bubble the didTransition event\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "didTransition", + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 160, + "description": "

The loading action is fired on the route when a route's model\nhook returns a promise that is not already resolved. The current\nTransition object is the first parameter and the route that\ntriggered the loading event is the second parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  loading(transition, route) {\n    let controller = this.controllerFor('foo');\n\n    // The controller may not be instantiated when initially loading\n    if (controller) {\n      controller.currentlyLoading = true;\n\n      transition.finally(function() {\n        controller.currentlyLoading = false;\n      });\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "loading", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + }, + { + "name": "route", + "description": "The route that triggered the loading event", + "type": "Route" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 195, + "description": "

When attempting to transition into a route, any of the hooks\nmay return a promise that rejects, at which point an error\naction will be fired on the partially-entered routes, allowing\nfor per-route error handling logic, or shared error handling\nlogic defined on a parent route.

\n

Here is an example of an error handler that will be invoked\nfor rejected promises from the various hooks on the route,\nas well as any unhandled errors from child routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/admin.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { reject } from 'rsvp';\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class AdminRoute extends Route {\n  beforeModel() {\n    return reject('bad things!');\n  }\n\n  @action\n  error(error, transition) {\n    // Assuming we got here due to the error in `beforeModel`,\n    // we can expect that error === "bad things!",\n    // but a promise model rejecting would also\n    // call this hook, as would any errors encountered\n    // in `afterModel`.\n\n    // The `error` hook is also provided the failed\n    // `transition`, which can be stored and later\n    // `.retry()`d if desired.\n\n    this.transitionTo('login');\n  }\n}
\n
\n
\n \n

error actions that bubble up all the way to ApplicationRoute\nwill fire a default error handler that logs the error. You can\nspecify your own global default error handler by overriding the\nerror handler on ApplicationRoute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  error(error, transition) {\n    this.controllerFor('banner').displayError(error.message);\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "error", + "params": [ + { + "name": "error", + "description": "", + "type": "Error" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 808, + "description": "

This event is triggered when the router enters the route. It is\nnot executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  collectAnalytics: on('activate', function(){\n    collectAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "activate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 828, + "description": "

This event is triggered when the router completely exits this\nroute. It is not executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  trackPageLeaveAnalytics: on('deactivate', function(){\n    trackPageLeaveAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "deactivate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + } + ], + "properties": [ + { + "file": "packages/@ember/routing/route.ts", + "line": 370, + "description": "

Configuration hash for this route's queryParams. The possible\nconfiguration options and their defaults are as follows\n(assuming a query param whose controller property is page):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
queryParams = {\n  page: {\n    // By default, controller query param properties don't\n    // cause a full transition when they are changed, but\n    // rather only cause the URL to update. Setting\n    // `refreshModel` to true will cause an "in-place"\n    // transition to occur, whereby the model hooks for\n    // this route (and any child routes) will re-fire, allowing\n    // you to reload models (e.g., from the server) using the\n    // updated query param values.\n    refreshModel: false,\n\n    // By default, changes to controller query param properties\n    // cause the URL to update via `pushState`, which means an\n    // item will be added to the browser's history, allowing\n    // you to use the back button to restore the app to the\n    // previous state before the query param property was changed.\n    // Setting `replace` to true will use `replaceState` (or its\n    // hash location equivalent), which causes no browser history\n    // item to be added. This options name and default value are\n    // the same as the `link-to` helper's `replace` option.\n    replace: false,\n\n    // By default, the query param URL key is the same name as\n    // the controller property name. Use `as` to specify a\n    // different URL key.\n    as: 'page'\n  }\n};
\n
\n
\n \n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 423, + "description": "

The name of the template to use by default when rendering this route's\ntemplate.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/list.js
1\n2\n3\n4\n5\n
import Route from '@ember/routing/route';\n\nexport default class PostsListRoute extends Route {\n  templateName = 'posts/list';\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n
import PostsListRoute from '../posts/list';\n\nexport default class PostsIndexRoute extends PostsListRoute {};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/archived.js
1\n2\n3\n
import PostsListRoute from '../posts/list';\n\nexport default class PostsArchivedRoute extends PostsListRoute {};
\n
\n
\n \n", + "itemtype": "property", + "name": "templateName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 456, + "description": "

The name of the controller to associate with this route.

\n

By default, Ember will lookup a route's controller that matches the name\nof the route (i.e. posts.new). However,\nif you would like to define a specific controller to use, you can do so\nusing this property.

\n

This is useful in many ways, as the controller specified will be:

\n
    \n
  • passed to the setupController method.
  • \n
  • used as the controller for the template being rendered by the route.
  • \n
  • returned from a call to controllerFor for the route.
  • \n
\n", + "itemtype": "property", + "name": "controllerName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 479, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 510, + "description": "

The name of the route, dot-delimited.

\n

For example, a route found at app/routes/posts/post.js will have\na routeName of posts.post.

\n", + "itemtype": "property", + "name": "routeName", + "type": "String", + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 524, + "description": "

The name of the route, dot-delimited, including the engine prefix\nif applicable.

\n

For example, a route found at addon/routes/posts/post.js within an\nengine named admin will have a fullRouteName of admin.posts.post.

\n", + "itemtype": "property", + "name": "fullRouteName", + "type": "String", + "since": "2.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 588, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_activeQPChanged", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 729, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_optionsForQueryParam", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1807, + "description": "

Store property provides a hook for data persistence libraries to inject themselves.

\n

By default, this store property provides the exact same functionality previously\nin the model hook.

\n

Currently, the required interface is:

\n

store.find(modelName, findArguments)

\n", + "itemtype": "property", + "name": "store", + "type": "{Object}", + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1873, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_qp", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 2397, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/routing/route", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-RouteInfo-b5aa5d7adc.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-RouteInfo-b5aa5d7adc.json new file mode 100644 index 000000000..cbd32844c --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-RouteInfo-b5aa5d7adc.json @@ -0,0 +1,171 @@ +{ + "data": { + "id": "ember-4.9.3-RouteInfo", + "type": "class", + "attributes": { + "name": "RouteInfo", + "shortname": "RouteInfo", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 124, + "description": "

A RouteInfo is an object that contains metadata\nabout a specific route within a Transition. It is\nread-only and internally immutable. It is also not\nobservable, because a Transition instance is never\nchanged after creation.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 198, + "description": "

Allows you to traverse through the linked list\nof RouteInfos from the topmost to leafmost.\nReturns the first RouteInfo in the linked list\nfor which the callback returns true.

\n

This method is similar to the find() method\n defined in ECMAScript 2015.

\n

The callback method you provide should have the\n following signature (all parameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in\n the results, false otherwise.

\n

Note that in addition to a callback, you can also\n pass an optional target object that will be set as\n this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 135, + "description": "

The dot-separated, fully-qualified name of the\nroute, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 142, + "description": "

The final segment of the fully-qualified name of\nthe route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 149, + "description": "

The values of the route's parameters. These are the\nsame params that are received as arguments to the\nroute's model hook. Contains only the parameters\nvalid for this route, if any (params for parent or\nchild routes are not merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 159, + "description": "

The ordered list of the names of the params\nrequired for this route. It will contain the same\nstrings as Object.keys(params), but here the order\nis significant. This allows users to correctly pass\nparams into routes programmatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 169, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 175, + "description": "

Will contain the result Route#buildRouteInfoMetadata\nfor the corresponding Route.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 182, + "description": "

A reference to the parent route's RouteInfo.\nThis can be used to traverse upward to the topmost\nRouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 190, + "description": "

A reference to the child route's RouteInfo.\nThis can be used to traverse downward to the\nleafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-RouteInfoWithAttributes-4a764a621f.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-RouteInfoWithAttributes-4a764a621f.json new file mode 100644 index 000000000..54cc2c15c --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-RouteInfoWithAttributes-4a764a621f.json @@ -0,0 +1,183 @@ +{ + "data": { + "id": "ember-4.9.3-RouteInfoWithAttributes", + "type": "class", + "attributes": { + "name": "RouteInfoWithAttributes", + "shortname": "RouteInfoWithAttributes", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 7, + "description": "

A RouteInfoWithAttributes is an object that contains\nmetadata, including the resolved value from the routes\nmodel hook. Like RouteInfo, a RouteInfoWithAttributes\nrepresents a specific route within a Transition.\nIt is read-only and internally immutable. It is also not\nobservable, because a Transition instance is never\nchanged after creation.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 90, + "description": "

Allows you to traverse through the linked list\nof RouteInfos from the topmost to leafmost.\nReturns the first RouteInfo in the linked list\nfor which the callback returns true.

\n

This method is similar to the find() method\n defined in ECMAScript 2015.

\n

The callback method you provide should have the\n following signature (all parameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in\n the results, false otherwise.

\n

Note that in addition to a callback, you can also\n pass an optional target object that will be set as\n this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 20, + "description": "

The dot-separated, fully-qualified name of the\nroute, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 27, + "description": "

The final segment of the fully-qualified name of\nthe route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 34, + "description": "

The values of the route's parameters. These are the\nsame params that are received as arguments to the\nroute's model hook. Contains only the parameters\nvalid for this route, if any (params for parent or\nchild routes are not merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 44, + "description": "

The ordered list of the names of the params\nrequired for this route. It will contain the same\nstrings as Object.keys(params), but here the order\nis significant. This allows users to correctly pass\nparams into routes programmatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 54, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 60, + "description": "

This is the resolved return value from the\nroute's model hook.

\n", + "itemtype": "property", + "name": "attributes", + "type": "Object|Array|String|undefined", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 67, + "description": "

Will contain the result Route#buildRouteInfoMetadata\nfor the corresponding Route.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 74, + "description": "

A reference to the parent route's RouteInfo.\nThis can be used to traverse upward to the topmost\nRouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/routing/lib/route-info.ts", + "line": 82, + "description": "

A reference to the child route's RouteInfo.\nThis can be used to traverse downward to the\nleafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-RouterService-89e6f016de.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-RouterService-89e6f016de.json new file mode 100644 index 000000000..567a4ce13 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-RouterService-89e6f016de.json @@ -0,0 +1,882 @@ +{ + "data": { + "id": "ember-4.9.3-RouterService", + "type": "class", + "attributes": { + "name": "RouterService", + "shortname": "RouterService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/router-service", + "namespace": "", + "file": "packages/@ember/routing/router-service.ts", + "line": 27, + "description": "

The Router service is the public API that provides access to the router.

\n

The immediate benefit of the Router service is that you can inject it into components,\ngiving them a friendly way to initiate transitions and ask questions about the current\nglobal router state.

\n

In this example, the Router service is injected into a component to initiate a transition\nto a dedicated route:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class ExampleComponent extends Component {\n  @service router;\n\n  @action\n  next() {\n    this.router.transitionTo('other.route');\n  }\n}
\n
\n
\n \n

Like any service, it can also be injected into helpers, routes, etc.

\n", + "access": "public", + "tagname": "", + "extends": "Service", + "methods": [ + { + "file": "packages/@ember/routing/router-service.ts", + "line": 85, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n

Calling transitionTo from the Router service will cause default query parameter values to be included in the URL.\nThis behavior is different from calling transitionTo on a route or transitionToRoute on a controller.\nSee the Router Service RFC for more info.

\n

In the following example we use the Router service to navigate to a route with a\nspecific model from a Component in the first action, and in the second we trigger\na query-params only transition.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n  @service router;\n\n  @action\n  goToComments(post) {\n    this.router.transitionTo('comments', post);\n  }\n\n  @action\n  fetchMoreComments(latestComment) {\n    this.router.transitionTo({\n      queryParams: { commentsAfter: latestComment }\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 144, + "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

Calling 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 for more info.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class extends Route {\n  beforeModel() {\n    if (!authorized()){\n      this.replaceWith('unauthorized');\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL of the desired destination", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route i.e. an object of params to pass to the destination route", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 183, + "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

In this example, the URL for the author.books route for a given author\nis copied to the clipboard.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import 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
\n \n

Just like with transitionTo and replaceWith, urlFor can also handle\nquery parameters.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "urlFor", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) for the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the string representing the generated URL", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 256, + "description": "

Returns true if routeName/models/queryParams is the active route, where models and queryParams are optional.\nSee model and\nqueryParams for more information about these arguments.

\n

In the following example, isActive will return true if the current route is /posts.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

The 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import 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
\n \n

Where 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.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used when determining the active route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "true if the provided routeName/models/queryParams are active", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 360, + "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

See RouteInfo for more info.

\n

In the following example recognize is used to verify if a path belongs to our\napplication before transitioning to it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "recognize", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo | null" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 401, + "description": "

Takes a string URL and returns a promise that resolves to a\nRouteInfoWithAttributes 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.

\n", + "itemtype": "method", + "name": "recognizeAndLoad", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 423, + "description": "

You can register a listener for events emitted by this service with .on():

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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
\n \n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 450, + "description": "

You can unregister a listener for events emitted by this service with .off():

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import 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
\n
\n \n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 556, + "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.

\n", + "itemtype": "method", + "name": "refresh", + "params": [ + { + "name": "routeName", + "description": "the route to refresh (along with all child routes)", + "type": "String", + "optional": true + } + ], + "return": { + "description": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/routing/router-service.ts", + "line": 482, + "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

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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
\n \n

The 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.

\n", + "itemtype": "event", + "name": "routeWillChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 516, + "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

A good example is sending some analytics when the route has transitioned:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import 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 \n

routeDidChange will be called after any Route's\ndidTransition\naction has been fired.\nThe updates of properties\ncurrentURL,\ncurrentRouteName\nand\ncurrentRoute\nare completed at the time routeDidChange is called.

\n", + "itemtype": "event", + "name": "routeDidChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + } + ], + "properties": [ + { + "file": "packages/@ember/routing/router-service.ts", + "line": 586, + "description": "

Name of the current route.

\n

This property represents the logical name of the route,\n which is dot separated.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentRouteName", + "type": "{String | null}", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 616, + "description": "

Current URL for the application.

\n

This property represents the URL path for this route.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\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 \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
  • \n
\n", + "itemtype": "property", + "name": "currentURL", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 645, + "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

See Location for more information.

\n

To 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\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
\n \n

The following location types are available by default:\nauto, hash, history, none.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.\nSee AutoLocation.

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 685, + "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

If you change the rootURL in your environment configuration\nlike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\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
\n \n

This property will return /my-root.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 715, + "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

See RouteInfo for more info.

\n

This 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

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/header.js
1\n2\n3\n4\n5\n6\n7\n8\n9\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
\n
\n \n", + "itemtype": "property", + "name": "currentRoute", + "type": "RouteInfo", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-Service", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/routing/router-service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-Service-fabc99dc3d.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-Service-fabc99dc3d.json new file mode 100644 index 000000000..46583d1d6 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-Service-fabc99dc3d.json @@ -0,0 +1,541 @@ +{ + "data": { + "id": "ember-4.9.3-Service", + "type": "class", + "attributes": { + "name": "Service", + "shortname": "Service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "file": "packages/@ember/service/index.ts", + "line": 87, + "extends": "EmberObject", + "since": "1.10.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 318, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 537, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 564, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 572, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 136, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 161, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 208, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 224, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 242, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 328, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 349, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 366, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 383, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 398, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 428, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 448, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 492, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 352, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 426, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 501, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 519, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-4.9.3-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-4.9.3-RouterService" + } + ] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-String-9d1fe4ff0f.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-String-9d1fe4ff0f.json new file mode 100644 index 000000000..a3fcdef7e --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-String-9d1fe4ff0f.json @@ -0,0 +1,200 @@ +{ + "data": { + "id": "ember-4.9.3-String", + "type": "class", + "attributes": { + "name": "String", + "shortname": "String", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/string", + "namespace": "", + "file": "packages/@ember/string/index.ts", + "line": 74, + "description": "

Defines string helper methods including string formatting and localization.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/string/index.ts", + "line": 81, + "description": "

Splits a string into separate units separated by spaces, eliminating any\nempty strings in the process.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { w } from '@ember/string';\n\nw("alpha beta gamma").forEach(function(key) {\n  console.log(key);\n});\n\n// > alpha\n// > beta\n// > gamma
\n
\n
\n \n", + "itemtype": "method", + "name": "w", + "params": [ + { + "name": "str", + "description": "The string to split", + "type": "String" + } + ], + "return": { + "description": "array containing the split strings", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 106, + "description": "

Converts a camelized string into all lower case separated by underscores.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { decamelize } from '@ember/string';\n\ndecamelize('innerHTML');          // 'inner_html'\ndecamelize('action_name');        // 'action_name'\ndecamelize('css-class-name');     // 'css-class-name'\ndecamelize('my favorite items');  // 'my favorite items'
\n
\n
\n \n", + "itemtype": "method", + "name": "decamelize", + "params": [ + { + "name": "str", + "description": "The string to decamelize.", + "type": "String" + } + ], + "return": { + "description": "the decamelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 127, + "description": "

Replaces underscores, spaces, or camelCase with dashes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { dasherize } from '@ember/string';\n\ndasherize('innerHTML');                // 'inner-html'\ndasherize('action_name');              // 'action-name'\ndasherize('css-class-name');           // 'css-class-name'\ndasherize('my favorite items');        // 'my-favorite-items'\ndasherize('privateDocs/ownerInvoice';  // 'private-docs/owner-invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "dasherize", + "params": [ + { + "name": "str", + "description": "The string to dasherize.", + "type": "String" + } + ], + "return": { + "description": "the dasherized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 149, + "description": "

Returns the lowerCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { camelize } from '@ember/string';\n\ncamelize('innerHTML');                   // 'innerHTML'\ncamelize('action_name');                 // 'actionName'\ncamelize('css-class-name');              // 'cssClassName'\ncamelize('my favorite items');           // 'myFavoriteItems'\ncamelize('My Favorite Items');           // 'myFavoriteItems'\ncamelize('private-docs/owner-invoice');  // 'privateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "camelize", + "params": [ + { + "name": "str", + "description": "The string to camelize.", + "type": "String" + } + ], + "return": { + "description": "the camelized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 172, + "description": "

Returns the UpperCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { classify } from '@ember/string';\n\nclassify('innerHTML');                   // 'InnerHTML'\nclassify('action_name');                 // 'ActionName'\nclassify('css-class-name');              // 'CssClassName'\nclassify('my favorite items');           // 'MyFavoriteItems'\nclassify('private-docs/owner-invoice');  // 'PrivateDocs/OwnerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "classify", + "params": [ + { + "name": "str", + "description": "the string to classify", + "type": "String" + } + ], + "return": { + "description": "the classified string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 194, + "description": "

More general than decamelize. Returns the lower_case_and_underscored\nform of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { underscore } from '@ember/string';\n\nunderscore('innerHTML');                 // 'inner_html'\nunderscore('action_name');               // 'action_name'\nunderscore('css-class-name');            // 'css_class_name'\nunderscore('my favorite items');         // 'my_favorite_items'\nunderscore('privateDocs/ownerInvoice');  // 'private_docs/owner_invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "underscore", + "params": [ + { + "name": "str", + "description": "The string to underscore.", + "type": "String" + } + ], + "return": { + "description": "the underscored string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + }, + { + "file": "packages/@ember/string/index.ts", + "line": 217, + "description": "

Returns the Capitalized form of a string

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capitalize } from '@ember/string';\n\ncapitalize('innerHTML')                 // 'InnerHTML'\ncapitalize('action_name')               // 'Action_name'\ncapitalize('css-class-name')            // 'Css-class-name'\ncapitalize('my favorite items')         // 'My favorite items'\ncapitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "capitalize", + "params": [ + { + "name": "str", + "description": "The string to capitalize.", + "type": "String" + } + ], + "return": { + "description": "The capitalized string.", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "String", + "module": "@ember/string" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/string", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/classes/ember-4.9.3-rsvp-2e3780fad8.json b/json-docs/ember/4.9.3/classes/ember-4.9.3-rsvp-2e3780fad8.json new file mode 100644 index 000000000..fc7ba8897 --- /dev/null +++ b/json-docs/ember/4.9.3/classes/ember-4.9.3-rsvp-2e3780fad8.json @@ -0,0 +1,445 @@ +{ + "data": { + "id": "ember-4.9.3-rsvp", + "type": "class", + "attributes": { + "name": "rsvp", + "shortname": "rsvp", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/all-settled.js", + "line": 20, + "description": "

RSVP.allSettled is similar to RSVP.all, but instead of implementing\na fail-fast method, it waits until all the promises have returned and\nshows you all the results. This is useful if you want to handle multiple\npromises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled. The return promise is fulfilled with an array of the states of\nthe promises passed into the promises array argument.

\n

Each state object will either indicate fulfillment or rejection, and\nprovide the corresponding value or reason. The states will take one of\nthe following formats:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{ state: 'fulfilled', value: value }\n  or\n{ state: 'rejected', reason: reason }
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
let promise1 = RSVP.Promise.resolve(1);\nlet promise2 = RSVP.Promise.reject(new Error('2'));\nlet promise3 = RSVP.Promise.reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nRSVP.allSettled(promises).then(function(array){\n  // array == [\n  //   { state: 'fulfilled', value: 1 },\n  //   { state: 'rejected', reason: Error },\n  //   { state: 'rejected', reason: Error }\n  // ]\n  // Note that for the second item, reason.message will be '2', and for the\n  // third item, reason.message will be '3'.\n}, function(error) {\n  // Not run. (This block would only be called if allSettled had failed,\n  // for instance if passed an incorrect argument type.)\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "allSettled", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "entries", + "description": "", + "type": "Array" + }, + { + "name": "label", + "description": "- optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with an array of the settled\nstates of the constituent promises.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/all.js", + "line": 3, + "description": "

This is a convenient alias for Promise.all.

\n", + "itemtype": "method", + "name": "all", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/defer.js", + "line": 3, + "description": "

defer returns an object similar to jQuery's $.Deferred.\ndefer should be used when porting over code reliant on $.Deferred's\ninterface. New code should use the Promise constructor instead.

\n

The object returned from defer is a plain object with three properties:

\n
    \n
  • promise - an Promise.
  • \n
  • reject - a function that causes the promise property on this object to\nbecome rejected
  • \n
  • resolve - a function that causes the promise property on this object to\nbecome fulfilled.
  • \n
\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let deferred = defer();\n\ndeferred.resolve("Success!");\n\ndeferred.promise.then(function(value){\n  // value here is "Success!"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "defer", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 19, + "description": "

EventTarget.mixin extends an object with EventTarget methods. For\nExample:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import EventTarget from 'rsvp';\n\nlet object = {};\n\nEventTarget.mixin(object);\n\nobject.on('finished', function(event) {\n  // handle event\n});\n\nobject.trigger('finished', { detail: value });
\n
\n
\n \n

EventTarget.mixin also works with prototypes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EventTarget from 'rsvp';\n\nlet Person = function() {};\nEventTarget.mixin(Person.prototype);\n\nlet yehuda = new Person();\nlet tom = new Person();\n\nyehuda.on('poke', function(event) {\n  console.log('Yehuda says OW');\n});\n\ntom.on('poke', function(event) {\n  console.log('Tom says OW');\n});\n\nyehuda.trigger('poke');\ntom.trigger('poke');
\n
\n
\n \n", + "itemtype": "method", + "name": "mixin", + "access": "private", + "tagname": "", + "params": [ + { + "name": "object", + "description": "object to extend with EventTarget methods", + "type": "Object" + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 107, + "description": "

You can use off to stop firing a particular callback for an event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function doStuff() { // do stuff! }\nobject.on('stuff', doStuff);\n\nobject.trigger('stuff'); // doStuff will be called\n\n// Unregister ONLY the doStuff callback\nobject.off('stuff', doStuff);\nobject.trigger('stuff'); // doStuff will NOT be called
\n
\n
\n \n

If you don't pass a callback argument to off, ALL callbacks for the\nevent will not be executed when the event fires. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let callback1 = function(){};\nlet callback2 = function(){};\n\nobject.on('stuff', callback1);\nobject.on('stuff', callback2);\n\nobject.trigger('stuff'); // callback1 and callback2 will be executed.\n\nobject.off('stuff');\nobject.trigger('stuff'); // callback1 and callback2 will not be executed!
\n
\n
\n \n", + "itemtype": "method", + "name": "off", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "event to stop listening to", + "type": "String" + }, + { + "name": "callback", + "description": "optional argument. If given, only the function\ngiven will be removed from the event's callback queue. If no `callback`\nargument is given, all callbacks will be removed from the event's callback\nqueue.", + "type": "Function", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 162, + "description": "

Use trigger to fire custom events. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
object.on('foo', function(){\n  console.log('foo event happened!');\n});\nobject.trigger('foo');\n// 'foo event happened!' logged to the console
\n
\n
\n \n

You can also pass a value as a second argument to trigger that will be\npassed as an argument to all event listeners for the event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
object.on('foo', function(value){\n  console.log(value.name);\n});\n\nobject.trigger('foo', { name: 'bar' });\n// 'bar' logged to the console
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "name of the event to be triggered", + "type": "String" + }, + { + "name": "options", + "description": "optional value to be passed to any event handlers for\nthe given `eventName`", + "type": "*", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/filter.js", + "line": 42, + "description": "

filter is similar to JavaScript's native filter method.\nfilterFn is eagerly called meaning that as soon as any promise\n resolves its value will be passed to filterFn. filter returns\n a promise that will become fulfilled with the result of running\n filterFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { filter, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\n\nlet promises = [promise1, promise2, promise3];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(result){\n  // result is [ 2, 3 ]\n});
\n
\n
\n \n

If any of the promises given to filter are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { filter, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet filterFn = function(item){\n  return item > 1;\n};\n\nfilter(promises, filterFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

filter will also wait for any promises returned from filterFn.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter, resolve } from 'rsvp';\n\nlet alice = { name: 'alice' };\nlet bob   = { name: 'bob' };\nlet users = [ alice, bob ];\n\nlet promises = users.map(function(user){\n  return resolve(user);\n});\n\nlet filterFn = function(user){\n  // Here, Alice has permissions to create a blog post, but Bob does not.\n  return getPrivilegesForUser(user).then(function(privs){\n    return privs.can_create_blog_post === true;\n  });\n};\nfilter(promises, filterFn).then(function(users){\n  // true, because the server told us only Alice can create a blog post.\n  users.length === 1;\n  // false, because Alice is the only user present in `users`\n  users[0] === bob;\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "filterFn", + "description": "- function to be called on each resolved value to\n filter the final results.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string describing the promise. Useful for\n tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash-settled.js", + "line": 16, + "description": "

hashSettled is similar to allSettled, but takes an object\ninstead of an array for its promises argument.

\n

Unlike all or hash, which implement a fail-fast method,\nbut like allSettled, hashSettled waits until all the\nconstituent promises have returned and then shows you all the results\nwith their states and values/reasons. This is useful if you want to\nhandle multiple promises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled, or rejected if the passed parameters are invalid.

\n

The returned promise is fulfilled with a hash that has the same key names as\nthe promises object argument. If any of the values in the object are not\npromises, they will be copied over to the fulfilled object and marked with state\n'fulfilled'.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: { state: 'fulfilled', value: 1 },\n  //   yourPromise: { state: 'fulfilled', value: 2 },\n  //   theirPromise: { state: 'fulfilled', value: 3 },\n  //   notAPromise: { state: 'fulfilled', value: 4 }\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the state will\nbe set to 'rejected' and the reason for rejection provided.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, reject, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejection')),\n  anotherRejectedPromise: reject(new Error('more rejection')),\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise:              { state: 'fulfilled', value: 1 },\n  //   rejectedPromise:        { state: 'rejected', reason: Error },\n  //   anotherRejectedPromise: { state: 'rejected', reason: Error },\n  // }\n  // Note that for rejectedPromise, reason.message == 'rejection',\n  // and for anotherRejectedPromise, reason.message == 'more rejection'.\n});
\n
\n
\n \n

An important note: hashSettled is intended for plain JavaScript objects that\nare just a set of keys and values. hashSettled will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import Promise, { hashSettled, resolve } from 'rsvp';\n\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: Promise.resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhashSettled(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: { state: 'fulfilled', value: 'Example' }\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hashSettled", + "access": "public", + "tagname": "", + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when when all properties of `promises`\nhave been settled.", + "type": "Promise" + }, + "static": 1, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash.js", + "line": 4, + "description": "

hash is similar to all, but takes an object instead of an array\nfor its promises argument.

\n

Returns a promise that is fulfilled when all the given promises have been\nfulfilled, or rejected if any of them become rejected. The returned promise\nis fulfilled with a hash that has the same key names as the promises object\nargument. If any of the values in the object are not promises, they will\nsimply be copied over to the fulfilled object.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhash(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: 1,\n  //   yourPromise: 2,\n  //   theirPromise: 3,\n  //   notAPromise: 4\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the first promise\nthat is rejected will be given as the reason to the rejection handler.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejectedPromise')),\n  anotherRejectedPromise: reject(new Error('anotherRejectedPromise')),\n};\n\nhash(promises).then(function(hash){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === 'rejectedPromise'\n});
\n
\n
\n \n

An important note: hash is intended for plain JavaScript objects that\nare just a set of keys and values. hash will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { hash, resolve } from 'rsvp';\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhash(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: 'Example'\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all properties of `promises`\nhave been fulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/map.js", + "line": 39, + "description": "

map is similar to JavaScript's native map method. mapFn is eagerly called\n meaning that as soon as any promise resolves its value will be passed to mapFn.\n map returns a promise that will become fulfilled with the result of running\n mapFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(result){\n  // result is [ 2, 3, 4 ]\n});
\n
\n
\n \n

If any of the promises given to map are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { map, reject, resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error('2'));\nlet promise3 = reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nlet mapFn = function(item){\n  return item + 1;\n};\n\nmap(promises, mapFn).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === '2'\n});
\n
\n
\n \n

map will also wait if a promise is returned from mapFn. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first because they contain a url to those comments.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { map } from 'rsvp';\n\nlet mapFn = function(blogPost){\n  // getComments does some ajax and returns an Promise that is fulfilled\n  // with some comments data\n  return getComments(blogPost.comments_url);\n};\n\n// getBlogPosts does some ajax and returns an Promise that is fulfilled\n// with some blog post data\nmap(getBlogPosts(), mapFn).then(function(comments){\n  // comments is the result of asking the server for the comments\n  // of all blog posts returned from getBlogPosts()\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "mapFn", + "description": "function to be called on each fulfilled promise.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\n Useful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/node.js", + "line": 44, + "description": "

denodeify takes a 'node-style' function and returns a function that\nwill return an Promise. You can use denodeify in Node.js or the\nbrowser when you'd prefer to use promises over using callbacks. For example,\ndenodeify transforms the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) return handleError(err);\n  handleData(data);\n});
\n
\n
\n \n

into:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\n\nreadFile('myfile.txt').then(handleData, handleError);
\n
\n
\n \n

If the node function has multiple success parameters, then denodeify\njust returns the first one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let request = denodeify(require('request'));\n\nrequest('http://example.com').then(function(res) {\n  // ...\n});
\n
\n
\n \n

However, if you need all success parameters, setting denodeify's\nsecond parameter to true causes it to return all success parameters\nas an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), true);\n\nrequest('http://example.com').then(function(result) {\n  // result[0] -> res\n  // result[1] -> body\n});
\n
\n
\n \n

Or if you pass it an array with names it returns the parameters as a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), ['res', 'body']);\n\nrequest('http://example.com').then(function(result) {\n  // result.res\n  // result.body\n});
\n
\n
\n \n

Sometimes you need to retain the this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let app = require('express')();\nlet render = denodeify(app.render.bind(app));
\n
\n
\n \n

The denodified function inherits from the original function. It works in all\nenvironments, except IE 10 and below. Consequently all properties of the original\nfunction are available to you. However, any properties you change on the\ndenodeified function won't be changed on the original function. Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request')),\n    cookieJar = request.jar(); // <- Inheritance is used here\n\nrequest('http://example.com', {jar: cookieJar}).then(function(res) {\n  // cookieJar.cookies holds now the cookies returned by example.com\n});
\n
\n
\n \n

Using denodeify makes it easier to compose asynchronous operations instead\nof using callbacks. For example, instead of:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) { ... } // Handle error\n  fs.writeFile('myfile2.txt', data, function(err){\n    if (err) { ... } // Handle error\n    console.log('done')\n  });\n});
\n
\n
\n \n

you can chain the operations together using then from the returned promise:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\nlet writeFile = denodeify(fs.writeFile);\n\nreadFile('myfile.txt').then(function(data){\n  return writeFile('myfile2.txt', data);\n}).then(function(){\n  console.log('done')\n}).catch(function(error){\n  // Handle error\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "denodeify", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "nodeFunc", + "description": "a 'node-style' function that takes a callback as\nits last argument. The callback expects an error to be passed as its first\nargument (if an error occurred, otherwise null), and the value from the\noperation as its second argument ('function(err, value){ }').", + "type": "Function" + }, + { + "name": "options", + "description": "An optional paramter that if set\nto `true` causes the promise to fulfill with the callback's success arguments\nas an array. This is useful if the node function has multiple success\nparamters. If you set this paramter to an array with names, the promise will\nfulfill with a hash with these names as keys and the success parameters as\nvalues.", + "type": "Boolean|Array", + "optional": true + } + ], + "return": { + "description": "a function that wraps `nodeFunc` to return a `Promise`", + "type": "Function" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/race.js", + "line": 3, + "description": "

This is a convenient alias for Promise.race.

\n", + "itemtype": "method", + "name": "race", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/reject.js", + "line": 3, + "description": "

This is a convenient alias for Promise.reject.

\n", + "itemtype": "method", + "name": "reject", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/resolve.js", + "line": 3, + "description": "

This is a convenient alias for Promise.resolve.

\n", + "itemtype": "method", + "name": "resolve", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "value", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/rethrow.js", + "line": 1, + "description": "

rethrow will rethrow an error on the next turn of the JavaScript event\nloop in order to aid debugging.

\n

Promises A+ specifies that any exceptions that occur with a promise must be\ncaught by the promises implementation and bubbled to the last handler. For\nthis reason, it is recommended that you always specify a second rejection\nhandler function to then. However, rethrow will throw the exception\noutside of the promise, so it bubbles up to your console if in the browser,\nor domain/cause uncaught exception in Node. rethrow will also throw the\nerror again so the error can be handled by the promise per the spec.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { rethrow } from 'rsvp';\n\nfunction throws(){\n  throw new Error('Whoops!');\n}\n\nlet promise = new Promise(function(resolve, reject){\n  throws();\n});\n\npromise.catch(rethrow).then(function(){\n  // Code here doesn't run because the promise became rejected due to an\n  // error!\n}, function (err){\n  // handle the error here\n});
\n
\n
\n \n

The 'Whoops' error will be thrown on the next turn of the event loop\nand you can watch for it in your console. You can also handle it using a\nrejection handler given to .then or .catch on the returned promise.

\n", + "itemtype": "method", + "name": "rethrow", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "reason the promise became rejected.", + "type": "Error" + } + ], + "throws": { + "description": "Error" + }, + "class": "rsvp", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/modules/ember-4.9.3-@ember/component-0cc60e7899.json b/json-docs/ember/4.9.3/modules/ember-4.9.3-@ember/component-0cc60e7899.json new file mode 100644 index 000000000..7b200827f --- /dev/null +++ b/json-docs/ember/4.9.3/modules/ember-4.9.3-@ember/component-0cc60e7899.json @@ -0,0 +1,89 @@ +{ + "data": { + "id": "ember-4.9.3-@ember/component", + "type": "module", + "attributes": { + "name": "@ember/component", + "submodules": {}, + "elements": {}, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/component": 1, + "Ember.Templates.components": 1, + "@ember/component/helper": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 47, + "description": "

Glimmer is a templating engine used by Ember.js that is compatible with a subset of the Handlebars syntax.

\n

Showing a property

\n

Templates manage the flow of an application's UI, and display state (through\nthe DOM) to a user. For example, given a component with the property "name",\nthat component's template can use the name in several ways:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  name: 'Jill'\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
{{this.name}}\n<div>{{this.name}}</div>\n<span data-name={{this.name}}></span>
\n
\n
\n \n

Any time the "name" property on the component changes, the DOM will be\nupdated.

\n

Properties can be chained as well:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{@aUserModel.name}}\n<div>{{@listOfUsers.firstObject.name}}</div>
\n
\n
\n \n

Using Ember helpers

\n

When content is passed in mustaches {{}}, Ember will first try to find a helper\nor component with that name. For example, the if helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
{{if this.name "I have a name" "I have no name"}}\n<span data-has-name={{if this.name true}}></span>
\n
\n
\n \n

The returned value is placed where the {{}} is called. The above style is\ncalled "inline". A second style of helper usage is called "block". For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#if this.name}}\n  I have a name\n{{else}}\n  I have no name\n{{/if}}
\n
\n
\n \n

The block form of helpers allows you to control how the UI is created based\non the values of properties.\nA third form of helper is called "nested". For example here the concat\nhelper will add " Doe" to a displayed name if the person has no last name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<span data-name={{concat this.firstName (\n  if this.lastName (concat " " this.lastName) "Doe"\n)}}></span>
\n
\n
\n \n

Ember's built-in helpers are described under the Ember.Templates.helpers\nnamespace. Documentation on creating custom helpers can be found under\nhelper (or\nunder Helper if a helper requires access to\ndependency injection).

\n

Invoking a Component

\n

Ember components represent state to the UI of an application. Further\nreading on components can be found under Component.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "Component", + "Helper" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 272, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "allstaticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 272, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "version": "4.9.3" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/modules/ember-4.9.3-@glimmer/component-afe29cbf27.json b/json-docs/ember/4.9.3/modules/ember-4.9.3-@glimmer/component-afe29cbf27.json new file mode 100644 index 000000000..e45c5e76e --- /dev/null +++ b/json-docs/ember/4.9.3/modules/ember-4.9.3-@glimmer/component-afe29cbf27.json @@ -0,0 +1,36 @@ +{ + "data": { + "id": "ember-4.9.3-@glimmer/component", + "type": "module", + "attributes": { + "name": "@glimmer/component", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts", + "line": 1, + "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

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault components for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Template-only and Glimmer components. If you\nare looking for the API documentation for Classic components, it is\navailable here. The source code for\nGlimmer components can be found in @glimmer/component.

\n

Defining a Template-only Component

\n

The simplest way to create a component is to create a template file in\napp/templates/components. For example, if you name a template\napp/templates/components/person-profile.hbs:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
<h1>{{@person.name}}</h1>\n<img src={{@person.avatar}}>\n<p class='signature'>{{@person.signature}}</p>
\n
\n
\n \n

You will be able to use <PersonProfile /> to invoke this component elsewhere\nin your application:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<PersonProfile @person={{this.currentUser}} />
\n
\n
\n \n

Note that component names are capitalized here in order to distinguish them\nfrom regular HTML elements, but they are dasherized in the file system.

\n

While the angle bracket invocation form is generally preferred, it is also\npossible to invoke the same component with the {{person-profile}} syntax:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person-profile person=this.currentUser}}
\n
\n
\n \n

Note that with this syntax, you use dashes in the component name and\narguments are passed without the @ sign.

\n

In both cases, Ember will render the content of the component template we\ncreated above. The end result will be something like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\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 \n

File System Nesting

\n

Components can be nested inside sub-folders for logical groupping. For\nexample, if we placed our template in\napp/templates/components/person/short-profile.hbs, we can invoke it as\n<Person::ShortProfile />:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Person::ShortProfile @person={{this.currentUser}} />
\n
\n
\n \n

Or equivalently, {{person/short-profile}}:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person/short-profile person=this.currentUser}}
\n
\n
\n \n

Using Blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield}}
\n
\n
\n \n

We could then invoke it like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}}>\n  <p>Admin mode</p>\n</PersonProfile>
\n
\n
\n \n

or with curly syntax like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-profile person=this.currentUser}}\n  <p>Admin mode</p>\n{{/person-profile}}
\n
\n
\n \n

And 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

Blocks are executed in their original context, meaning they have access to the\nscope and any in-scope variables where they were defined.

\n

Passing parameters to blocks

\n

You can also pass positional parameters to {{yield}}, which are then made\navailable in the block:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

We can then use this value in the block like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}} as |signature|>\n  {{signature}}\n</PersonProfile>
\n
\n
\n \n

Passing multiple blocks

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield to="title"}}</h1>\n{{yield}}
\n
\n
\n \n

This component could then be invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title>{{this.currentUser.name}}</:title>\n  <:default>{{this.currentUser.signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

When 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

Passing parameters to named blocks

\n

You can also pass parameters to named blocks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield @person.name to="title"}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

These parameters can then be used like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title as |name|>{{name}}</:title>\n  <:default as |signature|>{{signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

Checking to see if a block exists

\n

You 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
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\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
\n \n

With this template, we can then optionally pass in one block, both blocks, or\nnone at all:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\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 \n

Checking to see if a block has parameters

\n

We can also check if a block receives parameters using the (has-block-params)\nkeyword, and conditionally yield different values if so.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
{{#if (has-block-params)}}\n  {{yield @person.signature}}\n{{else}}\n  {{yield}}\n{{/if}}
\n
\n
\n \n

Customizing Components With JavaScript

\n

To 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\nPersonProfile component which we defined above, we would create\napp/components/person-profile.js and export our class as the default, like\nso:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import 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
\n \n

You 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\ndisplayName property of our PersonProfile component instance in the\ntemplate like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

constructor

\n

params: owner object and args object

\n

Constructs 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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import 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
\n \n

Service injections and arguments are available in the constructor.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import 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 \n

willDestroy

\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
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import 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 \n

args

\n

The args property of Glimmer components is an object that contains the\narguments that are passed to the component. For instance, the\nfollowing component usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @fadeIn={{true}} />
\n
\n
\n \n

Would result in the following args object to be passed to the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ fadeIn: true }
\n
\n
\n \n

args can be accessed at any point in the component lifecycle, including\nconstructor and willDestroy. They are also automatically marked as tracked\nproperties, and they can be depended on as computed property dependencies:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import 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 \n

isDestroying

\n

A boolean flag to tell if the component is in the process of destroying. This is set to\ntrue before willDestroy is called.

\n

isDestroyed

\n

A boolean to tell if the component has been fully destroyed. This is set to true\nafter willDestroy is called.

\n", + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "4.9.3" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/namespaces/ember-4.9.3-AutoLocation-36b087cfce.json b/json-docs/ember/4.9.3/namespaces/ember-4.9.3-AutoLocation-36b087cfce.json new file mode 100644 index 000000000..6aeff5989 --- /dev/null +++ b/json-docs/ember/4.9.3/namespaces/ember-4.9.3-AutoLocation-36b087cfce.json @@ -0,0 +1,129 @@ +{ + "data": { + "id": "ember-4.9.3-AutoLocation", + "type": "namespace", + "attributes": { + "name": "AutoLocation", + "shortname": "AutoLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/auto-location", + "namespace": "", + "file": "packages/@ember/routing/auto-location.ts", + "line": 21, + "description": "

AutoLocation will select the best location option based off browser\nsupport with the priority order: history, hash, none.

\n

Clean pushState paths accessed by hashchange-only browsers will be redirected\nto the hash-equivalent and vice versa so future transitions are consistent.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n

Browsers that support the history API will use HistoryLocation, those that\ndo not, but still support the hashchange event will use HashLocation, and\nin the rare case neither is supported will use NoneLocation.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'auto'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new for modern browsers that\nsupport the history api or /#/posts/new for older ones, like Internet\nExplorer 9 and below.

\n

When a user visits a link to your application, they will be automatically\nupgraded or downgraded to the appropriate Location class, with the URL\ntransformed accordingly, if needed.

\n

Keep in mind that since some of your users will use HistoryLocation, your\nserver must serve the Ember app at all the routes you define.

\n", + "static": 1, + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 353, + "access": "private", + "tagname": "Returns the current path as it should appear for HashLocation supported\nbrowsers. This may very well differ from the real current path.", + "itemtype": "method", + "name": "_getHashPath", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 79, + "access": "private", + "tagname": "Will be pre-pended to path upon state change.", + "since": "1.5.1", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + }, + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 91, + "access": "private", + "tagname": "The browser's `location` object. This is typically equivalent to\n`window.location`, but may be overridden for testing.", + "itemtype": "property", + "name": "location", + "default": "environment.location", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + }, + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 103, + "access": "private", + "tagname": "The browser's `history` object. This is typically equivalent to\n`window.history`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "history", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + }, + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 116, + "access": "private", + "tagname": "The user agent's global variable. In browsers, this will be `window`.", + "since": "1.11", + "itemtype": "property", + "name": "global", + "default": "window", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + }, + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 128, + "access": "private", + "tagname": "The browser's `userAgent`. This is typically equivalent to\n`navigator.userAgent`, but may be overridden for testing.", + "since": "1.5.1", + "itemtype": "property", + "name": "userAgent", + "default": "environment.history", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + }, + { + "file": "packages/@ember/routing/auto-location.ts", + "line": 141, + "access": "private", + "tagname": "This property is used by the router to know whether to cancel the routing\nsetup process, which is needed while we redirect the browser.", + "since": "1.5.1", + "itemtype": "property", + "name": "cancelRouterSetup", + "default": "false", + "class": "AutoLocation", + "module": "@ember/routing/auto-location" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/routing/auto-location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/4.9.3/namespaces/ember-4.9.3-Instrumentation-31285eb2b0.json b/json-docs/ember/4.9.3/namespaces/ember-4.9.3-Instrumentation-31285eb2b0.json new file mode 100644 index 000000000..3551bc230 --- /dev/null +++ b/json-docs/ember/4.9.3/namespaces/ember-4.9.3-Instrumentation-31285eb2b0.json @@ -0,0 +1,46 @@ +{ + "data": { + "id": "ember-4.9.3-Instrumentation", + "type": "namespace", + "attributes": { + "name": "Instrumentation", + "shortname": "Instrumentation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/instrumentation", + "namespace": "", + "file": "packages/@ember/instrumentation/index.ts", + "line": 40, + "description": "

The purpose of the Ember Instrumentation module is\nto provide efficient, general-purpose instrumentation\nfor Ember.

\n

Subscribe to a listener by using subscribe:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { subscribe } from '@ember/instrumentation';\n\nsubscribe("render", {\n  before(name, timestamp, payload) {\n\n  },\n\n  after(name, timestamp, payload) {\n\n  }\n});
\n
\n
\n \n

If you return a value from the before callback, that same\nvalue will be passed as a fourth parameter to the after\ncallback.

\n

Instrument a block of code by using instrument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { instrument } from '@ember/instrumentation';\n\ninstrument("render.handlebars", payload, function() {\n  // rendering logic\n}, binding);
\n
\n
\n \n

Event names passed to instrument are namespaced\nby periods, from more general to more specific. Subscribers\ncan listen for events by whatever level of granularity they\nare interested in.

\n

In the above example, the event is render.handlebars,\nand the subscriber listened for all events beginning with\nrender. It would receive callbacks for events named\nrender, render.handlebars, render.container, or\neven render.handlebars.layout.

\n", + "static": 1, + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-4.9.3-@ember/instrumentation", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-4.9.3", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/rev-index/ember-4.0.1.json b/rev-index/ember-4.0.1.json index c70b22f75..03dfd3a80 100644 --- a/rev-index/ember-4.0.1.json +++ b/rev-index/ember-4.0.1.json @@ -1 +1 @@ -{"data":{"id":"ember-4.0.1","type":"project-version","attributes":{"version":"4.0.1"},"relationships":{"classes":{"data":[{"id":"ember-4.0.1-Promise","type":"class"},{"id":"ember-4.0.1-EventTarget","type":"class"},{"id":"ember-4.0.1-Container","type":"class"},{"id":"ember-4.0.1-Registry","type":"class"},{"id":"ember-4.0.1-EmberENV","type":"class"},{"id":"ember-4.0.1-ContainerDebugAdapter","type":"class"},{"id":"ember-4.0.1-DataAdapter","type":"class"},{"id":"ember-4.0.1-Ember.Templates.helpers","type":"class"},{"id":"ember-4.0.1-ComponentStateBucket","type":"class"},{"id":"ember-4.0.1-Component","type":"class"},{"id":"ember-4.0.1-Helper","type":"class"},{"id":"ember-4.0.1-ComputedProperty","type":"class"},{"id":"ember-4.0.1-Descriptor","type":"class"},{"id":"ember-4.0.1-Ember.InjectedProperty","type":"class"},{"id":"ember-4.0.1-Libraries","type":"class"},{"id":"ember-4.0.1-Mixin","type":"class"},{"id":"ember-4.0.1-Ember.ControllerMixin","type":"class"},{"id":"ember-4.0.1-Location","type":"class"},{"id":"ember-4.0.1-HashLocation","type":"class"},{"id":"ember-4.0.1-HistoryLocation","type":"class"},{"id":"ember-4.0.1-NoneLocation","type":"class"},{"id":"ember-4.0.1-RouterService","type":"class"},{"id":"ember-4.0.1-RoutingService","type":"class"},{"id":"ember-4.0.1-BucketCache","type":"class"},{"id":"ember-4.0.1-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.0.1-RouteInfo","type":"class"},{"id":"ember-4.0.1-Route","type":"class"},{"id":"ember-4.0.1-EmberRouter","type":"class"},{"id":"ember-4.0.1-Transition","type":"class"},{"id":"ember-4.0.1-Ember.ProxyMixin","type":"class"},{"id":"ember-4.0.1-Ember.ActionHandler","type":"class"},{"id":"ember-4.0.1-EmberArray","type":"class"},{"id":"ember-4.0.1-MutableArray","type":"class"},{"id":"ember-4.0.1-Ember.NativeArray","type":"class"},{"id":"ember-4.0.1-Ember.Comparable","type":"class"},{"id":"ember-4.0.1-ContainerProxyMixin","type":"class"},{"id":"ember-4.0.1-Enumerable","type":"class"},{"id":"ember-4.0.1-Evented","type":"class"},{"id":"ember-4.0.1-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.0.1-Observable","type":"class"},{"id":"ember-4.0.1-PromiseProxyMixin","type":"class"},{"id":"ember-4.0.1-RegistryProxyMixin","type":"class"},{"id":"ember-4.0.1-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.0.1-ArrayProxy","type":"class"},{"id":"ember-4.0.1-CoreObject","type":"class"},{"id":"ember-4.0.1-Ember.Namespace","type":"class"},{"id":"ember-4.0.1-EmberObject","type":"class"},{"id":"ember-4.0.1-ObjectProxy","type":"class"},{"id":"ember-4.0.1-Ember.ActionSupport","type":"class"},{"id":"ember-4.0.1-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.0.1-Ember.ViewMixin","type":"class"},{"id":"ember-4.0.1-Ember.EventDispatcher","type":"class"},{"id":"ember-4.0.1-Ember.CoreView","type":"class"},{"id":"ember-4.0.1-Application","type":"class"},{"id":"ember-4.0.1-ApplicationInstance","type":"class"},{"id":"ember-4.0.1-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.0.1-Controller","type":"class"},{"id":"ember-4.0.1-Engine","type":"class"},{"id":"ember-4.0.1-EngineInstance","type":"class"},{"id":"ember-4.0.1-Ember.Error","type":"class"},{"id":"ember-4.0.1-Service","type":"class"},{"id":"ember-4.0.1-String","type":"class"},{"id":"ember-4.0.1-TestAdapter","type":"class"},{"id":"ember-4.0.1-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.0.1-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.0.1-AutoLocation","type":"namespace"},{"id":"ember-4.0.1-FEATURES","type":"namespace"},{"id":"ember-4.0.1-Instrumentation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.0.1-rsvp","type":"module"},{"id":"ember-4.0.1-@ember/debug","type":"module"},{"id":"ember-4.0.1-@ember/component","type":"module"},{"id":"ember-4.0.1-@ember/routing","type":"module"},{"id":"ember-4.0.1-ember","type":"module"},{"id":"ember-4.0.1-@ember/template","type":"module"},{"id":"ember-4.0.1-@glimmer/component","type":"module"},{"id":"ember-4.0.1-@glimmer/tracking","type":"module"},{"id":"ember-4.0.1-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.0.1-@ember/object","type":"module"},{"id":"ember-4.0.1-@ember/utils","type":"module"},{"id":"ember-4.0.1-@ember/application","type":"module"},{"id":"ember-4.0.1-@ember/array","type":"module"},{"id":"ember-4.0.1-@ember/enumerable","type":"module"},{"id":"ember-4.0.1-@ember/canary-features","type":"module"},{"id":"ember-4.0.1-@ember/component/template-only","type":"module"},{"id":"ember-4.0.1-@ember/controller","type":"module"},{"id":"ember-4.0.1-@ember/destroyable","type":"module"},{"id":"ember-4.0.1-@ember/engine","type":"module"},{"id":"ember-4.0.1-@ember/error","type":"module"},{"id":"ember-4.0.1-@ember/helper","type":"module"},{"id":"ember-4.0.1-@ember/instrumentation","type":"module"},{"id":"ember-4.0.1-@ember/polyfills","type":"module"},{"id":"ember-4.0.1-@ember/runloop","type":"module"},{"id":"ember-4.0.1-@ember/service","type":"module"},{"id":"ember-4.0.1-@ember/string","type":"module"},{"id":"ember-4.0.1-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.0.1-Container","type":"class"},{"id":"ember-4.0.1-Registry","type":"class"},{"id":"ember-4.0.1-ComponentStateBucket","type":"class"},{"id":"ember-4.0.1-Descriptor","type":"class"},{"id":"ember-4.0.1-Ember.InjectedProperty","type":"class"},{"id":"ember-4.0.1-Libraries","type":"class"},{"id":"ember-4.0.1-Ember.ControllerMixin","type":"class"},{"id":"ember-4.0.1-Location","type":"class"},{"id":"ember-4.0.1-RoutingService","type":"class"},{"id":"ember-4.0.1-BucketCache","type":"class"},{"id":"ember-4.0.1-Ember.ProxyMixin","type":"class"},{"id":"ember-4.0.1-Ember.ActionHandler","type":"class"},{"id":"ember-4.0.1-Ember.Comparable","type":"class"},{"id":"ember-4.0.1-ContainerProxyMixin","type":"class"},{"id":"ember-4.0.1-Enumerable","type":"class"},{"id":"ember-4.0.1-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.0.1-RegistryProxyMixin","type":"class"},{"id":"ember-4.0.1-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.0.1-Ember.ActionSupport","type":"class"},{"id":"ember-4.0.1-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.0.1-Ember.ViewMixin","type":"class"},{"id":"ember-4.0.1-Ember.EventDispatcher","type":"class"},{"id":"ember-4.0.1-Ember.CoreView","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.0.1-Promise","type":"class"},{"id":"ember-4.0.1-EventTarget","type":"class"},{"id":"ember-4.0.1-EmberENV","type":"class"},{"id":"ember-4.0.1-ContainerDebugAdapter","type":"class"},{"id":"ember-4.0.1-DataAdapter","type":"class"},{"id":"ember-4.0.1-Ember.Templates.helpers","type":"class"},{"id":"ember-4.0.1-Component","type":"class"},{"id":"ember-4.0.1-Helper","type":"class"},{"id":"ember-4.0.1-ComputedProperty","type":"class"},{"id":"ember-4.0.1-Mixin","type":"class"},{"id":"ember-4.0.1-HashLocation","type":"class"},{"id":"ember-4.0.1-HistoryLocation","type":"class"},{"id":"ember-4.0.1-NoneLocation","type":"class"},{"id":"ember-4.0.1-RouterService","type":"class"},{"id":"ember-4.0.1-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.0.1-RouteInfo","type":"class"},{"id":"ember-4.0.1-Route","type":"class"},{"id":"ember-4.0.1-EmberRouter","type":"class"},{"id":"ember-4.0.1-Transition","type":"class"},{"id":"ember-4.0.1-EmberArray","type":"class"},{"id":"ember-4.0.1-MutableArray","type":"class"},{"id":"ember-4.0.1-Ember.NativeArray","type":"class"},{"id":"ember-4.0.1-Evented","type":"class"},{"id":"ember-4.0.1-Observable","type":"class"},{"id":"ember-4.0.1-PromiseProxyMixin","type":"class"},{"id":"ember-4.0.1-ArrayProxy","type":"class"},{"id":"ember-4.0.1-CoreObject","type":"class"},{"id":"ember-4.0.1-Ember.Namespace","type":"class"},{"id":"ember-4.0.1-EmberObject","type":"class"},{"id":"ember-4.0.1-ObjectProxy","type":"class"},{"id":"ember-4.0.1-Application","type":"class"},{"id":"ember-4.0.1-ApplicationInstance","type":"class"},{"id":"ember-4.0.1-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.0.1-Controller","type":"class"},{"id":"ember-4.0.1-Engine","type":"class"},{"id":"ember-4.0.1-EngineInstance","type":"class"},{"id":"ember-4.0.1-Ember.Error","type":"class"},{"id":"ember-4.0.1-Service","type":"class"},{"id":"ember-4.0.1-String","type":"class"},{"id":"ember-4.0.1-TestAdapter","type":"class"},{"id":"ember-4.0.1-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.0.1-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.0.1-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.0.1-AutoLocation","type":"namespace"},{"id":"ember-4.0.1-FEATURES","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.0.1-ember","type":"module"},{"id":"ember-4.0.1-@ember/enumerable","type":"module"},{"id":"ember-4.0.1-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.0.1-rsvp","type":"module"},{"id":"ember-4.0.1-@ember/debug","type":"module"},{"id":"ember-4.0.1-@ember/component","type":"module"},{"id":"ember-4.0.1-@ember/routing","type":"module"},{"id":"ember-4.0.1-@ember/template","type":"module"},{"id":"ember-4.0.1-@glimmer/component","type":"module"},{"id":"ember-4.0.1-@glimmer/tracking","type":"module"},{"id":"ember-4.0.1-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.0.1-@ember/object","type":"module"},{"id":"ember-4.0.1-@ember/utils","type":"module"},{"id":"ember-4.0.1-@ember/application","type":"module"},{"id":"ember-4.0.1-@ember/array","type":"module"},{"id":"ember-4.0.1-@ember/canary-features","type":"module"},{"id":"ember-4.0.1-@ember/component/template-only","type":"module"},{"id":"ember-4.0.1-@ember/controller","type":"module"},{"id":"ember-4.0.1-@ember/destroyable","type":"module"},{"id":"ember-4.0.1-@ember/engine","type":"module"},{"id":"ember-4.0.1-@ember/error","type":"module"},{"id":"ember-4.0.1-@ember/helper","type":"module"},{"id":"ember-4.0.1-@ember/polyfills","type":"module"},{"id":"ember-4.0.1-@ember/runloop","type":"module"},{"id":"ember-4.0.1-@ember/service","type":"module"},{"id":"ember-4.0.1-@ember/string","type":"module"},{"id":"ember-4.0.1-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.0.1-Promise":"ember-4.0.1-Promise-2fffdbe32d","ember-4.0.1-EventTarget":"ember-4.0.1-EventTarget-2b90b0ef13","ember-4.0.1-Container":"ember-4.0.1-Container-6efb2dc1de","ember-4.0.1-Registry":"ember-4.0.1-Registry-f5314fd9de","ember-4.0.1-EmberENV":"ember-4.0.1-EmberENV-490ed4485e","ember-4.0.1-ContainerDebugAdapter":"ember-4.0.1-ContainerDebugAdapter-75949363ad","ember-4.0.1-DataAdapter":"ember-4.0.1-DataAdapter-93f594636a","ember-4.0.1-Ember.Templates.helpers":"ember-4.0.1-Ember.Templates.helpers-526b5dbc3c","ember-4.0.1-ComponentStateBucket":"ember-4.0.1-ComponentStateBucket-7e8937ae8f","ember-4.0.1-Component":"ember-4.0.1-Component-6938d1138b","ember-4.0.1-Helper":"ember-4.0.1-Helper-73e107271a","ember-4.0.1-ComputedProperty":"ember-4.0.1-ComputedProperty-c52a9f70b3","ember-4.0.1-Descriptor":"ember-4.0.1-Descriptor-1511f89624","ember-4.0.1-Ember.InjectedProperty":"ember-4.0.1-Ember.InjectedProperty-1fbd52735d","ember-4.0.1-Libraries":"ember-4.0.1-Libraries-04a454c758","ember-4.0.1-Mixin":"ember-4.0.1-Mixin-69632f3d61","ember-4.0.1-Ember.ControllerMixin":"ember-4.0.1-Ember.ControllerMixin-e3719ab8e0","ember-4.0.1-Location":"ember-4.0.1-Location-bff948f593","ember-4.0.1-HashLocation":"ember-4.0.1-HashLocation-84689093f7","ember-4.0.1-HistoryLocation":"ember-4.0.1-HistoryLocation-09cb47224f","ember-4.0.1-NoneLocation":"ember-4.0.1-NoneLocation-1f3a0525ef","ember-4.0.1-RouterService":"ember-4.0.1-RouterService-6c9dda8ec4","ember-4.0.1-RoutingService":"ember-4.0.1-RoutingService-d3c834fa28","ember-4.0.1-BucketCache":"ember-4.0.1-BucketCache-206fbfcfc5","ember-4.0.1-RouteInfoWithAttributes":"ember-4.0.1-RouteInfoWithAttributes-9a17144ca1","ember-4.0.1-RouteInfo":"ember-4.0.1-RouteInfo-6e79808894","ember-4.0.1-Route":"ember-4.0.1-Route-f8b8303f66","ember-4.0.1-EmberRouter":"ember-4.0.1-EmberRouter-1a976b52b8","ember-4.0.1-Transition":"ember-4.0.1-Transition-fd78f9e0fb","ember-4.0.1-Ember.ProxyMixin":"ember-4.0.1-Ember.ProxyMixin-719b70d1c8","ember-4.0.1-Ember.ActionHandler":"ember-4.0.1-Ember.ActionHandler-2c0951b249","ember-4.0.1-EmberArray":"ember-4.0.1-EmberArray-f9ec0d740f","ember-4.0.1-MutableArray":"ember-4.0.1-MutableArray-032b98d6bc","ember-4.0.1-Ember.NativeArray":"ember-4.0.1-Ember.NativeArray-b45c71a6b2","ember-4.0.1-Ember.Comparable":"ember-4.0.1-Ember.Comparable-4da4ac9a01","ember-4.0.1-ContainerProxyMixin":"ember-4.0.1-ContainerProxyMixin-0669dc511b","ember-4.0.1-Enumerable":"ember-4.0.1-Enumerable-0ccc221522","ember-4.0.1-Evented":"ember-4.0.1-Evented-529522a602","ember-4.0.1-Ember.MutableEnumerable":"ember-4.0.1-Ember.MutableEnumerable-3a9164f249","ember-4.0.1-Observable":"ember-4.0.1-Observable-9d4feec7f3","ember-4.0.1-PromiseProxyMixin":"ember-4.0.1-PromiseProxyMixin-c45b943c90","ember-4.0.1-RegistryProxyMixin":"ember-4.0.1-RegistryProxyMixin-3a66498414","ember-4.0.1-Ember.TargetActionSupport":"ember-4.0.1-Ember.TargetActionSupport-ebca97fdde","ember-4.0.1-ArrayProxy":"ember-4.0.1-ArrayProxy-6754bacb0e","ember-4.0.1-CoreObject":"ember-4.0.1-CoreObject-b3457bc2d7","ember-4.0.1-Ember.Namespace":"ember-4.0.1-Ember.Namespace-bba27f9021","ember-4.0.1-EmberObject":"ember-4.0.1-EmberObject-bd28f9b55e","ember-4.0.1-ObjectProxy":"ember-4.0.1-ObjectProxy-7ee1fea55d","ember-4.0.1-Ember.ActionSupport":"ember-4.0.1-Ember.ActionSupport-5b261851e1","ember-4.0.1-Ember.ClassNamesSupport":"ember-4.0.1-Ember.ClassNamesSupport-52bb976cc9","ember-4.0.1-Ember.ViewMixin":"ember-4.0.1-Ember.ViewMixin-8c0bd293e8","ember-4.0.1-Ember.EventDispatcher":"ember-4.0.1-Ember.EventDispatcher-a4ee3cb91a","ember-4.0.1-Ember.CoreView":"ember-4.0.1-Ember.CoreView-7f2eca7a80","ember-4.0.1-Application":"ember-4.0.1-Application-3b416fd6e3","ember-4.0.1-ApplicationInstance":"ember-4.0.1-ApplicationInstance-05a7c74eb6","ember-4.0.1-ApplicationInstance.BootOptions":"ember-4.0.1-ApplicationInstance.BootOptions-96e98b3328","ember-4.0.1-Controller":"ember-4.0.1-Controller-ac03eda450","ember-4.0.1-Engine":"ember-4.0.1-Engine-595291bca1","ember-4.0.1-EngineInstance":"ember-4.0.1-EngineInstance-3954f6543f","ember-4.0.1-Ember.Error":"ember-4.0.1-Ember.Error-00f01bb5fa","ember-4.0.1-Service":"ember-4.0.1-Service-684b92ea5d","ember-4.0.1-String":"ember-4.0.1-String-141d7bb799","ember-4.0.1-TestAdapter":"ember-4.0.1-TestAdapter-f69439617b","ember-4.0.1-Ember.Test.QUnitAdapter":"ember-4.0.1-Ember.Test.QUnitAdapter-3bb2eef69d","ember-4.0.1-Ember.Test":"ember-4.0.1-Ember.Test-0b94100750","ember-4.0.1-Ember":"ember-4.0.1-Ember-48a911468d","ember-4.0.1-Ember.Templates.components":"ember-4.0.1-Ember.Templates.components-e819de13ce","ember-4.0.1-rsvp":"ember-4.0.1-rsvp-6c4241982c","ember-4.0.1-@ember/application":"ember-4.0.1-@ember/application-983147660f","ember-4.0.1-@ember/array":"ember-4.0.1-@ember/array-aafc9c17e5","ember-4.0.1-@ember/component":"ember-4.0.1-@ember/component-44c80b6af7","ember-4.0.1-@ember/component/helper":"ember-4.0.1-@ember/component/helper-26ebb5a023","ember-4.0.1-@ember/component/template-only":"ember-4.0.1-@ember/component/template-only-8f74c769db","ember-4.0.1-@ember/controller":"ember-4.0.1-@ember/controller-87799536d4","ember-4.0.1-@ember/debug":"ember-4.0.1-@ember/debug-09da60f065","ember-4.0.1-@ember/destroyable":"ember-4.0.1-@ember/destroyable-8c92feaf76","ember-4.0.1-@ember/engine":"ember-4.0.1-@ember/engine-e6384f8d1a","ember-4.0.1-@ember/helper":"ember-4.0.1-@ember/helper-8fba6ec6e4","ember-4.0.1-@ember/instrumentation":"ember-4.0.1-@ember/instrumentation-4e4ee49d56","ember-4.0.1-@ember/object":"ember-4.0.1-@ember/object-e2be4e70da","ember-4.0.1-@ember/object/compat":"ember-4.0.1-@ember/object/compat-5ea70e932a","ember-4.0.1-@ember/object/computed":"ember-4.0.1-@ember/object/computed-b0b35cd8ce","ember-4.0.1-@ember/object/evented":"ember-4.0.1-@ember/object/evented-d531c4db62","ember-4.0.1-@ember/object/events":"ember-4.0.1-@ember/object/events-9b6fad393a","ember-4.0.1-@ember/object/internals":"ember-4.0.1-@ember/object/internals-afd05c555e","ember-4.0.1-@ember/object/mixin":"ember-4.0.1-@ember/object/mixin-d8fd48c821","ember-4.0.1-@ember/object/observers":"ember-4.0.1-@ember/object/observers-a4011ce3e0","ember-4.0.1-@ember/polyfills":"ember-4.0.1-@ember/polyfills-ae9ff364ec","ember-4.0.1-@ember/routing":"ember-4.0.1-@ember/routing-804c8b1287","ember-4.0.1-@ember/runloop":"ember-4.0.1-@ember/runloop-a604235049","ember-4.0.1-@ember/service":"ember-4.0.1-@ember/service-3a9ddb36e8","ember-4.0.1-@ember/template":"ember-4.0.1-@ember/template-bb2f471d02","ember-4.0.1-@ember/test":"ember-4.0.1-@ember/test-8d39c41e5c","ember-4.0.1-@ember/utils":"ember-4.0.1-@ember/utils-b8556f57a8","ember-4.0.1-@glimmer/tracking":"ember-4.0.1-@glimmer/tracking-a60ef3cf37","ember-4.0.1-@glimmer/tracking/primitives/cache":"ember-4.0.1-@glimmer/tracking/primitives/cache-4e305038f5"},"namespace":{"ember-4.0.1-AutoLocation":"ember-4.0.1-AutoLocation-2cb9ef8ade","ember-4.0.1-FEATURES":"ember-4.0.1-FEATURES-c8efcf8f17","ember-4.0.1-Instrumentation":"ember-4.0.1-Instrumentation-2c452e24f3"},"module":{"ember-4.0.1-rsvp":"ember-4.0.1-rsvp-6e16a08a26","ember-4.0.1-@ember/debug":"ember-4.0.1-@ember/debug-e59fce899b","ember-4.0.1-@ember/component":"ember-4.0.1-@ember/component-e3f57cab24","ember-4.0.1-@ember/routing":"ember-4.0.1-@ember/routing-186a718b15","ember-4.0.1-ember":"ember-4.0.1-ember-46f24beb54","ember-4.0.1-@ember/template":"ember-4.0.1-@ember/template-b5356a32d5","ember-4.0.1-@glimmer/component":"ember-4.0.1-@glimmer/component-ed33a47663","ember-4.0.1-@glimmer/tracking":"ember-4.0.1-@glimmer/tracking-e85d0f65a6","ember-4.0.1-@glimmer/tracking/primitives/cache":"ember-4.0.1-@glimmer/tracking/primitives/cache-bdd4a39680","ember-4.0.1-@ember/object":"ember-4.0.1-@ember/object-4d79bb095c","ember-4.0.1-@ember/utils":"ember-4.0.1-@ember/utils-ab3d3c481b","ember-4.0.1-@ember/application":"ember-4.0.1-@ember/application-c7847eb7d6","ember-4.0.1-@ember/array":"ember-4.0.1-@ember/array-62a641f74f","ember-4.0.1-@ember/enumerable":"ember-4.0.1-@ember/enumerable-017fd87163","ember-4.0.1-@ember/canary-features":"ember-4.0.1-@ember/canary-features-20b5e1c0a5","ember-4.0.1-@ember/component/template-only":"ember-4.0.1-@ember/component/template-only-ac1274e33d","ember-4.0.1-@ember/controller":"ember-4.0.1-@ember/controller-190b6c7b74","ember-4.0.1-@ember/destroyable":"ember-4.0.1-@ember/destroyable-9245513309","ember-4.0.1-@ember/engine":"ember-4.0.1-@ember/engine-b4d08253af","ember-4.0.1-@ember/error":"ember-4.0.1-@ember/error-f3387ddd8d","ember-4.0.1-@ember/helper":"ember-4.0.1-@ember/helper-97a2c582c0","ember-4.0.1-@ember/instrumentation":"ember-4.0.1-@ember/instrumentation-201c8384f3","ember-4.0.1-@ember/polyfills":"ember-4.0.1-@ember/polyfills-51565a8263","ember-4.0.1-@ember/runloop":"ember-4.0.1-@ember/runloop-63495de08d","ember-4.0.1-@ember/service":"ember-4.0.1-@ember/service-c2059dc734","ember-4.0.1-@ember/string":"ember-4.0.1-@ember/string-b88dfcf18b","ember-4.0.1-@ember/test":"ember-4.0.1-@ember/test-0797dc0a79"},"missing":{"Ember.Object":"Ember.Object-9c32970d20","Error":"Error-158974c414"}}} \ No newline at end of file +{"data":{"id":"ember-4.0.1","type":"project-version","attributes":{"version":"4.0.1"},"relationships":{"classes":{"data":[{"id":"ember-4.0.1-Promise","type":"class"},{"id":"ember-4.0.1-EventTarget","type":"class"},{"id":"ember-4.0.1-Container","type":"class"},{"id":"ember-4.0.1-Registry","type":"class"},{"id":"ember-4.0.1-EmberENV","type":"class"},{"id":"ember-4.0.1-ContainerDebugAdapter","type":"class"},{"id":"ember-4.0.1-DataAdapter","type":"class"},{"id":"ember-4.0.1-Ember.Templates.helpers","type":"class"},{"id":"ember-4.0.1-ComponentStateBucket","type":"class"},{"id":"ember-4.0.1-Component","type":"class"},{"id":"ember-4.0.1-Helper","type":"class"},{"id":"ember-4.0.1-ComputedProperty","type":"class"},{"id":"ember-4.0.1-Descriptor","type":"class"},{"id":"ember-4.0.1-Ember.InjectedProperty","type":"class"},{"id":"ember-4.0.1-Libraries","type":"class"},{"id":"ember-4.0.1-Mixin","type":"class"},{"id":"ember-4.0.1-Ember.ControllerMixin","type":"class"},{"id":"ember-4.0.1-Location","type":"class"},{"id":"ember-4.0.1-HashLocation","type":"class"},{"id":"ember-4.0.1-HistoryLocation","type":"class"},{"id":"ember-4.0.1-NoneLocation","type":"class"},{"id":"ember-4.0.1-RouterService","type":"class"},{"id":"ember-4.0.1-RoutingService","type":"class"},{"id":"ember-4.0.1-BucketCache","type":"class"},{"id":"ember-4.0.1-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.0.1-RouteInfo","type":"class"},{"id":"ember-4.0.1-Route","type":"class"},{"id":"ember-4.0.1-EmberRouter","type":"class"},{"id":"ember-4.0.1-Transition","type":"class"},{"id":"ember-4.0.1-Ember.ProxyMixin","type":"class"},{"id":"ember-4.0.1-Ember.ActionHandler","type":"class"},{"id":"ember-4.0.1-EmberArray","type":"class"},{"id":"ember-4.0.1-MutableArray","type":"class"},{"id":"ember-4.0.1-Ember.NativeArray","type":"class"},{"id":"ember-4.0.1-Ember.Comparable","type":"class"},{"id":"ember-4.0.1-ContainerProxyMixin","type":"class"},{"id":"ember-4.0.1-Enumerable","type":"class"},{"id":"ember-4.0.1-Evented","type":"class"},{"id":"ember-4.0.1-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.0.1-Observable","type":"class"},{"id":"ember-4.0.1-PromiseProxyMixin","type":"class"},{"id":"ember-4.0.1-RegistryProxyMixin","type":"class"},{"id":"ember-4.0.1-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.0.1-ArrayProxy","type":"class"},{"id":"ember-4.0.1-CoreObject","type":"class"},{"id":"ember-4.0.1-Ember.Namespace","type":"class"},{"id":"ember-4.0.1-EmberObject","type":"class"},{"id":"ember-4.0.1-ObjectProxy","type":"class"},{"id":"ember-4.0.1-Ember.ActionSupport","type":"class"},{"id":"ember-4.0.1-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.0.1-Ember.ViewMixin","type":"class"},{"id":"ember-4.0.1-Ember.EventDispatcher","type":"class"},{"id":"ember-4.0.1-Ember.CoreView","type":"class"},{"id":"ember-4.0.1-Application","type":"class"},{"id":"ember-4.0.1-ApplicationInstance","type":"class"},{"id":"ember-4.0.1-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.0.1-Controller","type":"class"},{"id":"ember-4.0.1-Engine","type":"class"},{"id":"ember-4.0.1-EngineInstance","type":"class"},{"id":"ember-4.0.1-Ember.Error","type":"class"},{"id":"ember-4.0.1-Service","type":"class"},{"id":"ember-4.0.1-String","type":"class"},{"id":"ember-4.0.1-TestAdapter","type":"class"},{"id":"ember-4.0.1-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.0.1-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.0.1-AutoLocation","type":"namespace"},{"id":"ember-4.0.1-FEATURES","type":"namespace"},{"id":"ember-4.0.1-Instrumentation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.0.1-rsvp","type":"module"},{"id":"ember-4.0.1-@ember/debug","type":"module"},{"id":"ember-4.0.1-@ember/component","type":"module"},{"id":"ember-4.0.1-@ember/routing","type":"module"},{"id":"ember-4.0.1-ember","type":"module"},{"id":"ember-4.0.1-@ember/template","type":"module"},{"id":"ember-4.0.1-@glimmer/component","type":"module"},{"id":"ember-4.0.1-@glimmer/tracking","type":"module"},{"id":"ember-4.0.1-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.0.1-@ember/object","type":"module"},{"id":"ember-4.0.1-@ember/utils","type":"module"},{"id":"ember-4.0.1-@ember/application","type":"module"},{"id":"ember-4.0.1-@ember/array","type":"module"},{"id":"ember-4.0.1-@ember/enumerable","type":"module"},{"id":"ember-4.0.1-@ember/canary-features","type":"module"},{"id":"ember-4.0.1-@ember/component/template-only","type":"module"},{"id":"ember-4.0.1-@ember/controller","type":"module"},{"id":"ember-4.0.1-@ember/destroyable","type":"module"},{"id":"ember-4.0.1-@ember/engine","type":"module"},{"id":"ember-4.0.1-@ember/error","type":"module"},{"id":"ember-4.0.1-@ember/helper","type":"module"},{"id":"ember-4.0.1-@ember/instrumentation","type":"module"},{"id":"ember-4.0.1-@ember/polyfills","type":"module"},{"id":"ember-4.0.1-@ember/runloop","type":"module"},{"id":"ember-4.0.1-@ember/service","type":"module"},{"id":"ember-4.0.1-@ember/string","type":"module"},{"id":"ember-4.0.1-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.0.1-Container","type":"class"},{"id":"ember-4.0.1-Registry","type":"class"},{"id":"ember-4.0.1-ComponentStateBucket","type":"class"},{"id":"ember-4.0.1-Descriptor","type":"class"},{"id":"ember-4.0.1-Ember.InjectedProperty","type":"class"},{"id":"ember-4.0.1-Libraries","type":"class"},{"id":"ember-4.0.1-Ember.ControllerMixin","type":"class"},{"id":"ember-4.0.1-Location","type":"class"},{"id":"ember-4.0.1-RoutingService","type":"class"},{"id":"ember-4.0.1-BucketCache","type":"class"},{"id":"ember-4.0.1-Ember.ProxyMixin","type":"class"},{"id":"ember-4.0.1-Ember.ActionHandler","type":"class"},{"id":"ember-4.0.1-Ember.Comparable","type":"class"},{"id":"ember-4.0.1-ContainerProxyMixin","type":"class"},{"id":"ember-4.0.1-Enumerable","type":"class"},{"id":"ember-4.0.1-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.0.1-RegistryProxyMixin","type":"class"},{"id":"ember-4.0.1-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.0.1-Ember.ActionSupport","type":"class"},{"id":"ember-4.0.1-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.0.1-Ember.ViewMixin","type":"class"},{"id":"ember-4.0.1-Ember.EventDispatcher","type":"class"},{"id":"ember-4.0.1-Ember.CoreView","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.0.1-Promise","type":"class"},{"id":"ember-4.0.1-EventTarget","type":"class"},{"id":"ember-4.0.1-EmberENV","type":"class"},{"id":"ember-4.0.1-ContainerDebugAdapter","type":"class"},{"id":"ember-4.0.1-DataAdapter","type":"class"},{"id":"ember-4.0.1-Ember.Templates.helpers","type":"class"},{"id":"ember-4.0.1-Component","type":"class"},{"id":"ember-4.0.1-Helper","type":"class"},{"id":"ember-4.0.1-ComputedProperty","type":"class"},{"id":"ember-4.0.1-Mixin","type":"class"},{"id":"ember-4.0.1-HashLocation","type":"class"},{"id":"ember-4.0.1-HistoryLocation","type":"class"},{"id":"ember-4.0.1-NoneLocation","type":"class"},{"id":"ember-4.0.1-RouterService","type":"class"},{"id":"ember-4.0.1-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.0.1-RouteInfo","type":"class"},{"id":"ember-4.0.1-Route","type":"class"},{"id":"ember-4.0.1-EmberRouter","type":"class"},{"id":"ember-4.0.1-Transition","type":"class"},{"id":"ember-4.0.1-EmberArray","type":"class"},{"id":"ember-4.0.1-MutableArray","type":"class"},{"id":"ember-4.0.1-Ember.NativeArray","type":"class"},{"id":"ember-4.0.1-Evented","type":"class"},{"id":"ember-4.0.1-Observable","type":"class"},{"id":"ember-4.0.1-PromiseProxyMixin","type":"class"},{"id":"ember-4.0.1-ArrayProxy","type":"class"},{"id":"ember-4.0.1-CoreObject","type":"class"},{"id":"ember-4.0.1-Ember.Namespace","type":"class"},{"id":"ember-4.0.1-EmberObject","type":"class"},{"id":"ember-4.0.1-ObjectProxy","type":"class"},{"id":"ember-4.0.1-Application","type":"class"},{"id":"ember-4.0.1-ApplicationInstance","type":"class"},{"id":"ember-4.0.1-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.0.1-Controller","type":"class"},{"id":"ember-4.0.1-Engine","type":"class"},{"id":"ember-4.0.1-EngineInstance","type":"class"},{"id":"ember-4.0.1-Ember.Error","type":"class"},{"id":"ember-4.0.1-Service","type":"class"},{"id":"ember-4.0.1-String","type":"class"},{"id":"ember-4.0.1-TestAdapter","type":"class"},{"id":"ember-4.0.1-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.0.1-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.0.1-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.0.1-AutoLocation","type":"namespace"},{"id":"ember-4.0.1-FEATURES","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.0.1-ember","type":"module"},{"id":"ember-4.0.1-@ember/enumerable","type":"module"},{"id":"ember-4.0.1-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.0.1-rsvp","type":"module"},{"id":"ember-4.0.1-@ember/debug","type":"module"},{"id":"ember-4.0.1-@ember/component","type":"module"},{"id":"ember-4.0.1-@ember/routing","type":"module"},{"id":"ember-4.0.1-@ember/template","type":"module"},{"id":"ember-4.0.1-@glimmer/component","type":"module"},{"id":"ember-4.0.1-@glimmer/tracking","type":"module"},{"id":"ember-4.0.1-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.0.1-@ember/object","type":"module"},{"id":"ember-4.0.1-@ember/utils","type":"module"},{"id":"ember-4.0.1-@ember/application","type":"module"},{"id":"ember-4.0.1-@ember/array","type":"module"},{"id":"ember-4.0.1-@ember/canary-features","type":"module"},{"id":"ember-4.0.1-@ember/component/template-only","type":"module"},{"id":"ember-4.0.1-@ember/controller","type":"module"},{"id":"ember-4.0.1-@ember/destroyable","type":"module"},{"id":"ember-4.0.1-@ember/engine","type":"module"},{"id":"ember-4.0.1-@ember/error","type":"module"},{"id":"ember-4.0.1-@ember/helper","type":"module"},{"id":"ember-4.0.1-@ember/polyfills","type":"module"},{"id":"ember-4.0.1-@ember/runloop","type":"module"},{"id":"ember-4.0.1-@ember/service","type":"module"},{"id":"ember-4.0.1-@ember/string","type":"module"},{"id":"ember-4.0.1-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.0.1-Promise":"ember-4.0.1-Promise-8901bae337","ember-4.0.1-EventTarget":"ember-4.0.1-EventTarget-2b90b0ef13","ember-4.0.1-Container":"ember-4.0.1-Container-c84f343883","ember-4.0.1-Registry":"ember-4.0.1-Registry-aa9246bf5a","ember-4.0.1-EmberENV":"ember-4.0.1-EmberENV-490ed4485e","ember-4.0.1-ContainerDebugAdapter":"ember-4.0.1-ContainerDebugAdapter-61ddc54895","ember-4.0.1-DataAdapter":"ember-4.0.1-DataAdapter-af8dd8ddc3","ember-4.0.1-Ember.Templates.helpers":"ember-4.0.1-Ember.Templates.helpers-d123df67ff","ember-4.0.1-ComponentStateBucket":"ember-4.0.1-ComponentStateBucket-7e8937ae8f","ember-4.0.1-Component":"ember-4.0.1-Component-71a890b540","ember-4.0.1-Helper":"ember-4.0.1-Helper-41053a2b49","ember-4.0.1-ComputedProperty":"ember-4.0.1-ComputedProperty-4213817743","ember-4.0.1-Descriptor":"ember-4.0.1-Descriptor-1511f89624","ember-4.0.1-Ember.InjectedProperty":"ember-4.0.1-Ember.InjectedProperty-1fbd52735d","ember-4.0.1-Libraries":"ember-4.0.1-Libraries-04a454c758","ember-4.0.1-Mixin":"ember-4.0.1-Mixin-7f8a6cdc1e","ember-4.0.1-Ember.ControllerMixin":"ember-4.0.1-Ember.ControllerMixin-153f7df9ea","ember-4.0.1-Location":"ember-4.0.1-Location-3b07fc6af3","ember-4.0.1-HashLocation":"ember-4.0.1-HashLocation-b21fdd13bb","ember-4.0.1-HistoryLocation":"ember-4.0.1-HistoryLocation-973c4c79d6","ember-4.0.1-NoneLocation":"ember-4.0.1-NoneLocation-aa8c0b0355","ember-4.0.1-RouterService":"ember-4.0.1-RouterService-1793760d6a","ember-4.0.1-RoutingService":"ember-4.0.1-RoutingService-d3c834fa28","ember-4.0.1-BucketCache":"ember-4.0.1-BucketCache-206fbfcfc5","ember-4.0.1-RouteInfoWithAttributes":"ember-4.0.1-RouteInfoWithAttributes-8db2d159aa","ember-4.0.1-RouteInfo":"ember-4.0.1-RouteInfo-916bbb4624","ember-4.0.1-Route":"ember-4.0.1-Route-56f8777673","ember-4.0.1-EmberRouter":"ember-4.0.1-EmberRouter-1c6462909c","ember-4.0.1-Transition":"ember-4.0.1-Transition-fd78f9e0fb","ember-4.0.1-Ember.ProxyMixin":"ember-4.0.1-Ember.ProxyMixin-719b70d1c8","ember-4.0.1-Ember.ActionHandler":"ember-4.0.1-Ember.ActionHandler-6769ecc29a","ember-4.0.1-EmberArray":"ember-4.0.1-EmberArray-04735349cb","ember-4.0.1-MutableArray":"ember-4.0.1-MutableArray-6a3cbd8f15","ember-4.0.1-Ember.NativeArray":"ember-4.0.1-Ember.NativeArray-6c782342cf","ember-4.0.1-Ember.Comparable":"ember-4.0.1-Ember.Comparable-4da4ac9a01","ember-4.0.1-ContainerProxyMixin":"ember-4.0.1-ContainerProxyMixin-0ea9c8315c","ember-4.0.1-Enumerable":"ember-4.0.1-Enumerable-0ccc221522","ember-4.0.1-Evented":"ember-4.0.1-Evented-9eb749a461","ember-4.0.1-Ember.MutableEnumerable":"ember-4.0.1-Ember.MutableEnumerable-3a9164f249","ember-4.0.1-Observable":"ember-4.0.1-Observable-9181bd1ee5","ember-4.0.1-PromiseProxyMixin":"ember-4.0.1-PromiseProxyMixin-900b54daf3","ember-4.0.1-RegistryProxyMixin":"ember-4.0.1-RegistryProxyMixin-5199da5bad","ember-4.0.1-Ember.TargetActionSupport":"ember-4.0.1-Ember.TargetActionSupport-5f40b61e96","ember-4.0.1-ArrayProxy":"ember-4.0.1-ArrayProxy-776e95183f","ember-4.0.1-CoreObject":"ember-4.0.1-CoreObject-cb6bb6c2a7","ember-4.0.1-Ember.Namespace":"ember-4.0.1-Ember.Namespace-911d111899","ember-4.0.1-EmberObject":"ember-4.0.1-EmberObject-20bb03115d","ember-4.0.1-ObjectProxy":"ember-4.0.1-ObjectProxy-e08d2e0204","ember-4.0.1-Ember.ActionSupport":"ember-4.0.1-Ember.ActionSupport-5b261851e1","ember-4.0.1-Ember.ClassNamesSupport":"ember-4.0.1-Ember.ClassNamesSupport-52bb976cc9","ember-4.0.1-Ember.ViewMixin":"ember-4.0.1-Ember.ViewMixin-872625865a","ember-4.0.1-Ember.EventDispatcher":"ember-4.0.1-Ember.EventDispatcher-211751a76b","ember-4.0.1-Ember.CoreView":"ember-4.0.1-Ember.CoreView-37be1a0f6b","ember-4.0.1-Application":"ember-4.0.1-Application-730ad5a79e","ember-4.0.1-ApplicationInstance":"ember-4.0.1-ApplicationInstance-3c04e49848","ember-4.0.1-ApplicationInstance.BootOptions":"ember-4.0.1-ApplicationInstance.BootOptions-b48fa76c23","ember-4.0.1-Controller":"ember-4.0.1-Controller-d54fe44a2e","ember-4.0.1-Engine":"ember-4.0.1-Engine-64488041c4","ember-4.0.1-EngineInstance":"ember-4.0.1-EngineInstance-bd34f43cb1","ember-4.0.1-Ember.Error":"ember-4.0.1-Ember.Error-00f01bb5fa","ember-4.0.1-Service":"ember-4.0.1-Service-e7c8f43e1b","ember-4.0.1-String":"ember-4.0.1-String-24bddac681","ember-4.0.1-TestAdapter":"ember-4.0.1-TestAdapter-f69439617b","ember-4.0.1-Ember.Test.QUnitAdapter":"ember-4.0.1-Ember.Test.QUnitAdapter-3bb2eef69d","ember-4.0.1-Ember.Test":"ember-4.0.1-Ember.Test-3c9dde19d1","ember-4.0.1-Ember":"ember-4.0.1-Ember-48a911468d","ember-4.0.1-Ember.Templates.components":"ember-4.0.1-Ember.Templates.components-9c3afb6702","ember-4.0.1-rsvp":"ember-4.0.1-rsvp-e1bd919c65","ember-4.0.1-@ember/application":"ember-4.0.1-@ember/application-1881ae8645","ember-4.0.1-@ember/array":"ember-4.0.1-@ember/array-aafc9c17e5","ember-4.0.1-@ember/component":"ember-4.0.1-@ember/component-44c80b6af7","ember-4.0.1-@ember/component/helper":"ember-4.0.1-@ember/component/helper-362e20c502","ember-4.0.1-@ember/component/template-only":"ember-4.0.1-@ember/component/template-only-8f74c769db","ember-4.0.1-@ember/controller":"ember-4.0.1-@ember/controller-cb2b88c0cc","ember-4.0.1-@ember/debug":"ember-4.0.1-@ember/debug-9e2214d3cf","ember-4.0.1-@ember/destroyable":"ember-4.0.1-@ember/destroyable-dc954b73a8","ember-4.0.1-@ember/engine":"ember-4.0.1-@ember/engine-e6384f8d1a","ember-4.0.1-@ember/helper":"ember-4.0.1-@ember/helper-c05ebf4468","ember-4.0.1-@ember/instrumentation":"ember-4.0.1-@ember/instrumentation-4e4ee49d56","ember-4.0.1-@ember/object":"ember-4.0.1-@ember/object-d1b9a5f61b","ember-4.0.1-@ember/object/compat":"ember-4.0.1-@ember/object/compat-54fe6c741d","ember-4.0.1-@ember/object/computed":"ember-4.0.1-@ember/object/computed-0852631994","ember-4.0.1-@ember/object/evented":"ember-4.0.1-@ember/object/evented-bc3aebcc7f","ember-4.0.1-@ember/object/events":"ember-4.0.1-@ember/object/events-9b6fad393a","ember-4.0.1-@ember/object/internals":"ember-4.0.1-@ember/object/internals-afd05c555e","ember-4.0.1-@ember/object/mixin":"ember-4.0.1-@ember/object/mixin-d8fd48c821","ember-4.0.1-@ember/object/observers":"ember-4.0.1-@ember/object/observers-a4011ce3e0","ember-4.0.1-@ember/polyfills":"ember-4.0.1-@ember/polyfills-2d8a185de1","ember-4.0.1-@ember/routing":"ember-4.0.1-@ember/routing-804c8b1287","ember-4.0.1-@ember/runloop":"ember-4.0.1-@ember/runloop-11e1af9814","ember-4.0.1-@ember/service":"ember-4.0.1-@ember/service-21971029b1","ember-4.0.1-@ember/template":"ember-4.0.1-@ember/template-bb2f471d02","ember-4.0.1-@ember/test":"ember-4.0.1-@ember/test-ac9ed7a884","ember-4.0.1-@ember/utils":"ember-4.0.1-@ember/utils-c206d527c3","ember-4.0.1-@glimmer/tracking":"ember-4.0.1-@glimmer/tracking-f54f0f2fd7","ember-4.0.1-@glimmer/tracking/primitives/cache":"ember-4.0.1-@glimmer/tracking/primitives/cache-c7e98bd7b1"},"namespace":{"ember-4.0.1-AutoLocation":"ember-4.0.1-AutoLocation-1e5fae2940","ember-4.0.1-FEATURES":"ember-4.0.1-FEATURES-c8efcf8f17","ember-4.0.1-Instrumentation":"ember-4.0.1-Instrumentation-f7974dcbbd"},"module":{"ember-4.0.1-rsvp":"ember-4.0.1-rsvp-6e16a08a26","ember-4.0.1-@ember/debug":"ember-4.0.1-@ember/debug-e59fce899b","ember-4.0.1-@ember/component":"ember-4.0.1-@ember/component-d15d9abbfb","ember-4.0.1-@ember/routing":"ember-4.0.1-@ember/routing-186a718b15","ember-4.0.1-ember":"ember-4.0.1-ember-46f24beb54","ember-4.0.1-@ember/template":"ember-4.0.1-@ember/template-b5356a32d5","ember-4.0.1-@glimmer/component":"ember-4.0.1-@glimmer/component-2b60cfc50c","ember-4.0.1-@glimmer/tracking":"ember-4.0.1-@glimmer/tracking-e85d0f65a6","ember-4.0.1-@glimmer/tracking/primitives/cache":"ember-4.0.1-@glimmer/tracking/primitives/cache-bdd4a39680","ember-4.0.1-@ember/object":"ember-4.0.1-@ember/object-4d79bb095c","ember-4.0.1-@ember/utils":"ember-4.0.1-@ember/utils-ab3d3c481b","ember-4.0.1-@ember/application":"ember-4.0.1-@ember/application-c7847eb7d6","ember-4.0.1-@ember/array":"ember-4.0.1-@ember/array-62a641f74f","ember-4.0.1-@ember/enumerable":"ember-4.0.1-@ember/enumerable-017fd87163","ember-4.0.1-@ember/canary-features":"ember-4.0.1-@ember/canary-features-20b5e1c0a5","ember-4.0.1-@ember/component/template-only":"ember-4.0.1-@ember/component/template-only-ac1274e33d","ember-4.0.1-@ember/controller":"ember-4.0.1-@ember/controller-190b6c7b74","ember-4.0.1-@ember/destroyable":"ember-4.0.1-@ember/destroyable-9245513309","ember-4.0.1-@ember/engine":"ember-4.0.1-@ember/engine-b4d08253af","ember-4.0.1-@ember/error":"ember-4.0.1-@ember/error-f3387ddd8d","ember-4.0.1-@ember/helper":"ember-4.0.1-@ember/helper-97a2c582c0","ember-4.0.1-@ember/instrumentation":"ember-4.0.1-@ember/instrumentation-201c8384f3","ember-4.0.1-@ember/polyfills":"ember-4.0.1-@ember/polyfills-51565a8263","ember-4.0.1-@ember/runloop":"ember-4.0.1-@ember/runloop-63495de08d","ember-4.0.1-@ember/service":"ember-4.0.1-@ember/service-c2059dc734","ember-4.0.1-@ember/string":"ember-4.0.1-@ember/string-b88dfcf18b","ember-4.0.1-@ember/test":"ember-4.0.1-@ember/test-0797dc0a79"},"missing":{"Ember.Object":"Ember.Object-9c32970d20","Error":"Error-158974c414"}}} \ No newline at end of file diff --git a/rev-index/ember-4.10.0.json b/rev-index/ember-4.10.0.json index f17024052..99632a397 100644 --- a/rev-index/ember-4.10.0.json +++ b/rev-index/ember-4.10.0.json @@ -1 +1 @@ -{"data":{"id":"ember-4.10.0","type":"project-version","attributes":{"version":"4.10.0"},"relationships":{"classes":{"data":[{"id":"ember-4.10.0-Promise","type":"class"},{"id":"ember-4.10.0-EventTarget","type":"class"},{"id":"ember-4.10.0-Container","type":"class"},{"id":"ember-4.10.0-Registry","type":"class"},{"id":"ember-4.10.0-EmberENV","type":"class"},{"id":"ember-4.10.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.10.0-ComponentStateBucket","type":"class"},{"id":"ember-4.10.0-Component","type":"class"},{"id":"ember-4.10.0-Helper","type":"class"},{"id":"ember-4.10.0-ComputedProperty","type":"class"},{"id":"ember-4.10.0-Descriptor","type":"class"},{"id":"ember-4.10.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.10.0-Libraries","type":"class"},{"id":"ember-4.10.0-FullName","type":"class"},{"id":"ember-4.10.0-BasicRegistry","type":"class"},{"id":"ember-4.10.0-BasicContainer","type":"class"},{"id":"ember-4.10.0-Owner","type":"class"},{"id":"ember-4.10.0-RegisterOptions","type":"class"},{"id":"ember-4.10.0-Factory","type":"class"},{"id":"ember-4.10.0-FactoryManager","type":"class"},{"id":"ember-4.10.0-Resolver","type":"class"},{"id":"ember-4.10.0-InternalFactory","type":"class"},{"id":"ember-4.10.0-ContainerProxy","type":"class"},{"id":"ember-4.10.0-RegistryProxy","type":"class"},{"id":"ember-4.10.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.10.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.10.0-Ember.Comparable","type":"class"},{"id":"ember-4.10.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.10.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.10.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.10.0-Ember.String","type":"class"},{"id":"ember-4.10.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.10.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.10.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.10.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.10.0-Ember.CoreView","type":"class"},{"id":"ember-4.10.0-Application","type":"class"},{"id":"ember-4.10.0-ApplicationInstance","type":"class"},{"id":"ember-4.10.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.10.0-Namespace","type":"class"},{"id":"ember-4.10.0-EmberArray","type":"class"},{"id":"ember-4.10.0-MutableArray","type":"class"},{"id":"ember-4.10.0-Ember.NativeArray","type":"class"},{"id":"ember-4.10.0-ArrayProxy","type":"class"},{"id":"ember-4.10.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.10.0-Ember.Controller","type":"class"},{"id":"ember-4.10.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.10.0-DataAdapter","type":"class"},{"id":"ember-4.10.0-Engine","type":"class"},{"id":"ember-4.10.0-EngineInstance","type":"class"},{"id":"ember-4.10.0-Enumerable","type":"class"},{"id":"ember-4.10.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.10.0-Ember.Error","type":"class"},{"id":"ember-4.10.0-CoreObject","type":"class"},{"id":"ember-4.10.0-Evented","type":"class"},{"id":"ember-4.10.0-EmberObject","type":"class"},{"id":"ember-4.10.0-Mixin","type":"class"},{"id":"ember-4.10.0-Observable","type":"class"},{"id":"ember-4.10.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.10.0-ObjectProxy","type":"class"},{"id":"ember-4.10.0-Renderer","type":"class"},{"id":"ember-4.10.0-BucketCache","type":"class"},{"id":"ember-4.10.0-RoutingService","type":"class"},{"id":"ember-4.10.0-HashLocation","type":"class"},{"id":"ember-4.10.0-HistoryLocation","type":"class"},{"id":"ember-4.10.0-Location","type":"class"},{"id":"ember-4.10.0-NoneLocation","type":"class"},{"id":"ember-4.10.0-RouteInfo","type":"class"},{"id":"ember-4.10.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.10.0-Route","type":"class"},{"id":"ember-4.10.0-RouterService","type":"class"},{"id":"ember-4.10.0-EmberRouter","type":"class"},{"id":"ember-4.10.0-Transition","type":"class"},{"id":"ember-4.10.0-Service","type":"class"},{"id":"ember-4.10.0-String","type":"class"},{"id":"ember-4.10.0-TestAdapter","type":"class"},{"id":"ember-4.10.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.10.0-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.10.0-FEATURES","type":"namespace"},{"id":"ember-4.10.0-Instrumentation","type":"namespace"},{"id":"ember-4.10.0-AutoLocation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.10.0-rsvp","type":"module"},{"id":"ember-4.10.0-@ember/component","type":"module"},{"id":"ember-4.10.0-@ember/routing","type":"module"},{"id":"ember-4.10.0-ember","type":"module"},{"id":"ember-4.10.0-@ember/template","type":"module"},{"id":"ember-4.10.0-@glimmer/component","type":"module"},{"id":"ember-4.10.0-@glimmer/tracking","type":"module"},{"id":"ember-4.10.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.10.0-@ember/object","type":"module"},{"id":"ember-4.10.0-@ember/owner","type":"module"},{"id":"ember-4.10.0-@ember/debug","type":"module"},{"id":"ember-4.10.0-@ember/utils","type":"module"},{"id":"ember-4.10.0-@ember/array","type":"module"},{"id":"ember-4.10.0-@ember/application","type":"module"},{"id":"ember-4.10.0-@ember/application/namespace","type":"module"},{"id":"ember-4.10.0-@ember/array/proxy","type":"module"},{"id":"ember-4.10.0-@ember/canary-features","type":"module"},{"id":"ember-4.10.0-@ember/component/template-only","type":"module"},{"id":"ember-4.10.0-ember/controller","type":"module"},{"id":"ember-4.10.0-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.10.0-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.10.0-@ember/destroyable","type":"module"},{"id":"ember-4.10.0-@ember/engine","type":"module"},{"id":"ember-4.10.0-@ember/enumerable","type":"module"},{"id":"ember-4.10.0-@ember/error","type":"module"},{"id":"ember-4.10.0-@ember/helper","type":"module"},{"id":"ember-4.10.0-@ember/instrumentation","type":"module"},{"id":"ember-4.10.0-@ember/object/core","type":"module"},{"id":"ember-4.10.0-@ember/object/evented","type":"module"},{"id":"ember-4.10.0-@ember/object/mixin","type":"module"},{"id":"ember-4.10.0-@ember/object/observable","type":"module"},{"id":"ember-4.10.0-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.10.0-@ember/object/proxy","type":"module"},{"id":"ember-4.10.0-@ember/polyfills","type":"module"},{"id":"ember-4.10.0-@ember/renderer","type":"module"},{"id":"ember-4.10.0-ember/routing","type":"module"},{"id":"ember-4.10.0-@ember/routing/auto-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/hash-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/history-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/location","type":"module"},{"id":"ember-4.10.0-@ember/routing/none-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/route-info","type":"module"},{"id":"ember-4.10.0-@ember/routing/route","type":"module"},{"id":"ember-4.10.0-@ember/routing/router-service","type":"module"},{"id":"ember-4.10.0-@ember/routing/router","type":"module"},{"id":"ember-4.10.0-@ember/routing/transition","type":"module"},{"id":"ember-4.10.0-@ember/runloop","type":"module"},{"id":"ember-4.10.0-@ember/service","type":"module"},{"id":"ember-4.10.0-@ember/string","type":"module"},{"id":"ember-4.10.0-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.10.0-Container","type":"class"},{"id":"ember-4.10.0-Registry","type":"class"},{"id":"ember-4.10.0-ComponentStateBucket","type":"class"},{"id":"ember-4.10.0-Descriptor","type":"class"},{"id":"ember-4.10.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.10.0-Libraries","type":"class"},{"id":"ember-4.10.0-BasicRegistry","type":"class"},{"id":"ember-4.10.0-BasicContainer","type":"class"},{"id":"ember-4.10.0-InternalFactory","type":"class"},{"id":"ember-4.10.0-ContainerProxy","type":"class"},{"id":"ember-4.10.0-RegistryProxy","type":"class"},{"id":"ember-4.10.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.10.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.10.0-Ember.Comparable","type":"class"},{"id":"ember-4.10.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.10.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.10.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.10.0-Ember.String","type":"class"},{"id":"ember-4.10.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.10.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.10.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.10.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.10.0-Ember.CoreView","type":"class"},{"id":"ember-4.10.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.10.0-Enumerable","type":"class"},{"id":"ember-4.10.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.10.0-Ember.Error","type":"class"},{"id":"ember-4.10.0-BucketCache","type":"class"},{"id":"ember-4.10.0-RoutingService","type":"class"},{"id":"ember-4.10.0-Location","type":"class"},{"id":"ember-4.10.0-String","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.10.0-Promise","type":"class"},{"id":"ember-4.10.0-EventTarget","type":"class"},{"id":"ember-4.10.0-EmberENV","type":"class"},{"id":"ember-4.10.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.10.0-Component","type":"class"},{"id":"ember-4.10.0-Helper","type":"class"},{"id":"ember-4.10.0-ComputedProperty","type":"class"},{"id":"ember-4.10.0-FullName","type":"class"},{"id":"ember-4.10.0-Owner","type":"class"},{"id":"ember-4.10.0-RegisterOptions","type":"class"},{"id":"ember-4.10.0-Factory","type":"class"},{"id":"ember-4.10.0-FactoryManager","type":"class"},{"id":"ember-4.10.0-Resolver","type":"class"},{"id":"ember-4.10.0-Application","type":"class"},{"id":"ember-4.10.0-ApplicationInstance","type":"class"},{"id":"ember-4.10.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.10.0-Namespace","type":"class"},{"id":"ember-4.10.0-EmberArray","type":"class"},{"id":"ember-4.10.0-MutableArray","type":"class"},{"id":"ember-4.10.0-Ember.NativeArray","type":"class"},{"id":"ember-4.10.0-ArrayProxy","type":"class"},{"id":"ember-4.10.0-Ember.Controller","type":"class"},{"id":"ember-4.10.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.10.0-DataAdapter","type":"class"},{"id":"ember-4.10.0-Engine","type":"class"},{"id":"ember-4.10.0-EngineInstance","type":"class"},{"id":"ember-4.10.0-CoreObject","type":"class"},{"id":"ember-4.10.0-Evented","type":"class"},{"id":"ember-4.10.0-EmberObject","type":"class"},{"id":"ember-4.10.0-Mixin","type":"class"},{"id":"ember-4.10.0-Observable","type":"class"},{"id":"ember-4.10.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.10.0-ObjectProxy","type":"class"},{"id":"ember-4.10.0-Renderer","type":"class"},{"id":"ember-4.10.0-HashLocation","type":"class"},{"id":"ember-4.10.0-HistoryLocation","type":"class"},{"id":"ember-4.10.0-NoneLocation","type":"class"},{"id":"ember-4.10.0-RouteInfo","type":"class"},{"id":"ember-4.10.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.10.0-Route","type":"class"},{"id":"ember-4.10.0-RouterService","type":"class"},{"id":"ember-4.10.0-EmberRouter","type":"class"},{"id":"ember-4.10.0-Transition","type":"class"},{"id":"ember-4.10.0-Service","type":"class"},{"id":"ember-4.10.0-TestAdapter","type":"class"},{"id":"ember-4.10.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.10.0-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.10.0-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.10.0-FEATURES","type":"namespace"},{"id":"ember-4.10.0-AutoLocation","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.10.0-ember","type":"module"},{"id":"ember-4.10.0-@ember/enumerable","type":"module"},{"id":"ember-4.10.0-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.10.0-rsvp","type":"module"},{"id":"ember-4.10.0-@ember/component","type":"module"},{"id":"ember-4.10.0-@ember/routing","type":"module"},{"id":"ember-4.10.0-@ember/template","type":"module"},{"id":"ember-4.10.0-@glimmer/component","type":"module"},{"id":"ember-4.10.0-@glimmer/tracking","type":"module"},{"id":"ember-4.10.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.10.0-@ember/object","type":"module"},{"id":"ember-4.10.0-@ember/owner","type":"module"},{"id":"ember-4.10.0-@ember/debug","type":"module"},{"id":"ember-4.10.0-@ember/utils","type":"module"},{"id":"ember-4.10.0-@ember/array","type":"module"},{"id":"ember-4.10.0-@ember/application","type":"module"},{"id":"ember-4.10.0-@ember/application/namespace","type":"module"},{"id":"ember-4.10.0-@ember/array/proxy","type":"module"},{"id":"ember-4.10.0-@ember/canary-features","type":"module"},{"id":"ember-4.10.0-@ember/component/template-only","type":"module"},{"id":"ember-4.10.0-ember/controller","type":"module"},{"id":"ember-4.10.0-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.10.0-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.10.0-@ember/destroyable","type":"module"},{"id":"ember-4.10.0-@ember/engine","type":"module"},{"id":"ember-4.10.0-@ember/error","type":"module"},{"id":"ember-4.10.0-@ember/helper","type":"module"},{"id":"ember-4.10.0-@ember/object/core","type":"module"},{"id":"ember-4.10.0-@ember/object/evented","type":"module"},{"id":"ember-4.10.0-@ember/object/mixin","type":"module"},{"id":"ember-4.10.0-@ember/object/observable","type":"module"},{"id":"ember-4.10.0-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.10.0-@ember/object/proxy","type":"module"},{"id":"ember-4.10.0-@ember/polyfills","type":"module"},{"id":"ember-4.10.0-@ember/renderer","type":"module"},{"id":"ember-4.10.0-ember/routing","type":"module"},{"id":"ember-4.10.0-@ember/routing/auto-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/hash-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/history-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/location","type":"module"},{"id":"ember-4.10.0-@ember/routing/none-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/route-info","type":"module"},{"id":"ember-4.10.0-@ember/routing/route","type":"module"},{"id":"ember-4.10.0-@ember/routing/router-service","type":"module"},{"id":"ember-4.10.0-@ember/routing/router","type":"module"},{"id":"ember-4.10.0-@ember/routing/transition","type":"module"},{"id":"ember-4.10.0-@ember/runloop","type":"module"},{"id":"ember-4.10.0-@ember/service","type":"module"},{"id":"ember-4.10.0-@ember/string","type":"module"},{"id":"ember-4.10.0-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.10.0-Promise":"ember-4.10.0-Promise-5be54e9174","ember-4.10.0-EventTarget":"ember-4.10.0-EventTarget-e2e575176a","ember-4.10.0-Container":"ember-4.10.0-Container-7d4a46bb7e","ember-4.10.0-Registry":"ember-4.10.0-Registry-bee9bf520c","ember-4.10.0-EmberENV":"ember-4.10.0-EmberENV-d2433e752a","ember-4.10.0-Ember.Templates.helpers":"ember-4.10.0-Ember.Templates.helpers-77f45a7c3f","ember-4.10.0-ComponentStateBucket":"ember-4.10.0-ComponentStateBucket-dd2fbdb40b","ember-4.10.0-Component":"ember-4.10.0-Component-59c723456e","ember-4.10.0-Helper":"ember-4.10.0-Helper-d8c1e1a575","ember-4.10.0-ComputedProperty":"ember-4.10.0-ComputedProperty-2dad0b3f01","ember-4.10.0-Descriptor":"ember-4.10.0-Descriptor-8567163456","ember-4.10.0-Ember.InjectedProperty":"ember-4.10.0-Ember.InjectedProperty-c00ea99581","ember-4.10.0-Libraries":"ember-4.10.0-Libraries-5ffb73f001","ember-4.10.0-FullName":"ember-4.10.0-FullName-e754dcc7d0","ember-4.10.0-BasicRegistry":"ember-4.10.0-BasicRegistry-b39cea2136","ember-4.10.0-BasicContainer":"ember-4.10.0-BasicContainer-9ef0d41558","ember-4.10.0-Owner":"ember-4.10.0-Owner-411ac5ebe0","ember-4.10.0-RegisterOptions":"ember-4.10.0-RegisterOptions-393e29a187","ember-4.10.0-Factory":"ember-4.10.0-Factory-48837a54cb","ember-4.10.0-FactoryManager":"ember-4.10.0-FactoryManager-8e1a077333","ember-4.10.0-Resolver":"ember-4.10.0-Resolver-97029e496b","ember-4.10.0-InternalFactory":"ember-4.10.0-InternalFactory-58b4cb2fb9","ember-4.10.0-ContainerProxy":"ember-4.10.0-ContainerProxy-e81d27eeb0","ember-4.10.0-RegistryProxy":"ember-4.10.0-RegistryProxy-65cac61951","ember-4.10.0-Ember.ProxyMixin":"ember-4.10.0-Ember.ProxyMixin-ea6116ac62","ember-4.10.0-Ember.ActionHandler":"ember-4.10.0-Ember.ActionHandler-73f03b4ea5","ember-4.10.0-Ember.Comparable":"ember-4.10.0-Ember.Comparable-6b8288610d","ember-4.10.0-ContainerProxyMixin":"ember-4.10.0-ContainerProxyMixin-7144571a8b","ember-4.10.0-RegistryProxyMixin":"ember-4.10.0-RegistryProxyMixin-f9045e50a5","ember-4.10.0-Ember.TargetActionSupport":"ember-4.10.0-Ember.TargetActionSupport-0277fcf574","ember-4.10.0-Ember.String":"ember-4.10.0-Ember.String-966dd047a3","ember-4.10.0-Ember.ActionSupport":"ember-4.10.0-Ember.ActionSupport-da26af6736","ember-4.10.0-Ember.ClassNamesSupport":"ember-4.10.0-Ember.ClassNamesSupport-996b649cd2","ember-4.10.0-Ember.ViewMixin":"ember-4.10.0-Ember.ViewMixin-b54ab4c829","ember-4.10.0-Ember.EventDispatcher":"ember-4.10.0-Ember.EventDispatcher-76f9bf6c52","ember-4.10.0-Ember.CoreView":"ember-4.10.0-Ember.CoreView-603f3e6ecb","ember-4.10.0-Application":"ember-4.10.0-Application-d09efb8a2e","ember-4.10.0-ApplicationInstance":"ember-4.10.0-ApplicationInstance-691851f305","ember-4.10.0-ApplicationInstance.BootOptions":"ember-4.10.0-ApplicationInstance.BootOptions-2662a0e8e6","ember-4.10.0-Namespace":"ember-4.10.0-Namespace-52f7e3021c","ember-4.10.0-EmberArray":"ember-4.10.0-EmberArray-e3af2f6dd2","ember-4.10.0-MutableArray":"ember-4.10.0-MutableArray-932088aee2","ember-4.10.0-Ember.NativeArray":"ember-4.10.0-Ember.NativeArray-5b5dcc9371","ember-4.10.0-ArrayProxy":"ember-4.10.0-ArrayProxy-6a67758a6b","ember-4.10.0-Ember.ControllerMixin":"ember-4.10.0-Ember.ControllerMixin-d7b38107d0","ember-4.10.0-Ember.Controller":"ember-4.10.0-Ember.Controller-4e4ddd128c","ember-4.10.0-ContainerDebugAdapter":"ember-4.10.0-ContainerDebugAdapter-cbbe43b3e2","ember-4.10.0-DataAdapter":"ember-4.10.0-DataAdapter-b8b870461c","ember-4.10.0-Engine":"ember-4.10.0-Engine-e2a5b03215","ember-4.10.0-EngineInstance":"ember-4.10.0-EngineInstance-5bae1a4871","ember-4.10.0-Enumerable":"ember-4.10.0-Enumerable-736e1c04cc","ember-4.10.0-Ember.MutableEnumerable":"ember-4.10.0-Ember.MutableEnumerable-99e5b999e0","ember-4.10.0-Ember.Error":"ember-4.10.0-Ember.Error-94fa45368e","ember-4.10.0-CoreObject":"ember-4.10.0-CoreObject-04f93a1c15","ember-4.10.0-Evented":"ember-4.10.0-Evented-9bffb5bec1","ember-4.10.0-EmberObject":"ember-4.10.0-EmberObject-7644b0499f","ember-4.10.0-Mixin":"ember-4.10.0-Mixin-9d024ca5d8","ember-4.10.0-Observable":"ember-4.10.0-Observable-aeb8f6bc41","ember-4.10.0-PromiseProxyMixin":"ember-4.10.0-PromiseProxyMixin-264a29c9da","ember-4.10.0-ObjectProxy":"ember-4.10.0-ObjectProxy-6eaa7363fb","ember-4.10.0-Renderer":"ember-4.10.0-Renderer-286cfd6ff6","ember-4.10.0-BucketCache":"ember-4.10.0-BucketCache-115fecfe02","ember-4.10.0-RoutingService":"ember-4.10.0-RoutingService-1cf9f91477","ember-4.10.0-HashLocation":"ember-4.10.0-HashLocation-6cb8b36952","ember-4.10.0-HistoryLocation":"ember-4.10.0-HistoryLocation-d0d93a715d","ember-4.10.0-Location":"ember-4.10.0-Location-75eff88b11","ember-4.10.0-NoneLocation":"ember-4.10.0-NoneLocation-4ce713ff7a","ember-4.10.0-RouteInfo":"ember-4.10.0-RouteInfo-6c4ce68057","ember-4.10.0-RouteInfoWithAttributes":"ember-4.10.0-RouteInfoWithAttributes-8c10909790","ember-4.10.0-Route":"ember-4.10.0-Route-ad8dff0c39","ember-4.10.0-RouterService":"ember-4.10.0-RouterService-ad58c5987a","ember-4.10.0-EmberRouter":"ember-4.10.0-EmberRouter-b940c64671","ember-4.10.0-Transition":"ember-4.10.0-Transition-3437b83deb","ember-4.10.0-Service":"ember-4.10.0-Service-3c5934ea94","ember-4.10.0-String":"ember-4.10.0-String-2d48af16df","ember-4.10.0-TestAdapter":"ember-4.10.0-TestAdapter-f6a69c0993","ember-4.10.0-Ember.Test.QUnitAdapter":"ember-4.10.0-Ember.Test.QUnitAdapter-95e951dca1","ember-4.10.0-Ember.Test":"ember-4.10.0-Ember.Test-da66864c12","ember-4.10.0-Ember":"ember-4.10.0-Ember-c87f4a1315","ember-4.10.0-Ember.Templates.components":"ember-4.10.0-Ember.Templates.components-9534a35965","ember-4.10.0-rsvp":"ember-4.10.0-rsvp-9174432f41","ember-4.10.0-@ember/application":"ember-4.10.0-@ember/application-35167076a2","ember-4.10.0-@ember/array":"ember-4.10.0-@ember/array-1f9676778b","ember-4.10.0-@ember/component":"ember-4.10.0-@ember/component-c4211215b8","ember-4.10.0-@ember/component/helper":"ember-4.10.0-@ember/component/helper-64bca4c63d","ember-4.10.0-@ember/component/template-only":"ember-4.10.0-@ember/component/template-only-6ed19d6581","ember-4.10.0-@ember/debug":"ember-4.10.0-@ember/debug-0b5f006e99","ember-4.10.0-@ember/destroyable":"ember-4.10.0-@ember/destroyable-5f7dc9bdbe","ember-4.10.0-@ember/engine":"ember-4.10.0-@ember/engine-5048ddaeea","ember-4.10.0-@ember/helper":"ember-4.10.0-@ember/helper-beb751e901","ember-4.10.0-@ember/instrumentation":"ember-4.10.0-@ember/instrumentation-aca1c7bc12","ember-4.10.0-@ember/object":"ember-4.10.0-@ember/object-26b442bad2","ember-4.10.0-@ember/object/compat":"ember-4.10.0-@ember/object/compat-8844473f13","ember-4.10.0-@ember/object/computed":"ember-4.10.0-@ember/object/computed-5f55400a00","ember-4.10.0-@ember/object/evented":"ember-4.10.0-@ember/object/evented-43d9eb95af","ember-4.10.0-@ember/object/events":"ember-4.10.0-@ember/object/events-c5257cd6df","ember-4.10.0-@ember/object/internals":"ember-4.10.0-@ember/object/internals-a6a6d6fab7","ember-4.10.0-@ember/object/mixin":"ember-4.10.0-@ember/object/mixin-2ac3b443c1","ember-4.10.0-@ember/object/observers":"ember-4.10.0-@ember/object/observers-8aad57944c","ember-4.10.0-@ember/owner":"ember-4.10.0-@ember/owner-13cbf4d650","ember-4.10.0-@ember/polyfills":"ember-4.10.0-@ember/polyfills-e17a372933","ember-4.10.0-@ember/routing":"ember-4.10.0-@ember/routing-5f8c5bd8c8","ember-4.10.0-@ember/runloop":"ember-4.10.0-@ember/runloop-a0afaf4b2a","ember-4.10.0-@ember/service":"ember-4.10.0-@ember/service-f87e6a6e37","ember-4.10.0-@ember/template":"ember-4.10.0-@ember/template-0523cd22ff","ember-4.10.0-@ember/test":"ember-4.10.0-@ember/test-c36f6dfbf8","ember-4.10.0-@ember/utils":"ember-4.10.0-@ember/utils-9d920d7ae6","ember-4.10.0-@glimmer/tracking":"ember-4.10.0-@glimmer/tracking-c20abf4f9c","ember-4.10.0-@glimmer/tracking/primitives/cache":"ember-4.10.0-@glimmer/tracking/primitives/cache-68aa297446","ember-4.10.0-Ember.@ember/controller":"ember-4.10.0-Ember.@ember/controller-05461ee6af"},"namespace":{"ember-4.10.0-FEATURES":"ember-4.10.0-FEATURES-21e94af52c","ember-4.10.0-Instrumentation":"ember-4.10.0-Instrumentation-b9c3f99fb7","ember-4.10.0-AutoLocation":"ember-4.10.0-AutoLocation-5fa73896b8"},"module":{"ember-4.10.0-rsvp":"ember-4.10.0-rsvp-1ca01f74f2","ember-4.10.0-@ember/component":"ember-4.10.0-@ember/component-4ac4e88eca","ember-4.10.0-@ember/routing":"ember-4.10.0-@ember/routing-9f0cda4648","ember-4.10.0-ember":"ember-4.10.0-ember-f04ab156c8","ember-4.10.0-@ember/template":"ember-4.10.0-@ember/template-78c4def067","ember-4.10.0-@glimmer/component":"ember-4.10.0-@glimmer/component-8eb4d24547","ember-4.10.0-@glimmer/tracking":"ember-4.10.0-@glimmer/tracking-3e38573c99","ember-4.10.0-@glimmer/tracking/primitives/cache":"ember-4.10.0-@glimmer/tracking/primitives/cache-4dd991a0f1","ember-4.10.0-@ember/object":"ember-4.10.0-@ember/object-42d8bef5d6","ember-4.10.0-@ember/owner":"ember-4.10.0-@ember/owner-13acb31bc6","ember-4.10.0-@ember/debug":"ember-4.10.0-@ember/debug-f8f9487cf4","ember-4.10.0-@ember/utils":"ember-4.10.0-@ember/utils-720507d4f4","ember-4.10.0-@ember/array":"ember-4.10.0-@ember/array-ebc47f755f","ember-4.10.0-@ember/application":"ember-4.10.0-@ember/application-0e6aee5d67","ember-4.10.0-@ember/application/namespace":"ember-4.10.0-@ember/application/namespace-99dbf8ca15","ember-4.10.0-@ember/array/proxy":"ember-4.10.0-@ember/array/proxy-5234c656cc","ember-4.10.0-@ember/canary-features":"ember-4.10.0-@ember/canary-features-b5d233e4e9","ember-4.10.0-@ember/component/template-only":"ember-4.10.0-@ember/component/template-only-3d2b970027","ember-4.10.0-ember/controller":"ember-4.10.0-ember/controller-63c20c5530","ember-4.10.0-@ember/debug/container-debug-adapter":"ember-4.10.0-@ember/debug/container-debug-adapter-461ec9be14","ember-4.10.0-@ember/debug/data-adapter":"ember-4.10.0-@ember/debug/data-adapter-d435266433","ember-4.10.0-@ember/destroyable":"ember-4.10.0-@ember/destroyable-1277796ad6","ember-4.10.0-@ember/engine":"ember-4.10.0-@ember/engine-60a129646e","ember-4.10.0-@ember/enumerable":"ember-4.10.0-@ember/enumerable-893a7ed975","ember-4.10.0-@ember/error":"ember-4.10.0-@ember/error-2fb8fba01f","ember-4.10.0-@ember/helper":"ember-4.10.0-@ember/helper-0fe04a156a","ember-4.10.0-@ember/instrumentation":"ember-4.10.0-@ember/instrumentation-e3350e3e7d","ember-4.10.0-@ember/object/core":"ember-4.10.0-@ember/object/core-49e743fcda","ember-4.10.0-@ember/object/evented":"ember-4.10.0-@ember/object/evented-76295eeb3c","ember-4.10.0-@ember/object/mixin":"ember-4.10.0-@ember/object/mixin-54768a401e","ember-4.10.0-@ember/object/observable":"ember-4.10.0-@ember/object/observable-97a753dca1","ember-4.10.0-@ember/object/promise-proxy-mixin":"ember-4.10.0-@ember/object/promise-proxy-mixin-878ea9c20a","ember-4.10.0-@ember/object/proxy":"ember-4.10.0-@ember/object/proxy-9bcea47138","ember-4.10.0-@ember/polyfills":"ember-4.10.0-@ember/polyfills-efe8a49f7c","ember-4.10.0-@ember/renderer":"ember-4.10.0-@ember/renderer-a10037033d","ember-4.10.0-ember/routing":"ember-4.10.0-ember/routing-036b77a711","ember-4.10.0-@ember/routing/auto-location":"ember-4.10.0-@ember/routing/auto-location-697fe59074","ember-4.10.0-@ember/routing/hash-location":"ember-4.10.0-@ember/routing/hash-location-ef4ea8cbbf","ember-4.10.0-@ember/routing/history-location":"ember-4.10.0-@ember/routing/history-location-307d52c262","ember-4.10.0-@ember/routing/location":"ember-4.10.0-@ember/routing/location-1cffa3d5de","ember-4.10.0-@ember/routing/none-location":"ember-4.10.0-@ember/routing/none-location-2dd542dfef","ember-4.10.0-@ember/routing/route-info":"ember-4.10.0-@ember/routing/route-info-3d2cd5444e","ember-4.10.0-@ember/routing/route":"ember-4.10.0-@ember/routing/route-e4758047da","ember-4.10.0-@ember/routing/router-service":"ember-4.10.0-@ember/routing/router-service-6a2a044b8f","ember-4.10.0-@ember/routing/router":"ember-4.10.0-@ember/routing/router-d5bc2836ce","ember-4.10.0-@ember/routing/transition":"ember-4.10.0-@ember/routing/transition-aca88ccc6a","ember-4.10.0-@ember/runloop":"ember-4.10.0-@ember/runloop-d018488b7a","ember-4.10.0-@ember/service":"ember-4.10.0-@ember/service-c9c97a3c6d","ember-4.10.0-@ember/string":"ember-4.10.0-@ember/string-e030cf45d2","ember-4.10.0-@ember/test":"ember-4.10.0-@ember/test-0887194739"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Error":"Error-158974c414"}}} \ No newline at end of file +{"data":{"id":"ember-4.10.0","type":"project-version","attributes":{"version":"4.10.0"},"relationships":{"classes":{"data":[{"id":"ember-4.10.0-Promise","type":"class"},{"id":"ember-4.10.0-EventTarget","type":"class"},{"id":"ember-4.10.0-Container","type":"class"},{"id":"ember-4.10.0-Registry","type":"class"},{"id":"ember-4.10.0-EmberENV","type":"class"},{"id":"ember-4.10.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.10.0-ComponentStateBucket","type":"class"},{"id":"ember-4.10.0-Component","type":"class"},{"id":"ember-4.10.0-Helper","type":"class"},{"id":"ember-4.10.0-ComputedProperty","type":"class"},{"id":"ember-4.10.0-Descriptor","type":"class"},{"id":"ember-4.10.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.10.0-Libraries","type":"class"},{"id":"ember-4.10.0-FullName","type":"class"},{"id":"ember-4.10.0-BasicRegistry","type":"class"},{"id":"ember-4.10.0-BasicContainer","type":"class"},{"id":"ember-4.10.0-Owner","type":"class"},{"id":"ember-4.10.0-RegisterOptions","type":"class"},{"id":"ember-4.10.0-Factory","type":"class"},{"id":"ember-4.10.0-FactoryManager","type":"class"},{"id":"ember-4.10.0-Resolver","type":"class"},{"id":"ember-4.10.0-InternalFactory","type":"class"},{"id":"ember-4.10.0-ContainerProxy","type":"class"},{"id":"ember-4.10.0-RegistryProxy","type":"class"},{"id":"ember-4.10.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.10.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.10.0-Ember.Comparable","type":"class"},{"id":"ember-4.10.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.10.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.10.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.10.0-Ember.String","type":"class"},{"id":"ember-4.10.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.10.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.10.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.10.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.10.0-Ember.CoreView","type":"class"},{"id":"ember-4.10.0-Application","type":"class"},{"id":"ember-4.10.0-ApplicationInstance","type":"class"},{"id":"ember-4.10.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.10.0-Namespace","type":"class"},{"id":"ember-4.10.0-EmberArray","type":"class"},{"id":"ember-4.10.0-MutableArray","type":"class"},{"id":"ember-4.10.0-Ember.NativeArray","type":"class"},{"id":"ember-4.10.0-ArrayProxy","type":"class"},{"id":"ember-4.10.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.10.0-Ember.Controller","type":"class"},{"id":"ember-4.10.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.10.0-DataAdapter","type":"class"},{"id":"ember-4.10.0-Engine","type":"class"},{"id":"ember-4.10.0-EngineInstance","type":"class"},{"id":"ember-4.10.0-Enumerable","type":"class"},{"id":"ember-4.10.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.10.0-Ember.Error","type":"class"},{"id":"ember-4.10.0-CoreObject","type":"class"},{"id":"ember-4.10.0-Evented","type":"class"},{"id":"ember-4.10.0-EmberObject","type":"class"},{"id":"ember-4.10.0-Mixin","type":"class"},{"id":"ember-4.10.0-Observable","type":"class"},{"id":"ember-4.10.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.10.0-ObjectProxy","type":"class"},{"id":"ember-4.10.0-Renderer","type":"class"},{"id":"ember-4.10.0-BucketCache","type":"class"},{"id":"ember-4.10.0-RoutingService","type":"class"},{"id":"ember-4.10.0-HashLocation","type":"class"},{"id":"ember-4.10.0-HistoryLocation","type":"class"},{"id":"ember-4.10.0-Location","type":"class"},{"id":"ember-4.10.0-NoneLocation","type":"class"},{"id":"ember-4.10.0-RouteInfo","type":"class"},{"id":"ember-4.10.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.10.0-Route","type":"class"},{"id":"ember-4.10.0-RouterService","type":"class"},{"id":"ember-4.10.0-EmberRouter","type":"class"},{"id":"ember-4.10.0-Transition","type":"class"},{"id":"ember-4.10.0-Service","type":"class"},{"id":"ember-4.10.0-String","type":"class"},{"id":"ember-4.10.0-TestAdapter","type":"class"},{"id":"ember-4.10.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.10.0-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.10.0-FEATURES","type":"namespace"},{"id":"ember-4.10.0-Instrumentation","type":"namespace"},{"id":"ember-4.10.0-AutoLocation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.10.0-rsvp","type":"module"},{"id":"ember-4.10.0-@ember/component","type":"module"},{"id":"ember-4.10.0-@ember/routing","type":"module"},{"id":"ember-4.10.0-ember","type":"module"},{"id":"ember-4.10.0-@ember/template","type":"module"},{"id":"ember-4.10.0-@glimmer/component","type":"module"},{"id":"ember-4.10.0-@glimmer/tracking","type":"module"},{"id":"ember-4.10.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.10.0-@ember/object","type":"module"},{"id":"ember-4.10.0-@ember/owner","type":"module"},{"id":"ember-4.10.0-@ember/debug","type":"module"},{"id":"ember-4.10.0-@ember/utils","type":"module"},{"id":"ember-4.10.0-@ember/array","type":"module"},{"id":"ember-4.10.0-@ember/application","type":"module"},{"id":"ember-4.10.0-@ember/application/namespace","type":"module"},{"id":"ember-4.10.0-@ember/array/proxy","type":"module"},{"id":"ember-4.10.0-@ember/canary-features","type":"module"},{"id":"ember-4.10.0-@ember/component/template-only","type":"module"},{"id":"ember-4.10.0-ember/controller","type":"module"},{"id":"ember-4.10.0-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.10.0-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.10.0-@ember/destroyable","type":"module"},{"id":"ember-4.10.0-@ember/engine","type":"module"},{"id":"ember-4.10.0-@ember/enumerable","type":"module"},{"id":"ember-4.10.0-@ember/error","type":"module"},{"id":"ember-4.10.0-@ember/helper","type":"module"},{"id":"ember-4.10.0-@ember/instrumentation","type":"module"},{"id":"ember-4.10.0-@ember/object/core","type":"module"},{"id":"ember-4.10.0-@ember/object/evented","type":"module"},{"id":"ember-4.10.0-@ember/object/mixin","type":"module"},{"id":"ember-4.10.0-@ember/object/observable","type":"module"},{"id":"ember-4.10.0-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.10.0-@ember/object/proxy","type":"module"},{"id":"ember-4.10.0-@ember/polyfills","type":"module"},{"id":"ember-4.10.0-@ember/renderer","type":"module"},{"id":"ember-4.10.0-ember/routing","type":"module"},{"id":"ember-4.10.0-@ember/routing/auto-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/hash-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/history-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/location","type":"module"},{"id":"ember-4.10.0-@ember/routing/none-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/route-info","type":"module"},{"id":"ember-4.10.0-@ember/routing/route","type":"module"},{"id":"ember-4.10.0-@ember/routing/router-service","type":"module"},{"id":"ember-4.10.0-@ember/routing/router","type":"module"},{"id":"ember-4.10.0-@ember/routing/transition","type":"module"},{"id":"ember-4.10.0-@ember/runloop","type":"module"},{"id":"ember-4.10.0-@ember/service","type":"module"},{"id":"ember-4.10.0-@ember/string","type":"module"},{"id":"ember-4.10.0-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.10.0-Container","type":"class"},{"id":"ember-4.10.0-Registry","type":"class"},{"id":"ember-4.10.0-ComponentStateBucket","type":"class"},{"id":"ember-4.10.0-Descriptor","type":"class"},{"id":"ember-4.10.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.10.0-Libraries","type":"class"},{"id":"ember-4.10.0-BasicRegistry","type":"class"},{"id":"ember-4.10.0-BasicContainer","type":"class"},{"id":"ember-4.10.0-InternalFactory","type":"class"},{"id":"ember-4.10.0-ContainerProxy","type":"class"},{"id":"ember-4.10.0-RegistryProxy","type":"class"},{"id":"ember-4.10.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.10.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.10.0-Ember.Comparable","type":"class"},{"id":"ember-4.10.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.10.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.10.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.10.0-Ember.String","type":"class"},{"id":"ember-4.10.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.10.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.10.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.10.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.10.0-Ember.CoreView","type":"class"},{"id":"ember-4.10.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.10.0-Enumerable","type":"class"},{"id":"ember-4.10.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.10.0-Ember.Error","type":"class"},{"id":"ember-4.10.0-BucketCache","type":"class"},{"id":"ember-4.10.0-RoutingService","type":"class"},{"id":"ember-4.10.0-Location","type":"class"},{"id":"ember-4.10.0-String","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.10.0-Promise","type":"class"},{"id":"ember-4.10.0-EventTarget","type":"class"},{"id":"ember-4.10.0-EmberENV","type":"class"},{"id":"ember-4.10.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.10.0-Component","type":"class"},{"id":"ember-4.10.0-Helper","type":"class"},{"id":"ember-4.10.0-ComputedProperty","type":"class"},{"id":"ember-4.10.0-FullName","type":"class"},{"id":"ember-4.10.0-Owner","type":"class"},{"id":"ember-4.10.0-RegisterOptions","type":"class"},{"id":"ember-4.10.0-Factory","type":"class"},{"id":"ember-4.10.0-FactoryManager","type":"class"},{"id":"ember-4.10.0-Resolver","type":"class"},{"id":"ember-4.10.0-Application","type":"class"},{"id":"ember-4.10.0-ApplicationInstance","type":"class"},{"id":"ember-4.10.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.10.0-Namespace","type":"class"},{"id":"ember-4.10.0-EmberArray","type":"class"},{"id":"ember-4.10.0-MutableArray","type":"class"},{"id":"ember-4.10.0-Ember.NativeArray","type":"class"},{"id":"ember-4.10.0-ArrayProxy","type":"class"},{"id":"ember-4.10.0-Ember.Controller","type":"class"},{"id":"ember-4.10.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.10.0-DataAdapter","type":"class"},{"id":"ember-4.10.0-Engine","type":"class"},{"id":"ember-4.10.0-EngineInstance","type":"class"},{"id":"ember-4.10.0-CoreObject","type":"class"},{"id":"ember-4.10.0-Evented","type":"class"},{"id":"ember-4.10.0-EmberObject","type":"class"},{"id":"ember-4.10.0-Mixin","type":"class"},{"id":"ember-4.10.0-Observable","type":"class"},{"id":"ember-4.10.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.10.0-ObjectProxy","type":"class"},{"id":"ember-4.10.0-Renderer","type":"class"},{"id":"ember-4.10.0-HashLocation","type":"class"},{"id":"ember-4.10.0-HistoryLocation","type":"class"},{"id":"ember-4.10.0-NoneLocation","type":"class"},{"id":"ember-4.10.0-RouteInfo","type":"class"},{"id":"ember-4.10.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.10.0-Route","type":"class"},{"id":"ember-4.10.0-RouterService","type":"class"},{"id":"ember-4.10.0-EmberRouter","type":"class"},{"id":"ember-4.10.0-Transition","type":"class"},{"id":"ember-4.10.0-Service","type":"class"},{"id":"ember-4.10.0-TestAdapter","type":"class"},{"id":"ember-4.10.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.10.0-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.10.0-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.10.0-FEATURES","type":"namespace"},{"id":"ember-4.10.0-AutoLocation","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.10.0-ember","type":"module"},{"id":"ember-4.10.0-@ember/enumerable","type":"module"},{"id":"ember-4.10.0-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.10.0-rsvp","type":"module"},{"id":"ember-4.10.0-@ember/component","type":"module"},{"id":"ember-4.10.0-@ember/routing","type":"module"},{"id":"ember-4.10.0-@ember/template","type":"module"},{"id":"ember-4.10.0-@glimmer/component","type":"module"},{"id":"ember-4.10.0-@glimmer/tracking","type":"module"},{"id":"ember-4.10.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.10.0-@ember/object","type":"module"},{"id":"ember-4.10.0-@ember/owner","type":"module"},{"id":"ember-4.10.0-@ember/debug","type":"module"},{"id":"ember-4.10.0-@ember/utils","type":"module"},{"id":"ember-4.10.0-@ember/array","type":"module"},{"id":"ember-4.10.0-@ember/application","type":"module"},{"id":"ember-4.10.0-@ember/application/namespace","type":"module"},{"id":"ember-4.10.0-@ember/array/proxy","type":"module"},{"id":"ember-4.10.0-@ember/canary-features","type":"module"},{"id":"ember-4.10.0-@ember/component/template-only","type":"module"},{"id":"ember-4.10.0-ember/controller","type":"module"},{"id":"ember-4.10.0-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.10.0-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.10.0-@ember/destroyable","type":"module"},{"id":"ember-4.10.0-@ember/engine","type":"module"},{"id":"ember-4.10.0-@ember/error","type":"module"},{"id":"ember-4.10.0-@ember/helper","type":"module"},{"id":"ember-4.10.0-@ember/object/core","type":"module"},{"id":"ember-4.10.0-@ember/object/evented","type":"module"},{"id":"ember-4.10.0-@ember/object/mixin","type":"module"},{"id":"ember-4.10.0-@ember/object/observable","type":"module"},{"id":"ember-4.10.0-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.10.0-@ember/object/proxy","type":"module"},{"id":"ember-4.10.0-@ember/polyfills","type":"module"},{"id":"ember-4.10.0-@ember/renderer","type":"module"},{"id":"ember-4.10.0-ember/routing","type":"module"},{"id":"ember-4.10.0-@ember/routing/auto-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/hash-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/history-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/location","type":"module"},{"id":"ember-4.10.0-@ember/routing/none-location","type":"module"},{"id":"ember-4.10.0-@ember/routing/route-info","type":"module"},{"id":"ember-4.10.0-@ember/routing/route","type":"module"},{"id":"ember-4.10.0-@ember/routing/router-service","type":"module"},{"id":"ember-4.10.0-@ember/routing/router","type":"module"},{"id":"ember-4.10.0-@ember/routing/transition","type":"module"},{"id":"ember-4.10.0-@ember/runloop","type":"module"},{"id":"ember-4.10.0-@ember/service","type":"module"},{"id":"ember-4.10.0-@ember/string","type":"module"},{"id":"ember-4.10.0-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.10.0-Promise":"ember-4.10.0-Promise-b2366c3e42","ember-4.10.0-EventTarget":"ember-4.10.0-EventTarget-e2e575176a","ember-4.10.0-Container":"ember-4.10.0-Container-c271dbdd0e","ember-4.10.0-Registry":"ember-4.10.0-Registry-c0b8fca45b","ember-4.10.0-EmberENV":"ember-4.10.0-EmberENV-d2433e752a","ember-4.10.0-Ember.Templates.helpers":"ember-4.10.0-Ember.Templates.helpers-2abf3fe060","ember-4.10.0-ComponentStateBucket":"ember-4.10.0-ComponentStateBucket-dd2fbdb40b","ember-4.10.0-Component":"ember-4.10.0-Component-8eadf01636","ember-4.10.0-Helper":"ember-4.10.0-Helper-da52c58f14","ember-4.10.0-ComputedProperty":"ember-4.10.0-ComputedProperty-59394376dc","ember-4.10.0-Descriptor":"ember-4.10.0-Descriptor-8567163456","ember-4.10.0-Ember.InjectedProperty":"ember-4.10.0-Ember.InjectedProperty-c00ea99581","ember-4.10.0-Libraries":"ember-4.10.0-Libraries-5ffb73f001","ember-4.10.0-FullName":"ember-4.10.0-FullName-e754dcc7d0","ember-4.10.0-BasicRegistry":"ember-4.10.0-BasicRegistry-85657687ec","ember-4.10.0-BasicContainer":"ember-4.10.0-BasicContainer-c6055a03a2","ember-4.10.0-Owner":"ember-4.10.0-Owner-9238aa5575","ember-4.10.0-RegisterOptions":"ember-4.10.0-RegisterOptions-393e29a187","ember-4.10.0-Factory":"ember-4.10.0-Factory-48837a54cb","ember-4.10.0-FactoryManager":"ember-4.10.0-FactoryManager-8e1a077333","ember-4.10.0-Resolver":"ember-4.10.0-Resolver-97029e496b","ember-4.10.0-InternalFactory":"ember-4.10.0-InternalFactory-58b4cb2fb9","ember-4.10.0-ContainerProxy":"ember-4.10.0-ContainerProxy-601fcc1546","ember-4.10.0-RegistryProxy":"ember-4.10.0-RegistryProxy-f3952188ed","ember-4.10.0-Ember.ProxyMixin":"ember-4.10.0-Ember.ProxyMixin-ea6116ac62","ember-4.10.0-Ember.ActionHandler":"ember-4.10.0-Ember.ActionHandler-856e62296c","ember-4.10.0-Ember.Comparable":"ember-4.10.0-Ember.Comparable-6b8288610d","ember-4.10.0-ContainerProxyMixin":"ember-4.10.0-ContainerProxyMixin-17458cef2c","ember-4.10.0-RegistryProxyMixin":"ember-4.10.0-RegistryProxyMixin-f4eae3a135","ember-4.10.0-Ember.TargetActionSupport":"ember-4.10.0-Ember.TargetActionSupport-c67dd9d325","ember-4.10.0-Ember.String":"ember-4.10.0-Ember.String-966dd047a3","ember-4.10.0-Ember.ActionSupport":"ember-4.10.0-Ember.ActionSupport-da26af6736","ember-4.10.0-Ember.ClassNamesSupport":"ember-4.10.0-Ember.ClassNamesSupport-996b649cd2","ember-4.10.0-Ember.ViewMixin":"ember-4.10.0-Ember.ViewMixin-38edee6c68","ember-4.10.0-Ember.EventDispatcher":"ember-4.10.0-Ember.EventDispatcher-cd779b9c4b","ember-4.10.0-Ember.CoreView":"ember-4.10.0-Ember.CoreView-958a0d615f","ember-4.10.0-Application":"ember-4.10.0-Application-d6529ecc5d","ember-4.10.0-ApplicationInstance":"ember-4.10.0-ApplicationInstance-8f1607bee9","ember-4.10.0-ApplicationInstance.BootOptions":"ember-4.10.0-ApplicationInstance.BootOptions-7c4356c4ca","ember-4.10.0-Namespace":"ember-4.10.0-Namespace-adc1549be4","ember-4.10.0-EmberArray":"ember-4.10.0-EmberArray-ccf563848c","ember-4.10.0-MutableArray":"ember-4.10.0-MutableArray-446a9ba959","ember-4.10.0-Ember.NativeArray":"ember-4.10.0-Ember.NativeArray-3a5d219d3f","ember-4.10.0-ArrayProxy":"ember-4.10.0-ArrayProxy-d3d367586e","ember-4.10.0-Ember.ControllerMixin":"ember-4.10.0-Ember.ControllerMixin-53e01dc81c","ember-4.10.0-Ember.Controller":"ember-4.10.0-Ember.Controller-61c1867549","ember-4.10.0-ContainerDebugAdapter":"ember-4.10.0-ContainerDebugAdapter-78cbafd901","ember-4.10.0-DataAdapter":"ember-4.10.0-DataAdapter-57dbc8e422","ember-4.10.0-Engine":"ember-4.10.0-Engine-d74159665b","ember-4.10.0-EngineInstance":"ember-4.10.0-EngineInstance-d1d79b0e13","ember-4.10.0-Enumerable":"ember-4.10.0-Enumerable-736e1c04cc","ember-4.10.0-Ember.MutableEnumerable":"ember-4.10.0-Ember.MutableEnumerable-99e5b999e0","ember-4.10.0-Ember.Error":"ember-4.10.0-Ember.Error-94fa45368e","ember-4.10.0-CoreObject":"ember-4.10.0-CoreObject-6642193f5c","ember-4.10.0-Evented":"ember-4.10.0-Evented-e30a42ee50","ember-4.10.0-EmberObject":"ember-4.10.0-EmberObject-ccd1a50e38","ember-4.10.0-Mixin":"ember-4.10.0-Mixin-6d9eda2d7b","ember-4.10.0-Observable":"ember-4.10.0-Observable-d3471bfba9","ember-4.10.0-PromiseProxyMixin":"ember-4.10.0-PromiseProxyMixin-598167963d","ember-4.10.0-ObjectProxy":"ember-4.10.0-ObjectProxy-6c083f7dd5","ember-4.10.0-Renderer":"ember-4.10.0-Renderer-286cfd6ff6","ember-4.10.0-BucketCache":"ember-4.10.0-BucketCache-115fecfe02","ember-4.10.0-RoutingService":"ember-4.10.0-RoutingService-1cf9f91477","ember-4.10.0-HashLocation":"ember-4.10.0-HashLocation-18265497c8","ember-4.10.0-HistoryLocation":"ember-4.10.0-HistoryLocation-06910f0bd3","ember-4.10.0-Location":"ember-4.10.0-Location-b049a14fd1","ember-4.10.0-NoneLocation":"ember-4.10.0-NoneLocation-4b9f0699ca","ember-4.10.0-RouteInfo":"ember-4.10.0-RouteInfo-6c4ce68057","ember-4.10.0-RouteInfoWithAttributes":"ember-4.10.0-RouteInfoWithAttributes-8c10909790","ember-4.10.0-Route":"ember-4.10.0-Route-a995ff4d7c","ember-4.10.0-RouterService":"ember-4.10.0-RouterService-76da358f2d","ember-4.10.0-EmberRouter":"ember-4.10.0-EmberRouter-912eb8fdde","ember-4.10.0-Transition":"ember-4.10.0-Transition-3437b83deb","ember-4.10.0-Service":"ember-4.10.0-Service-d837a09d6d","ember-4.10.0-String":"ember-4.10.0-String-9f2d0a448f","ember-4.10.0-TestAdapter":"ember-4.10.0-TestAdapter-f6a69c0993","ember-4.10.0-Ember.Test.QUnitAdapter":"ember-4.10.0-Ember.Test.QUnitAdapter-95e951dca1","ember-4.10.0-Ember.Test":"ember-4.10.0-Ember.Test-e48578b900","ember-4.10.0-Ember":"ember-4.10.0-Ember-c87f4a1315","ember-4.10.0-Ember.Templates.components":"ember-4.10.0-Ember.Templates.components-2a77dfff4e","ember-4.10.0-rsvp":"ember-4.10.0-rsvp-c50ff6d08e","ember-4.10.0-@ember/application":"ember-4.10.0-@ember/application-4c936d26b7","ember-4.10.0-@ember/array":"ember-4.10.0-@ember/array-1f9676778b","ember-4.10.0-@ember/component":"ember-4.10.0-@ember/component-c4211215b8","ember-4.10.0-@ember/component/helper":"ember-4.10.0-@ember/component/helper-94a2ea764e","ember-4.10.0-@ember/component/template-only":"ember-4.10.0-@ember/component/template-only-6ed19d6581","ember-4.10.0-@ember/debug":"ember-4.10.0-@ember/debug-4e2be54526","ember-4.10.0-@ember/destroyable":"ember-4.10.0-@ember/destroyable-719367262a","ember-4.10.0-@ember/engine":"ember-4.10.0-@ember/engine-5048ddaeea","ember-4.10.0-@ember/helper":"ember-4.10.0-@ember/helper-254286c260","ember-4.10.0-@ember/instrumentation":"ember-4.10.0-@ember/instrumentation-aca1c7bc12","ember-4.10.0-@ember/object":"ember-4.10.0-@ember/object-08c8502400","ember-4.10.0-@ember/object/compat":"ember-4.10.0-@ember/object/compat-6336b079b1","ember-4.10.0-@ember/object/computed":"ember-4.10.0-@ember/object/computed-76216d32d0","ember-4.10.0-@ember/object/evented":"ember-4.10.0-@ember/object/evented-7901080243","ember-4.10.0-@ember/object/events":"ember-4.10.0-@ember/object/events-c5257cd6df","ember-4.10.0-@ember/object/internals":"ember-4.10.0-@ember/object/internals-a6a6d6fab7","ember-4.10.0-@ember/object/mixin":"ember-4.10.0-@ember/object/mixin-2ac3b443c1","ember-4.10.0-@ember/object/observers":"ember-4.10.0-@ember/object/observers-8aad57944c","ember-4.10.0-@ember/owner":"ember-4.10.0-@ember/owner-436e8db55e","ember-4.10.0-@ember/polyfills":"ember-4.10.0-@ember/polyfills-82b425b116","ember-4.10.0-@ember/routing":"ember-4.10.0-@ember/routing-5f8c5bd8c8","ember-4.10.0-@ember/runloop":"ember-4.10.0-@ember/runloop-9f0700afdd","ember-4.10.0-@ember/service":"ember-4.10.0-@ember/service-996f0f3ffe","ember-4.10.0-@ember/template":"ember-4.10.0-@ember/template-f0ca9b2ec5","ember-4.10.0-@ember/test":"ember-4.10.0-@ember/test-1fb153826e","ember-4.10.0-@ember/utils":"ember-4.10.0-@ember/utils-2e789af849","ember-4.10.0-@glimmer/tracking":"ember-4.10.0-@glimmer/tracking-670954b24e","ember-4.10.0-@glimmer/tracking/primitives/cache":"ember-4.10.0-@glimmer/tracking/primitives/cache-1242306ebb","ember-4.10.0-Ember.@ember/controller":"ember-4.10.0-Ember.@ember/controller-a9cbed58ef"},"namespace":{"ember-4.10.0-FEATURES":"ember-4.10.0-FEATURES-21e94af52c","ember-4.10.0-Instrumentation":"ember-4.10.0-Instrumentation-ff405043b4","ember-4.10.0-AutoLocation":"ember-4.10.0-AutoLocation-743811f64d"},"module":{"ember-4.10.0-rsvp":"ember-4.10.0-rsvp-1ca01f74f2","ember-4.10.0-@ember/component":"ember-4.10.0-@ember/component-f1f08dc9bd","ember-4.10.0-@ember/routing":"ember-4.10.0-@ember/routing-9f0cda4648","ember-4.10.0-ember":"ember-4.10.0-ember-f04ab156c8","ember-4.10.0-@ember/template":"ember-4.10.0-@ember/template-78c4def067","ember-4.10.0-@glimmer/component":"ember-4.10.0-@glimmer/component-3e7ab81f43","ember-4.10.0-@glimmer/tracking":"ember-4.10.0-@glimmer/tracking-3e38573c99","ember-4.10.0-@glimmer/tracking/primitives/cache":"ember-4.10.0-@glimmer/tracking/primitives/cache-4dd991a0f1","ember-4.10.0-@ember/object":"ember-4.10.0-@ember/object-42d8bef5d6","ember-4.10.0-@ember/owner":"ember-4.10.0-@ember/owner-13acb31bc6","ember-4.10.0-@ember/debug":"ember-4.10.0-@ember/debug-f8f9487cf4","ember-4.10.0-@ember/utils":"ember-4.10.0-@ember/utils-720507d4f4","ember-4.10.0-@ember/array":"ember-4.10.0-@ember/array-ebc47f755f","ember-4.10.0-@ember/application":"ember-4.10.0-@ember/application-0e6aee5d67","ember-4.10.0-@ember/application/namespace":"ember-4.10.0-@ember/application/namespace-99dbf8ca15","ember-4.10.0-@ember/array/proxy":"ember-4.10.0-@ember/array/proxy-5234c656cc","ember-4.10.0-@ember/canary-features":"ember-4.10.0-@ember/canary-features-b5d233e4e9","ember-4.10.0-@ember/component/template-only":"ember-4.10.0-@ember/component/template-only-3d2b970027","ember-4.10.0-ember/controller":"ember-4.10.0-ember/controller-63c20c5530","ember-4.10.0-@ember/debug/container-debug-adapter":"ember-4.10.0-@ember/debug/container-debug-adapter-461ec9be14","ember-4.10.0-@ember/debug/data-adapter":"ember-4.10.0-@ember/debug/data-adapter-d435266433","ember-4.10.0-@ember/destroyable":"ember-4.10.0-@ember/destroyable-1277796ad6","ember-4.10.0-@ember/engine":"ember-4.10.0-@ember/engine-60a129646e","ember-4.10.0-@ember/enumerable":"ember-4.10.0-@ember/enumerable-893a7ed975","ember-4.10.0-@ember/error":"ember-4.10.0-@ember/error-2fb8fba01f","ember-4.10.0-@ember/helper":"ember-4.10.0-@ember/helper-0fe04a156a","ember-4.10.0-@ember/instrumentation":"ember-4.10.0-@ember/instrumentation-e3350e3e7d","ember-4.10.0-@ember/object/core":"ember-4.10.0-@ember/object/core-49e743fcda","ember-4.10.0-@ember/object/evented":"ember-4.10.0-@ember/object/evented-76295eeb3c","ember-4.10.0-@ember/object/mixin":"ember-4.10.0-@ember/object/mixin-54768a401e","ember-4.10.0-@ember/object/observable":"ember-4.10.0-@ember/object/observable-97a753dca1","ember-4.10.0-@ember/object/promise-proxy-mixin":"ember-4.10.0-@ember/object/promise-proxy-mixin-878ea9c20a","ember-4.10.0-@ember/object/proxy":"ember-4.10.0-@ember/object/proxy-9bcea47138","ember-4.10.0-@ember/polyfills":"ember-4.10.0-@ember/polyfills-efe8a49f7c","ember-4.10.0-@ember/renderer":"ember-4.10.0-@ember/renderer-a10037033d","ember-4.10.0-ember/routing":"ember-4.10.0-ember/routing-036b77a711","ember-4.10.0-@ember/routing/auto-location":"ember-4.10.0-@ember/routing/auto-location-697fe59074","ember-4.10.0-@ember/routing/hash-location":"ember-4.10.0-@ember/routing/hash-location-ef4ea8cbbf","ember-4.10.0-@ember/routing/history-location":"ember-4.10.0-@ember/routing/history-location-307d52c262","ember-4.10.0-@ember/routing/location":"ember-4.10.0-@ember/routing/location-1cffa3d5de","ember-4.10.0-@ember/routing/none-location":"ember-4.10.0-@ember/routing/none-location-2dd542dfef","ember-4.10.0-@ember/routing/route-info":"ember-4.10.0-@ember/routing/route-info-3d2cd5444e","ember-4.10.0-@ember/routing/route":"ember-4.10.0-@ember/routing/route-e4758047da","ember-4.10.0-@ember/routing/router-service":"ember-4.10.0-@ember/routing/router-service-6a2a044b8f","ember-4.10.0-@ember/routing/router":"ember-4.10.0-@ember/routing/router-d5bc2836ce","ember-4.10.0-@ember/routing/transition":"ember-4.10.0-@ember/routing/transition-aca88ccc6a","ember-4.10.0-@ember/runloop":"ember-4.10.0-@ember/runloop-d018488b7a","ember-4.10.0-@ember/service":"ember-4.10.0-@ember/service-c9c97a3c6d","ember-4.10.0-@ember/string":"ember-4.10.0-@ember/string-e030cf45d2","ember-4.10.0-@ember/test":"ember-4.10.0-@ember/test-0887194739"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Error":"Error-158974c414"}}} \ No newline at end of file diff --git a/rev-index/ember-4.11.0.json b/rev-index/ember-4.11.0.json index 7b9c3b663..7019e4aac 100644 --- a/rev-index/ember-4.11.0.json +++ b/rev-index/ember-4.11.0.json @@ -1 +1 @@ -{"data":{"id":"ember-4.11.0","type":"project-version","attributes":{"version":"4.11.0"},"relationships":{"classes":{"data":[{"id":"ember-4.11.0-Promise","type":"class"},{"id":"ember-4.11.0-EventTarget","type":"class"},{"id":"ember-4.11.0-Container","type":"class"},{"id":"ember-4.11.0-Registry","type":"class"},{"id":"ember-4.11.0-EmberENV","type":"class"},{"id":"ember-4.11.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.11.0-ComponentStateBucket","type":"class"},{"id":"ember-4.11.0-SafeString","type":"class"},{"id":"ember-4.11.0-Component","type":"class"},{"id":"ember-4.11.0-Helper","type":"class"},{"id":"ember-4.11.0-ComputedProperty","type":"class"},{"id":"ember-4.11.0-Descriptor","type":"class"},{"id":"ember-4.11.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.11.0-Libraries","type":"class"},{"id":"ember-4.11.0-FullName","type":"class"},{"id":"ember-4.11.0-BasicRegistry","type":"class"},{"id":"ember-4.11.0-BasicContainer","type":"class"},{"id":"ember-4.11.0-Owner","type":"class"},{"id":"ember-4.11.0-RegisterOptions","type":"class"},{"id":"ember-4.11.0-Factory","type":"class"},{"id":"ember-4.11.0-FactoryManager","type":"class"},{"id":"ember-4.11.0-Resolver","type":"class"},{"id":"ember-4.11.0-InternalFactory","type":"class"},{"id":"ember-4.11.0-ContainerProxy","type":"class"},{"id":"ember-4.11.0-RegistryProxy","type":"class"},{"id":"ember-4.11.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.11.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.11.0-Ember.Comparable","type":"class"},{"id":"ember-4.11.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.11.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.11.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.11.0-Ember.String","type":"class"},{"id":"ember-4.11.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.11.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.11.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.11.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.11.0-Ember.CoreView","type":"class"},{"id":"ember-4.11.0-Application","type":"class"},{"id":"ember-4.11.0-ApplicationInstance","type":"class"},{"id":"ember-4.11.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.11.0-Namespace","type":"class"},{"id":"ember-4.11.0-EmberArray","type":"class"},{"id":"ember-4.11.0-MutableArray","type":"class"},{"id":"ember-4.11.0-Ember.NativeArray","type":"class"},{"id":"ember-4.11.0-ArrayProxy","type":"class"},{"id":"ember-4.11.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.11.0-Ember.Controller","type":"class"},{"id":"ember-4.11.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.11.0-DataAdapter","type":"class"},{"id":"ember-4.11.0-Engine","type":"class"},{"id":"ember-4.11.0-EngineInstance","type":"class"},{"id":"ember-4.11.0-Enumerable","type":"class"},{"id":"ember-4.11.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.11.0-Ember.Error","type":"class"},{"id":"ember-4.11.0-CoreObject","type":"class"},{"id":"ember-4.11.0-Evented","type":"class"},{"id":"ember-4.11.0-EmberObject","type":"class"},{"id":"ember-4.11.0-Mixin","type":"class"},{"id":"ember-4.11.0-Observable","type":"class"},{"id":"ember-4.11.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.11.0-ObjectProxy","type":"class"},{"id":"ember-4.11.0-Renderer","type":"class"},{"id":"ember-4.11.0-BucketCache","type":"class"},{"id":"ember-4.11.0-RoutingService","type":"class"},{"id":"ember-4.11.0-HashLocation","type":"class"},{"id":"ember-4.11.0-HistoryLocation","type":"class"},{"id":"ember-4.11.0-Location","type":"class"},{"id":"ember-4.11.0-NoneLocation","type":"class"},{"id":"ember-4.11.0-RouteInfo","type":"class"},{"id":"ember-4.11.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.11.0-Route","type":"class"},{"id":"ember-4.11.0-RouterService","type":"class"},{"id":"ember-4.11.0-EmberRouter","type":"class"},{"id":"ember-4.11.0-Transition","type":"class"},{"id":"ember-4.11.0-Service","type":"class"},{"id":"ember-4.11.0-String","type":"class"},{"id":"ember-4.11.0-TestAdapter","type":"class"},{"id":"ember-4.11.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.11.0-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.11.0-FEATURES","type":"namespace"},{"id":"ember-4.11.0-Instrumentation","type":"namespace"},{"id":"ember-4.11.0-AutoLocation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.11.0-rsvp","type":"module"},{"id":"ember-4.11.0-@ember/component","type":"module"},{"id":"ember-4.11.0-@ember/routing","type":"module"},{"id":"ember-4.11.0-ember","type":"module"},{"id":"ember-4.11.0-@ember/template","type":"module"},{"id":"ember-4.11.0-@glimmer/component","type":"module"},{"id":"ember-4.11.0-@glimmer/tracking","type":"module"},{"id":"ember-4.11.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.11.0-@ember/object","type":"module"},{"id":"ember-4.11.0-@ember/owner","type":"module"},{"id":"ember-4.11.0-@ember/utils","type":"module"},{"id":"ember-4.11.0-@ember/application","type":"module"},{"id":"ember-4.11.0-@ember/application/namespace","type":"module"},{"id":"ember-4.11.0-@ember/array","type":"module"},{"id":"ember-4.11.0-@ember/array/proxy","type":"module"},{"id":"ember-4.11.0-@ember/canary-features","type":"module"},{"id":"ember-4.11.0-@ember/component/template-only","type":"module"},{"id":"ember-4.11.0-ember/controller","type":"module"},{"id":"ember-4.11.0-@ember/debug","type":"module"},{"id":"ember-4.11.0-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.11.0-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.11.0-@ember/destroyable","type":"module"},{"id":"ember-4.11.0-@ember/engine","type":"module"},{"id":"ember-4.11.0-@ember/enumerable","type":"module"},{"id":"ember-4.11.0-@ember/error","type":"module"},{"id":"ember-4.11.0-@ember/helper","type":"module"},{"id":"ember-4.11.0-@ember/instrumentation","type":"module"},{"id":"ember-4.11.0-@ember/object/core","type":"module"},{"id":"ember-4.11.0-@ember/object/evented","type":"module"},{"id":"ember-4.11.0-@ember/object/mixin","type":"module"},{"id":"ember-4.11.0-@ember/object/observable","type":"module"},{"id":"ember-4.11.0-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.11.0-@ember/object/proxy","type":"module"},{"id":"ember-4.11.0-@ember/polyfills","type":"module"},{"id":"ember-4.11.0-@ember/renderer","type":"module"},{"id":"ember-4.11.0-ember/routing","type":"module"},{"id":"ember-4.11.0-@ember/routing/auto-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/hash-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/history-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/location","type":"module"},{"id":"ember-4.11.0-@ember/routing/none-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/route-info","type":"module"},{"id":"ember-4.11.0-@ember/routing/route","type":"module"},{"id":"ember-4.11.0-@ember/routing/router-service","type":"module"},{"id":"ember-4.11.0-@ember/routing/router","type":"module"},{"id":"ember-4.11.0-@ember/routing/transition","type":"module"},{"id":"ember-4.11.0-@ember/runloop","type":"module"},{"id":"ember-4.11.0-@ember/service","type":"module"},{"id":"ember-4.11.0-@ember/string","type":"module"},{"id":"ember-4.11.0-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.11.0-Container","type":"class"},{"id":"ember-4.11.0-Registry","type":"class"},{"id":"ember-4.11.0-ComponentStateBucket","type":"class"},{"id":"ember-4.11.0-Descriptor","type":"class"},{"id":"ember-4.11.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.11.0-Libraries","type":"class"},{"id":"ember-4.11.0-BasicRegistry","type":"class"},{"id":"ember-4.11.0-BasicContainer","type":"class"},{"id":"ember-4.11.0-InternalFactory","type":"class"},{"id":"ember-4.11.0-ContainerProxy","type":"class"},{"id":"ember-4.11.0-RegistryProxy","type":"class"},{"id":"ember-4.11.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.11.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.11.0-Ember.Comparable","type":"class"},{"id":"ember-4.11.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.11.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.11.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.11.0-Ember.String","type":"class"},{"id":"ember-4.11.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.11.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.11.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.11.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.11.0-Ember.CoreView","type":"class"},{"id":"ember-4.11.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.11.0-Enumerable","type":"class"},{"id":"ember-4.11.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.11.0-Ember.Error","type":"class"},{"id":"ember-4.11.0-BucketCache","type":"class"},{"id":"ember-4.11.0-RoutingService","type":"class"},{"id":"ember-4.11.0-Location","type":"class"},{"id":"ember-4.11.0-String","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.11.0-Promise","type":"class"},{"id":"ember-4.11.0-EventTarget","type":"class"},{"id":"ember-4.11.0-EmberENV","type":"class"},{"id":"ember-4.11.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.11.0-SafeString","type":"class"},{"id":"ember-4.11.0-Component","type":"class"},{"id":"ember-4.11.0-Helper","type":"class"},{"id":"ember-4.11.0-ComputedProperty","type":"class"},{"id":"ember-4.11.0-FullName","type":"class"},{"id":"ember-4.11.0-Owner","type":"class"},{"id":"ember-4.11.0-RegisterOptions","type":"class"},{"id":"ember-4.11.0-Factory","type":"class"},{"id":"ember-4.11.0-FactoryManager","type":"class"},{"id":"ember-4.11.0-Resolver","type":"class"},{"id":"ember-4.11.0-Application","type":"class"},{"id":"ember-4.11.0-ApplicationInstance","type":"class"},{"id":"ember-4.11.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.11.0-Namespace","type":"class"},{"id":"ember-4.11.0-EmberArray","type":"class"},{"id":"ember-4.11.0-MutableArray","type":"class"},{"id":"ember-4.11.0-Ember.NativeArray","type":"class"},{"id":"ember-4.11.0-ArrayProxy","type":"class"},{"id":"ember-4.11.0-Ember.Controller","type":"class"},{"id":"ember-4.11.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.11.0-DataAdapter","type":"class"},{"id":"ember-4.11.0-Engine","type":"class"},{"id":"ember-4.11.0-EngineInstance","type":"class"},{"id":"ember-4.11.0-CoreObject","type":"class"},{"id":"ember-4.11.0-Evented","type":"class"},{"id":"ember-4.11.0-EmberObject","type":"class"},{"id":"ember-4.11.0-Mixin","type":"class"},{"id":"ember-4.11.0-Observable","type":"class"},{"id":"ember-4.11.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.11.0-ObjectProxy","type":"class"},{"id":"ember-4.11.0-Renderer","type":"class"},{"id":"ember-4.11.0-HashLocation","type":"class"},{"id":"ember-4.11.0-HistoryLocation","type":"class"},{"id":"ember-4.11.0-NoneLocation","type":"class"},{"id":"ember-4.11.0-RouteInfo","type":"class"},{"id":"ember-4.11.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.11.0-Route","type":"class"},{"id":"ember-4.11.0-RouterService","type":"class"},{"id":"ember-4.11.0-EmberRouter","type":"class"},{"id":"ember-4.11.0-Transition","type":"class"},{"id":"ember-4.11.0-Service","type":"class"},{"id":"ember-4.11.0-TestAdapter","type":"class"},{"id":"ember-4.11.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.11.0-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.11.0-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.11.0-FEATURES","type":"namespace"},{"id":"ember-4.11.0-AutoLocation","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.11.0-ember","type":"module"},{"id":"ember-4.11.0-@ember/enumerable","type":"module"},{"id":"ember-4.11.0-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.11.0-rsvp","type":"module"},{"id":"ember-4.11.0-@ember/component","type":"module"},{"id":"ember-4.11.0-@ember/routing","type":"module"},{"id":"ember-4.11.0-@ember/template","type":"module"},{"id":"ember-4.11.0-@glimmer/component","type":"module"},{"id":"ember-4.11.0-@glimmer/tracking","type":"module"},{"id":"ember-4.11.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.11.0-@ember/object","type":"module"},{"id":"ember-4.11.0-@ember/owner","type":"module"},{"id":"ember-4.11.0-@ember/utils","type":"module"},{"id":"ember-4.11.0-@ember/application","type":"module"},{"id":"ember-4.11.0-@ember/application/namespace","type":"module"},{"id":"ember-4.11.0-@ember/array","type":"module"},{"id":"ember-4.11.0-@ember/array/proxy","type":"module"},{"id":"ember-4.11.0-@ember/canary-features","type":"module"},{"id":"ember-4.11.0-@ember/component/template-only","type":"module"},{"id":"ember-4.11.0-ember/controller","type":"module"},{"id":"ember-4.11.0-@ember/debug","type":"module"},{"id":"ember-4.11.0-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.11.0-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.11.0-@ember/destroyable","type":"module"},{"id":"ember-4.11.0-@ember/engine","type":"module"},{"id":"ember-4.11.0-@ember/error","type":"module"},{"id":"ember-4.11.0-@ember/helper","type":"module"},{"id":"ember-4.11.0-@ember/object/core","type":"module"},{"id":"ember-4.11.0-@ember/object/evented","type":"module"},{"id":"ember-4.11.0-@ember/object/mixin","type":"module"},{"id":"ember-4.11.0-@ember/object/observable","type":"module"},{"id":"ember-4.11.0-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.11.0-@ember/object/proxy","type":"module"},{"id":"ember-4.11.0-@ember/polyfills","type":"module"},{"id":"ember-4.11.0-@ember/renderer","type":"module"},{"id":"ember-4.11.0-ember/routing","type":"module"},{"id":"ember-4.11.0-@ember/routing/auto-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/hash-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/history-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/location","type":"module"},{"id":"ember-4.11.0-@ember/routing/none-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/route-info","type":"module"},{"id":"ember-4.11.0-@ember/routing/route","type":"module"},{"id":"ember-4.11.0-@ember/routing/router-service","type":"module"},{"id":"ember-4.11.0-@ember/routing/router","type":"module"},{"id":"ember-4.11.0-@ember/routing/transition","type":"module"},{"id":"ember-4.11.0-@ember/runloop","type":"module"},{"id":"ember-4.11.0-@ember/service","type":"module"},{"id":"ember-4.11.0-@ember/string","type":"module"},{"id":"ember-4.11.0-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.11.0-Promise":"ember-4.11.0-Promise-d9da681cb6","ember-4.11.0-EventTarget":"ember-4.11.0-EventTarget-9b5d5df9ae","ember-4.11.0-Container":"ember-4.11.0-Container-de7031d0f2","ember-4.11.0-Registry":"ember-4.11.0-Registry-51ef2a6eb6","ember-4.11.0-EmberENV":"ember-4.11.0-EmberENV-92c0bc3ee3","ember-4.11.0-Ember.Templates.helpers":"ember-4.11.0-Ember.Templates.helpers-ba4ca1c810","ember-4.11.0-ComponentStateBucket":"ember-4.11.0-ComponentStateBucket-1880c4aeeb","ember-4.11.0-SafeString":"ember-4.11.0-SafeString-9f7af55c54","ember-4.11.0-Component":"ember-4.11.0-Component-9f3170fa1f","ember-4.11.0-Helper":"ember-4.11.0-Helper-6ce4689a02","ember-4.11.0-ComputedProperty":"ember-4.11.0-ComputedProperty-25fffabee9","ember-4.11.0-Descriptor":"ember-4.11.0-Descriptor-dc00a479fb","ember-4.11.0-Ember.InjectedProperty":"ember-4.11.0-Ember.InjectedProperty-647413b65a","ember-4.11.0-Libraries":"ember-4.11.0-Libraries-af3b0e379d","ember-4.11.0-FullName":"ember-4.11.0-FullName-caeaf533aa","ember-4.11.0-BasicRegistry":"ember-4.11.0-BasicRegistry-b98837d099","ember-4.11.0-BasicContainer":"ember-4.11.0-BasicContainer-62343c0841","ember-4.11.0-Owner":"ember-4.11.0-Owner-95b0d37c54","ember-4.11.0-RegisterOptions":"ember-4.11.0-RegisterOptions-33c40cdeb7","ember-4.11.0-Factory":"ember-4.11.0-Factory-ad4ae1833b","ember-4.11.0-FactoryManager":"ember-4.11.0-FactoryManager-9c5fe9e097","ember-4.11.0-Resolver":"ember-4.11.0-Resolver-ff550c7fe4","ember-4.11.0-InternalFactory":"ember-4.11.0-InternalFactory-c93724ea15","ember-4.11.0-ContainerProxy":"ember-4.11.0-ContainerProxy-ff24b7e4c7","ember-4.11.0-RegistryProxy":"ember-4.11.0-RegistryProxy-f46a6c286c","ember-4.11.0-Ember.ProxyMixin":"ember-4.11.0-Ember.ProxyMixin-8ad3f6c16b","ember-4.11.0-Ember.ActionHandler":"ember-4.11.0-Ember.ActionHandler-066f6f3761","ember-4.11.0-Ember.Comparable":"ember-4.11.0-Ember.Comparable-8824a56e27","ember-4.11.0-ContainerProxyMixin":"ember-4.11.0-ContainerProxyMixin-0f0af55c36","ember-4.11.0-RegistryProxyMixin":"ember-4.11.0-RegistryProxyMixin-94a74705d6","ember-4.11.0-Ember.TargetActionSupport":"ember-4.11.0-Ember.TargetActionSupport-5b79caecbd","ember-4.11.0-Ember.String":"ember-4.11.0-Ember.String-5001e1ad86","ember-4.11.0-Ember.ActionSupport":"ember-4.11.0-Ember.ActionSupport-06a6f06225","ember-4.11.0-Ember.ClassNamesSupport":"ember-4.11.0-Ember.ClassNamesSupport-492bc936ad","ember-4.11.0-Ember.ViewMixin":"ember-4.11.0-Ember.ViewMixin-fcefbe1333","ember-4.11.0-Ember.EventDispatcher":"ember-4.11.0-Ember.EventDispatcher-1bdb890536","ember-4.11.0-Ember.CoreView":"ember-4.11.0-Ember.CoreView-3a78a73452","ember-4.11.0-Application":"ember-4.11.0-Application-4b9c591408","ember-4.11.0-ApplicationInstance":"ember-4.11.0-ApplicationInstance-1db94a3837","ember-4.11.0-ApplicationInstance.BootOptions":"ember-4.11.0-ApplicationInstance.BootOptions-a3542efe44","ember-4.11.0-Namespace":"ember-4.11.0-Namespace-91ec940d7b","ember-4.11.0-EmberArray":"ember-4.11.0-EmberArray-2c9f3beeea","ember-4.11.0-MutableArray":"ember-4.11.0-MutableArray-1041bf395e","ember-4.11.0-Ember.NativeArray":"ember-4.11.0-Ember.NativeArray-d0c6a5e77d","ember-4.11.0-ArrayProxy":"ember-4.11.0-ArrayProxy-110bc65630","ember-4.11.0-Ember.ControllerMixin":"ember-4.11.0-Ember.ControllerMixin-82e22ae97e","ember-4.11.0-Ember.Controller":"ember-4.11.0-Ember.Controller-fc4cad33b7","ember-4.11.0-ContainerDebugAdapter":"ember-4.11.0-ContainerDebugAdapter-37adad28f6","ember-4.11.0-DataAdapter":"ember-4.11.0-DataAdapter-7da077f0c8","ember-4.11.0-Engine":"ember-4.11.0-Engine-9096e5c5cd","ember-4.11.0-EngineInstance":"ember-4.11.0-EngineInstance-b6a43f373c","ember-4.11.0-Enumerable":"ember-4.11.0-Enumerable-5a6feba3bb","ember-4.11.0-Ember.MutableEnumerable":"ember-4.11.0-Ember.MutableEnumerable-6460332967","ember-4.11.0-Ember.Error":"ember-4.11.0-Ember.Error-f4374b97be","ember-4.11.0-CoreObject":"ember-4.11.0-CoreObject-6cd944d3df","ember-4.11.0-Evented":"ember-4.11.0-Evented-39589f81c0","ember-4.11.0-EmberObject":"ember-4.11.0-EmberObject-6774583997","ember-4.11.0-Mixin":"ember-4.11.0-Mixin-d709316e8e","ember-4.11.0-Observable":"ember-4.11.0-Observable-ee318cbac4","ember-4.11.0-PromiseProxyMixin":"ember-4.11.0-PromiseProxyMixin-716850a179","ember-4.11.0-ObjectProxy":"ember-4.11.0-ObjectProxy-94c8cc6b66","ember-4.11.0-Renderer":"ember-4.11.0-Renderer-c265e6eebf","ember-4.11.0-BucketCache":"ember-4.11.0-BucketCache-e58514c47c","ember-4.11.0-RoutingService":"ember-4.11.0-RoutingService-46c0e16a2d","ember-4.11.0-HashLocation":"ember-4.11.0-HashLocation-d6ba13e5d6","ember-4.11.0-HistoryLocation":"ember-4.11.0-HistoryLocation-9e24043cdb","ember-4.11.0-Location":"ember-4.11.0-Location-17b32b18bf","ember-4.11.0-NoneLocation":"ember-4.11.0-NoneLocation-736cc462c1","ember-4.11.0-RouteInfo":"ember-4.11.0-RouteInfo-845f3b56dd","ember-4.11.0-RouteInfoWithAttributes":"ember-4.11.0-RouteInfoWithAttributes-b993cad7f8","ember-4.11.0-Route":"ember-4.11.0-Route-79cc594aba","ember-4.11.0-RouterService":"ember-4.11.0-RouterService-bd0bc0590b","ember-4.11.0-EmberRouter":"ember-4.11.0-EmberRouter-6eb6c5243e","ember-4.11.0-Transition":"ember-4.11.0-Transition-aabbe36cd9","ember-4.11.0-Service":"ember-4.11.0-Service-c7c43984c3","ember-4.11.0-String":"ember-4.11.0-String-0a1fad149c","ember-4.11.0-TestAdapter":"ember-4.11.0-TestAdapter-6c79a80eb0","ember-4.11.0-Ember.Test.QUnitAdapter":"ember-4.11.0-Ember.Test.QUnitAdapter-c993e1d31b","ember-4.11.0-Ember.Test":"ember-4.11.0-Ember.Test-e3bccc9c8d","ember-4.11.0-Ember":"ember-4.11.0-Ember-196acc495a","ember-4.11.0-Ember.Templates.components":"ember-4.11.0-Ember.Templates.components-bbcaff8050","ember-4.11.0-rsvp":"ember-4.11.0-rsvp-0f1956c9b6","ember-4.11.0-@ember/application":"ember-4.11.0-@ember/application-52eb564c01","ember-4.11.0-@ember/array":"ember-4.11.0-@ember/array-3f3f1d94b5","ember-4.11.0-@ember/component":"ember-4.11.0-@ember/component-e543aab571","ember-4.11.0-@ember/component/helper":"ember-4.11.0-@ember/component/helper-90f6911bae","ember-4.11.0-@ember/component/template-only":"ember-4.11.0-@ember/component/template-only-bef97cc499","ember-4.11.0-@ember/debug":"ember-4.11.0-@ember/debug-5bec5017d4","ember-4.11.0-@ember/destroyable":"ember-4.11.0-@ember/destroyable-4adee0f91b","ember-4.11.0-@ember/engine":"ember-4.11.0-@ember/engine-fc4643ad63","ember-4.11.0-@ember/helper":"ember-4.11.0-@ember/helper-dbacd5643f","ember-4.11.0-@ember/instrumentation":"ember-4.11.0-@ember/instrumentation-c30053a6b5","ember-4.11.0-@ember/object":"ember-4.11.0-@ember/object-7856912a1d","ember-4.11.0-@ember/object/compat":"ember-4.11.0-@ember/object/compat-80c5cf4f48","ember-4.11.0-@ember/object/computed":"ember-4.11.0-@ember/object/computed-cb1b827f30","ember-4.11.0-@ember/object/evented":"ember-4.11.0-@ember/object/evented-af975dd079","ember-4.11.0-@ember/object/events":"ember-4.11.0-@ember/object/events-e6f94b39fd","ember-4.11.0-@ember/object/internals":"ember-4.11.0-@ember/object/internals-d7d1f4dbdb","ember-4.11.0-@ember/object/mixin":"ember-4.11.0-@ember/object/mixin-2a25729aaf","ember-4.11.0-@ember/object/observers":"ember-4.11.0-@ember/object/observers-7ff3adae07","ember-4.11.0-@ember/owner":"ember-4.11.0-@ember/owner-07a30b82ab","ember-4.11.0-@ember/polyfills":"ember-4.11.0-@ember/polyfills-b58df08fa3","ember-4.11.0-@ember/routing":"ember-4.11.0-@ember/routing-10f24f1973","ember-4.11.0-@ember/runloop":"ember-4.11.0-@ember/runloop-ffeb8b9453","ember-4.11.0-@ember/service":"ember-4.11.0-@ember/service-523a8f8699","ember-4.11.0-@ember/template":"ember-4.11.0-@ember/template-a56d2af9af","ember-4.11.0-@ember/test":"ember-4.11.0-@ember/test-0c69067f18","ember-4.11.0-@ember/utils":"ember-4.11.0-@ember/utils-16254abe8c","ember-4.11.0-@glimmer/tracking":"ember-4.11.0-@glimmer/tracking-e5cb51b6a0","ember-4.11.0-@glimmer/tracking/primitives/cache":"ember-4.11.0-@glimmer/tracking/primitives/cache-2dc488d9e6","ember-4.11.0-Ember.@ember/controller":"ember-4.11.0-Ember.@ember/controller-6bae17d03c"},"namespace":{"ember-4.11.0-FEATURES":"ember-4.11.0-FEATURES-5eb6453e06","ember-4.11.0-Instrumentation":"ember-4.11.0-Instrumentation-50b490c450","ember-4.11.0-AutoLocation":"ember-4.11.0-AutoLocation-bfcc42b139"},"module":{"ember-4.11.0-rsvp":"ember-4.11.0-rsvp-18cd046d58","ember-4.11.0-@ember/component":"ember-4.11.0-@ember/component-7248f254e6","ember-4.11.0-@ember/routing":"ember-4.11.0-@ember/routing-b682c936e9","ember-4.11.0-ember":"ember-4.11.0-ember-03672a5b63","ember-4.11.0-@ember/template":"ember-4.11.0-@ember/template-f43cc089a7","ember-4.11.0-@glimmer/component":"ember-4.11.0-@glimmer/component-84423f5462","ember-4.11.0-@glimmer/tracking":"ember-4.11.0-@glimmer/tracking-2e837e2392","ember-4.11.0-@glimmer/tracking/primitives/cache":"ember-4.11.0-@glimmer/tracking/primitives/cache-a3ae4eb88b","ember-4.11.0-@ember/object":"ember-4.11.0-@ember/object-2095d88fe5","ember-4.11.0-@ember/owner":"ember-4.11.0-@ember/owner-cc8fbf86d2","ember-4.11.0-@ember/utils":"ember-4.11.0-@ember/utils-8bf656dee0","ember-4.11.0-@ember/application":"ember-4.11.0-@ember/application-9fa084ce57","ember-4.11.0-@ember/application/namespace":"ember-4.11.0-@ember/application/namespace-a658524471","ember-4.11.0-@ember/array":"ember-4.11.0-@ember/array-52ab061689","ember-4.11.0-@ember/array/proxy":"ember-4.11.0-@ember/array/proxy-9bf33ac0fe","ember-4.11.0-@ember/canary-features":"ember-4.11.0-@ember/canary-features-61a86c98ed","ember-4.11.0-@ember/component/template-only":"ember-4.11.0-@ember/component/template-only-3437a46760","ember-4.11.0-ember/controller":"ember-4.11.0-ember/controller-98606bb5e9","ember-4.11.0-@ember/debug":"ember-4.11.0-@ember/debug-af003277a1","ember-4.11.0-@ember/debug/container-debug-adapter":"ember-4.11.0-@ember/debug/container-debug-adapter-ee9bca639d","ember-4.11.0-@ember/debug/data-adapter":"ember-4.11.0-@ember/debug/data-adapter-00f0b963c9","ember-4.11.0-@ember/destroyable":"ember-4.11.0-@ember/destroyable-fb761c27dc","ember-4.11.0-@ember/engine":"ember-4.11.0-@ember/engine-09c76101b2","ember-4.11.0-@ember/enumerable":"ember-4.11.0-@ember/enumerable-6b60540ebc","ember-4.11.0-@ember/error":"ember-4.11.0-@ember/error-4108899e64","ember-4.11.0-@ember/helper":"ember-4.11.0-@ember/helper-8f9817f465","ember-4.11.0-@ember/instrumentation":"ember-4.11.0-@ember/instrumentation-9927e703cb","ember-4.11.0-@ember/object/core":"ember-4.11.0-@ember/object/core-a742fa1cd3","ember-4.11.0-@ember/object/evented":"ember-4.11.0-@ember/object/evented-ba11dc3cda","ember-4.11.0-@ember/object/mixin":"ember-4.11.0-@ember/object/mixin-09a0eba80e","ember-4.11.0-@ember/object/observable":"ember-4.11.0-@ember/object/observable-55d3d0c358","ember-4.11.0-@ember/object/promise-proxy-mixin":"ember-4.11.0-@ember/object/promise-proxy-mixin-70168a70f7","ember-4.11.0-@ember/object/proxy":"ember-4.11.0-@ember/object/proxy-e2cf7ebfed","ember-4.11.0-@ember/polyfills":"ember-4.11.0-@ember/polyfills-19f053aae5","ember-4.11.0-@ember/renderer":"ember-4.11.0-@ember/renderer-c18d567ceb","ember-4.11.0-ember/routing":"ember-4.11.0-ember/routing-222433c2e1","ember-4.11.0-@ember/routing/auto-location":"ember-4.11.0-@ember/routing/auto-location-44bc159d62","ember-4.11.0-@ember/routing/hash-location":"ember-4.11.0-@ember/routing/hash-location-c8af6454f3","ember-4.11.0-@ember/routing/history-location":"ember-4.11.0-@ember/routing/history-location-57d4ab9009","ember-4.11.0-@ember/routing/location":"ember-4.11.0-@ember/routing/location-e50c6c1dbd","ember-4.11.0-@ember/routing/none-location":"ember-4.11.0-@ember/routing/none-location-51036a74e2","ember-4.11.0-@ember/routing/route-info":"ember-4.11.0-@ember/routing/route-info-8f66138945","ember-4.11.0-@ember/routing/route":"ember-4.11.0-@ember/routing/route-f084e24de0","ember-4.11.0-@ember/routing/router-service":"ember-4.11.0-@ember/routing/router-service-40af0eb87f","ember-4.11.0-@ember/routing/router":"ember-4.11.0-@ember/routing/router-c24d3ecfac","ember-4.11.0-@ember/routing/transition":"ember-4.11.0-@ember/routing/transition-c433e9ef07","ember-4.11.0-@ember/runloop":"ember-4.11.0-@ember/runloop-06cddbf6ba","ember-4.11.0-@ember/service":"ember-4.11.0-@ember/service-6cf8bce8ed","ember-4.11.0-@ember/string":"ember-4.11.0-@ember/string-2ada57de71","ember-4.11.0-@ember/test":"ember-4.11.0-@ember/test-a8e1860b21"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Error":"Error-158974c414"}}} \ No newline at end of file +{"data":{"id":"ember-4.11.0","type":"project-version","attributes":{"version":"4.11.0"},"relationships":{"classes":{"data":[{"id":"ember-4.11.0-Promise","type":"class"},{"id":"ember-4.11.0-EventTarget","type":"class"},{"id":"ember-4.11.0-Container","type":"class"},{"id":"ember-4.11.0-Registry","type":"class"},{"id":"ember-4.11.0-EmberENV","type":"class"},{"id":"ember-4.11.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.11.0-ComponentStateBucket","type":"class"},{"id":"ember-4.11.0-SafeString","type":"class"},{"id":"ember-4.11.0-Component","type":"class"},{"id":"ember-4.11.0-Helper","type":"class"},{"id":"ember-4.11.0-ComputedProperty","type":"class"},{"id":"ember-4.11.0-Descriptor","type":"class"},{"id":"ember-4.11.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.11.0-Libraries","type":"class"},{"id":"ember-4.11.0-FullName","type":"class"},{"id":"ember-4.11.0-BasicRegistry","type":"class"},{"id":"ember-4.11.0-BasicContainer","type":"class"},{"id":"ember-4.11.0-Owner","type":"class"},{"id":"ember-4.11.0-RegisterOptions","type":"class"},{"id":"ember-4.11.0-Factory","type":"class"},{"id":"ember-4.11.0-FactoryManager","type":"class"},{"id":"ember-4.11.0-Resolver","type":"class"},{"id":"ember-4.11.0-InternalFactory","type":"class"},{"id":"ember-4.11.0-ContainerProxy","type":"class"},{"id":"ember-4.11.0-RegistryProxy","type":"class"},{"id":"ember-4.11.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.11.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.11.0-Ember.Comparable","type":"class"},{"id":"ember-4.11.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.11.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.11.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.11.0-Ember.String","type":"class"},{"id":"ember-4.11.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.11.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.11.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.11.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.11.0-Ember.CoreView","type":"class"},{"id":"ember-4.11.0-Application","type":"class"},{"id":"ember-4.11.0-ApplicationInstance","type":"class"},{"id":"ember-4.11.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.11.0-Namespace","type":"class"},{"id":"ember-4.11.0-EmberArray","type":"class"},{"id":"ember-4.11.0-MutableArray","type":"class"},{"id":"ember-4.11.0-Ember.NativeArray","type":"class"},{"id":"ember-4.11.0-ArrayProxy","type":"class"},{"id":"ember-4.11.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.11.0-Ember.Controller","type":"class"},{"id":"ember-4.11.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.11.0-DataAdapter","type":"class"},{"id":"ember-4.11.0-Engine","type":"class"},{"id":"ember-4.11.0-EngineInstance","type":"class"},{"id":"ember-4.11.0-Enumerable","type":"class"},{"id":"ember-4.11.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.11.0-Ember.Error","type":"class"},{"id":"ember-4.11.0-CoreObject","type":"class"},{"id":"ember-4.11.0-Evented","type":"class"},{"id":"ember-4.11.0-EmberObject","type":"class"},{"id":"ember-4.11.0-Mixin","type":"class"},{"id":"ember-4.11.0-Observable","type":"class"},{"id":"ember-4.11.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.11.0-ObjectProxy","type":"class"},{"id":"ember-4.11.0-Renderer","type":"class"},{"id":"ember-4.11.0-BucketCache","type":"class"},{"id":"ember-4.11.0-RoutingService","type":"class"},{"id":"ember-4.11.0-HashLocation","type":"class"},{"id":"ember-4.11.0-HistoryLocation","type":"class"},{"id":"ember-4.11.0-Location","type":"class"},{"id":"ember-4.11.0-NoneLocation","type":"class"},{"id":"ember-4.11.0-RouteInfo","type":"class"},{"id":"ember-4.11.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.11.0-Route","type":"class"},{"id":"ember-4.11.0-RouterService","type":"class"},{"id":"ember-4.11.0-EmberRouter","type":"class"},{"id":"ember-4.11.0-Transition","type":"class"},{"id":"ember-4.11.0-Service","type":"class"},{"id":"ember-4.11.0-String","type":"class"},{"id":"ember-4.11.0-TestAdapter","type":"class"},{"id":"ember-4.11.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.11.0-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.11.0-FEATURES","type":"namespace"},{"id":"ember-4.11.0-Instrumentation","type":"namespace"},{"id":"ember-4.11.0-AutoLocation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.11.0-rsvp","type":"module"},{"id":"ember-4.11.0-@ember/component","type":"module"},{"id":"ember-4.11.0-@ember/routing","type":"module"},{"id":"ember-4.11.0-ember","type":"module"},{"id":"ember-4.11.0-@ember/template","type":"module"},{"id":"ember-4.11.0-@glimmer/component","type":"module"},{"id":"ember-4.11.0-@glimmer/tracking","type":"module"},{"id":"ember-4.11.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.11.0-@ember/object","type":"module"},{"id":"ember-4.11.0-@ember/owner","type":"module"},{"id":"ember-4.11.0-@ember/utils","type":"module"},{"id":"ember-4.11.0-@ember/application","type":"module"},{"id":"ember-4.11.0-@ember/application/namespace","type":"module"},{"id":"ember-4.11.0-@ember/array","type":"module"},{"id":"ember-4.11.0-@ember/array/proxy","type":"module"},{"id":"ember-4.11.0-@ember/canary-features","type":"module"},{"id":"ember-4.11.0-@ember/component/template-only","type":"module"},{"id":"ember-4.11.0-ember/controller","type":"module"},{"id":"ember-4.11.0-@ember/debug","type":"module"},{"id":"ember-4.11.0-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.11.0-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.11.0-@ember/destroyable","type":"module"},{"id":"ember-4.11.0-@ember/engine","type":"module"},{"id":"ember-4.11.0-@ember/enumerable","type":"module"},{"id":"ember-4.11.0-@ember/error","type":"module"},{"id":"ember-4.11.0-@ember/helper","type":"module"},{"id":"ember-4.11.0-@ember/instrumentation","type":"module"},{"id":"ember-4.11.0-@ember/object/core","type":"module"},{"id":"ember-4.11.0-@ember/object/evented","type":"module"},{"id":"ember-4.11.0-@ember/object/mixin","type":"module"},{"id":"ember-4.11.0-@ember/object/observable","type":"module"},{"id":"ember-4.11.0-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.11.0-@ember/object/proxy","type":"module"},{"id":"ember-4.11.0-@ember/polyfills","type":"module"},{"id":"ember-4.11.0-@ember/renderer","type":"module"},{"id":"ember-4.11.0-ember/routing","type":"module"},{"id":"ember-4.11.0-@ember/routing/auto-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/hash-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/history-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/location","type":"module"},{"id":"ember-4.11.0-@ember/routing/none-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/route-info","type":"module"},{"id":"ember-4.11.0-@ember/routing/route","type":"module"},{"id":"ember-4.11.0-@ember/routing/router-service","type":"module"},{"id":"ember-4.11.0-@ember/routing/router","type":"module"},{"id":"ember-4.11.0-@ember/routing/transition","type":"module"},{"id":"ember-4.11.0-@ember/runloop","type":"module"},{"id":"ember-4.11.0-@ember/service","type":"module"},{"id":"ember-4.11.0-@ember/string","type":"module"},{"id":"ember-4.11.0-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.11.0-Container","type":"class"},{"id":"ember-4.11.0-Registry","type":"class"},{"id":"ember-4.11.0-ComponentStateBucket","type":"class"},{"id":"ember-4.11.0-Descriptor","type":"class"},{"id":"ember-4.11.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.11.0-Libraries","type":"class"},{"id":"ember-4.11.0-BasicRegistry","type":"class"},{"id":"ember-4.11.0-BasicContainer","type":"class"},{"id":"ember-4.11.0-InternalFactory","type":"class"},{"id":"ember-4.11.0-ContainerProxy","type":"class"},{"id":"ember-4.11.0-RegistryProxy","type":"class"},{"id":"ember-4.11.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.11.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.11.0-Ember.Comparable","type":"class"},{"id":"ember-4.11.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.11.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.11.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.11.0-Ember.String","type":"class"},{"id":"ember-4.11.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.11.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.11.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.11.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.11.0-Ember.CoreView","type":"class"},{"id":"ember-4.11.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.11.0-Enumerable","type":"class"},{"id":"ember-4.11.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.11.0-Ember.Error","type":"class"},{"id":"ember-4.11.0-BucketCache","type":"class"},{"id":"ember-4.11.0-RoutingService","type":"class"},{"id":"ember-4.11.0-Location","type":"class"},{"id":"ember-4.11.0-String","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.11.0-Promise","type":"class"},{"id":"ember-4.11.0-EventTarget","type":"class"},{"id":"ember-4.11.0-EmberENV","type":"class"},{"id":"ember-4.11.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.11.0-SafeString","type":"class"},{"id":"ember-4.11.0-Component","type":"class"},{"id":"ember-4.11.0-Helper","type":"class"},{"id":"ember-4.11.0-ComputedProperty","type":"class"},{"id":"ember-4.11.0-FullName","type":"class"},{"id":"ember-4.11.0-Owner","type":"class"},{"id":"ember-4.11.0-RegisterOptions","type":"class"},{"id":"ember-4.11.0-Factory","type":"class"},{"id":"ember-4.11.0-FactoryManager","type":"class"},{"id":"ember-4.11.0-Resolver","type":"class"},{"id":"ember-4.11.0-Application","type":"class"},{"id":"ember-4.11.0-ApplicationInstance","type":"class"},{"id":"ember-4.11.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.11.0-Namespace","type":"class"},{"id":"ember-4.11.0-EmberArray","type":"class"},{"id":"ember-4.11.0-MutableArray","type":"class"},{"id":"ember-4.11.0-Ember.NativeArray","type":"class"},{"id":"ember-4.11.0-ArrayProxy","type":"class"},{"id":"ember-4.11.0-Ember.Controller","type":"class"},{"id":"ember-4.11.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.11.0-DataAdapter","type":"class"},{"id":"ember-4.11.0-Engine","type":"class"},{"id":"ember-4.11.0-EngineInstance","type":"class"},{"id":"ember-4.11.0-CoreObject","type":"class"},{"id":"ember-4.11.0-Evented","type":"class"},{"id":"ember-4.11.0-EmberObject","type":"class"},{"id":"ember-4.11.0-Mixin","type":"class"},{"id":"ember-4.11.0-Observable","type":"class"},{"id":"ember-4.11.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.11.0-ObjectProxy","type":"class"},{"id":"ember-4.11.0-Renderer","type":"class"},{"id":"ember-4.11.0-HashLocation","type":"class"},{"id":"ember-4.11.0-HistoryLocation","type":"class"},{"id":"ember-4.11.0-NoneLocation","type":"class"},{"id":"ember-4.11.0-RouteInfo","type":"class"},{"id":"ember-4.11.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.11.0-Route","type":"class"},{"id":"ember-4.11.0-RouterService","type":"class"},{"id":"ember-4.11.0-EmberRouter","type":"class"},{"id":"ember-4.11.0-Transition","type":"class"},{"id":"ember-4.11.0-Service","type":"class"},{"id":"ember-4.11.0-TestAdapter","type":"class"},{"id":"ember-4.11.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.11.0-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.11.0-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.11.0-FEATURES","type":"namespace"},{"id":"ember-4.11.0-AutoLocation","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.11.0-ember","type":"module"},{"id":"ember-4.11.0-@ember/enumerable","type":"module"},{"id":"ember-4.11.0-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.11.0-rsvp","type":"module"},{"id":"ember-4.11.0-@ember/component","type":"module"},{"id":"ember-4.11.0-@ember/routing","type":"module"},{"id":"ember-4.11.0-@ember/template","type":"module"},{"id":"ember-4.11.0-@glimmer/component","type":"module"},{"id":"ember-4.11.0-@glimmer/tracking","type":"module"},{"id":"ember-4.11.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.11.0-@ember/object","type":"module"},{"id":"ember-4.11.0-@ember/owner","type":"module"},{"id":"ember-4.11.0-@ember/utils","type":"module"},{"id":"ember-4.11.0-@ember/application","type":"module"},{"id":"ember-4.11.0-@ember/application/namespace","type":"module"},{"id":"ember-4.11.0-@ember/array","type":"module"},{"id":"ember-4.11.0-@ember/array/proxy","type":"module"},{"id":"ember-4.11.0-@ember/canary-features","type":"module"},{"id":"ember-4.11.0-@ember/component/template-only","type":"module"},{"id":"ember-4.11.0-ember/controller","type":"module"},{"id":"ember-4.11.0-@ember/debug","type":"module"},{"id":"ember-4.11.0-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.11.0-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.11.0-@ember/destroyable","type":"module"},{"id":"ember-4.11.0-@ember/engine","type":"module"},{"id":"ember-4.11.0-@ember/error","type":"module"},{"id":"ember-4.11.0-@ember/helper","type":"module"},{"id":"ember-4.11.0-@ember/object/core","type":"module"},{"id":"ember-4.11.0-@ember/object/evented","type":"module"},{"id":"ember-4.11.0-@ember/object/mixin","type":"module"},{"id":"ember-4.11.0-@ember/object/observable","type":"module"},{"id":"ember-4.11.0-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.11.0-@ember/object/proxy","type":"module"},{"id":"ember-4.11.0-@ember/polyfills","type":"module"},{"id":"ember-4.11.0-@ember/renderer","type":"module"},{"id":"ember-4.11.0-ember/routing","type":"module"},{"id":"ember-4.11.0-@ember/routing/auto-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/hash-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/history-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/location","type":"module"},{"id":"ember-4.11.0-@ember/routing/none-location","type":"module"},{"id":"ember-4.11.0-@ember/routing/route-info","type":"module"},{"id":"ember-4.11.0-@ember/routing/route","type":"module"},{"id":"ember-4.11.0-@ember/routing/router-service","type":"module"},{"id":"ember-4.11.0-@ember/routing/router","type":"module"},{"id":"ember-4.11.0-@ember/routing/transition","type":"module"},{"id":"ember-4.11.0-@ember/runloop","type":"module"},{"id":"ember-4.11.0-@ember/service","type":"module"},{"id":"ember-4.11.0-@ember/string","type":"module"},{"id":"ember-4.11.0-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.11.0-Promise":"ember-4.11.0-Promise-eee4d451fc","ember-4.11.0-EventTarget":"ember-4.11.0-EventTarget-9b5d5df9ae","ember-4.11.0-Container":"ember-4.11.0-Container-d12b7ac674","ember-4.11.0-Registry":"ember-4.11.0-Registry-f25f49c702","ember-4.11.0-EmberENV":"ember-4.11.0-EmberENV-92c0bc3ee3","ember-4.11.0-Ember.Templates.helpers":"ember-4.11.0-Ember.Templates.helpers-275528c99e","ember-4.11.0-ComponentStateBucket":"ember-4.11.0-ComponentStateBucket-1880c4aeeb","ember-4.11.0-SafeString":"ember-4.11.0-SafeString-9f7af55c54","ember-4.11.0-Component":"ember-4.11.0-Component-19a668a9d0","ember-4.11.0-Helper":"ember-4.11.0-Helper-d535a37fd8","ember-4.11.0-ComputedProperty":"ember-4.11.0-ComputedProperty-7ad91be9f2","ember-4.11.0-Descriptor":"ember-4.11.0-Descriptor-dc00a479fb","ember-4.11.0-Ember.InjectedProperty":"ember-4.11.0-Ember.InjectedProperty-647413b65a","ember-4.11.0-Libraries":"ember-4.11.0-Libraries-af3b0e379d","ember-4.11.0-FullName":"ember-4.11.0-FullName-caeaf533aa","ember-4.11.0-BasicRegistry":"ember-4.11.0-BasicRegistry-da09ede701","ember-4.11.0-BasicContainer":"ember-4.11.0-BasicContainer-f459e891b3","ember-4.11.0-Owner":"ember-4.11.0-Owner-3c7641e4ab","ember-4.11.0-RegisterOptions":"ember-4.11.0-RegisterOptions-33c40cdeb7","ember-4.11.0-Factory":"ember-4.11.0-Factory-ad4ae1833b","ember-4.11.0-FactoryManager":"ember-4.11.0-FactoryManager-9c5fe9e097","ember-4.11.0-Resolver":"ember-4.11.0-Resolver-ff550c7fe4","ember-4.11.0-InternalFactory":"ember-4.11.0-InternalFactory-c93724ea15","ember-4.11.0-ContainerProxy":"ember-4.11.0-ContainerProxy-069847d7b8","ember-4.11.0-RegistryProxy":"ember-4.11.0-RegistryProxy-90b860ed4f","ember-4.11.0-Ember.ProxyMixin":"ember-4.11.0-Ember.ProxyMixin-8ad3f6c16b","ember-4.11.0-Ember.ActionHandler":"ember-4.11.0-Ember.ActionHandler-d1b3193d74","ember-4.11.0-Ember.Comparable":"ember-4.11.0-Ember.Comparable-8824a56e27","ember-4.11.0-ContainerProxyMixin":"ember-4.11.0-ContainerProxyMixin-8cb3cb0c28","ember-4.11.0-RegistryProxyMixin":"ember-4.11.0-RegistryProxyMixin-2c6a220939","ember-4.11.0-Ember.TargetActionSupport":"ember-4.11.0-Ember.TargetActionSupport-e5956a21ca","ember-4.11.0-Ember.String":"ember-4.11.0-Ember.String-5001e1ad86","ember-4.11.0-Ember.ActionSupport":"ember-4.11.0-Ember.ActionSupport-06a6f06225","ember-4.11.0-Ember.ClassNamesSupport":"ember-4.11.0-Ember.ClassNamesSupport-492bc936ad","ember-4.11.0-Ember.ViewMixin":"ember-4.11.0-Ember.ViewMixin-1c51e34210","ember-4.11.0-Ember.EventDispatcher":"ember-4.11.0-Ember.EventDispatcher-070d3aa37c","ember-4.11.0-Ember.CoreView":"ember-4.11.0-Ember.CoreView-13a6e01b12","ember-4.11.0-Application":"ember-4.11.0-Application-b696b850cb","ember-4.11.0-ApplicationInstance":"ember-4.11.0-ApplicationInstance-d5826e684b","ember-4.11.0-ApplicationInstance.BootOptions":"ember-4.11.0-ApplicationInstance.BootOptions-8e363bdf1f","ember-4.11.0-Namespace":"ember-4.11.0-Namespace-f7ca1596fd","ember-4.11.0-EmberArray":"ember-4.11.0-EmberArray-b76fe6fa1c","ember-4.11.0-MutableArray":"ember-4.11.0-MutableArray-11ea04a62f","ember-4.11.0-Ember.NativeArray":"ember-4.11.0-Ember.NativeArray-600110ad8e","ember-4.11.0-ArrayProxy":"ember-4.11.0-ArrayProxy-dc14e58c97","ember-4.11.0-Ember.ControllerMixin":"ember-4.11.0-Ember.ControllerMixin-1d246531e3","ember-4.11.0-Ember.Controller":"ember-4.11.0-Ember.Controller-78b14a8932","ember-4.11.0-ContainerDebugAdapter":"ember-4.11.0-ContainerDebugAdapter-0d956f4f3c","ember-4.11.0-DataAdapter":"ember-4.11.0-DataAdapter-83222702fa","ember-4.11.0-Engine":"ember-4.11.0-Engine-0ea749ee57","ember-4.11.0-EngineInstance":"ember-4.11.0-EngineInstance-1c83ab62c1","ember-4.11.0-Enumerable":"ember-4.11.0-Enumerable-5a6feba3bb","ember-4.11.0-Ember.MutableEnumerable":"ember-4.11.0-Ember.MutableEnumerable-6460332967","ember-4.11.0-Ember.Error":"ember-4.11.0-Ember.Error-f4374b97be","ember-4.11.0-CoreObject":"ember-4.11.0-CoreObject-7008c5c323","ember-4.11.0-Evented":"ember-4.11.0-Evented-c79f965ff2","ember-4.11.0-EmberObject":"ember-4.11.0-EmberObject-1033167301","ember-4.11.0-Mixin":"ember-4.11.0-Mixin-ea73cc7468","ember-4.11.0-Observable":"ember-4.11.0-Observable-7027866d58","ember-4.11.0-PromiseProxyMixin":"ember-4.11.0-PromiseProxyMixin-6ded533057","ember-4.11.0-ObjectProxy":"ember-4.11.0-ObjectProxy-368c628abd","ember-4.11.0-Renderer":"ember-4.11.0-Renderer-c265e6eebf","ember-4.11.0-BucketCache":"ember-4.11.0-BucketCache-e58514c47c","ember-4.11.0-RoutingService":"ember-4.11.0-RoutingService-46c0e16a2d","ember-4.11.0-HashLocation":"ember-4.11.0-HashLocation-ee37bf4009","ember-4.11.0-HistoryLocation":"ember-4.11.0-HistoryLocation-20da21cf0b","ember-4.11.0-Location":"ember-4.11.0-Location-d697548159","ember-4.11.0-NoneLocation":"ember-4.11.0-NoneLocation-962b5f5b42","ember-4.11.0-RouteInfo":"ember-4.11.0-RouteInfo-845f3b56dd","ember-4.11.0-RouteInfoWithAttributes":"ember-4.11.0-RouteInfoWithAttributes-b993cad7f8","ember-4.11.0-Route":"ember-4.11.0-Route-613f268f41","ember-4.11.0-RouterService":"ember-4.11.0-RouterService-e16bc689e2","ember-4.11.0-EmberRouter":"ember-4.11.0-EmberRouter-09f6a588f9","ember-4.11.0-Transition":"ember-4.11.0-Transition-aabbe36cd9","ember-4.11.0-Service":"ember-4.11.0-Service-aa0f8098cc","ember-4.11.0-String":"ember-4.11.0-String-8146cf6157","ember-4.11.0-TestAdapter":"ember-4.11.0-TestAdapter-6c79a80eb0","ember-4.11.0-Ember.Test.QUnitAdapter":"ember-4.11.0-Ember.Test.QUnitAdapter-c993e1d31b","ember-4.11.0-Ember.Test":"ember-4.11.0-Ember.Test-9c271e3f7e","ember-4.11.0-Ember":"ember-4.11.0-Ember-196acc495a","ember-4.11.0-Ember.Templates.components":"ember-4.11.0-Ember.Templates.components-121248e355","ember-4.11.0-rsvp":"ember-4.11.0-rsvp-4aed7510f7","ember-4.11.0-@ember/application":"ember-4.11.0-@ember/application-51a520a6b0","ember-4.11.0-@ember/array":"ember-4.11.0-@ember/array-3f3f1d94b5","ember-4.11.0-@ember/component":"ember-4.11.0-@ember/component-e543aab571","ember-4.11.0-@ember/component/helper":"ember-4.11.0-@ember/component/helper-dfb6ff4f54","ember-4.11.0-@ember/component/template-only":"ember-4.11.0-@ember/component/template-only-bef97cc499","ember-4.11.0-@ember/debug":"ember-4.11.0-@ember/debug-4aea88c042","ember-4.11.0-@ember/destroyable":"ember-4.11.0-@ember/destroyable-de1a9a1c25","ember-4.11.0-@ember/engine":"ember-4.11.0-@ember/engine-fc4643ad63","ember-4.11.0-@ember/helper":"ember-4.11.0-@ember/helper-bb51052029","ember-4.11.0-@ember/instrumentation":"ember-4.11.0-@ember/instrumentation-c30053a6b5","ember-4.11.0-@ember/object":"ember-4.11.0-@ember/object-3b94521639","ember-4.11.0-@ember/object/compat":"ember-4.11.0-@ember/object/compat-3d1be7e1e5","ember-4.11.0-@ember/object/computed":"ember-4.11.0-@ember/object/computed-a71312e35f","ember-4.11.0-@ember/object/evented":"ember-4.11.0-@ember/object/evented-b73b4a3b79","ember-4.11.0-@ember/object/events":"ember-4.11.0-@ember/object/events-e6f94b39fd","ember-4.11.0-@ember/object/internals":"ember-4.11.0-@ember/object/internals-d7d1f4dbdb","ember-4.11.0-@ember/object/mixin":"ember-4.11.0-@ember/object/mixin-2a25729aaf","ember-4.11.0-@ember/object/observers":"ember-4.11.0-@ember/object/observers-7ff3adae07","ember-4.11.0-@ember/owner":"ember-4.11.0-@ember/owner-b336f2eb0c","ember-4.11.0-@ember/polyfills":"ember-4.11.0-@ember/polyfills-8962ed51c5","ember-4.11.0-@ember/routing":"ember-4.11.0-@ember/routing-10f24f1973","ember-4.11.0-@ember/runloop":"ember-4.11.0-@ember/runloop-98e2e4a919","ember-4.11.0-@ember/service":"ember-4.11.0-@ember/service-9bcb011981","ember-4.11.0-@ember/template":"ember-4.11.0-@ember/template-80a2e4cf07","ember-4.11.0-@ember/test":"ember-4.11.0-@ember/test-3f8f6a994a","ember-4.11.0-@ember/utils":"ember-4.11.0-@ember/utils-526f62ce94","ember-4.11.0-@glimmer/tracking":"ember-4.11.0-@glimmer/tracking-d7f925b42e","ember-4.11.0-@glimmer/tracking/primitives/cache":"ember-4.11.0-@glimmer/tracking/primitives/cache-ca10873eee","ember-4.11.0-Ember.@ember/controller":"ember-4.11.0-Ember.@ember/controller-3f69b161e5"},"namespace":{"ember-4.11.0-FEATURES":"ember-4.11.0-FEATURES-5eb6453e06","ember-4.11.0-Instrumentation":"ember-4.11.0-Instrumentation-2948023931","ember-4.11.0-AutoLocation":"ember-4.11.0-AutoLocation-3689d9e585"},"module":{"ember-4.11.0-rsvp":"ember-4.11.0-rsvp-18cd046d58","ember-4.11.0-@ember/component":"ember-4.11.0-@ember/component-00fc10b8a2","ember-4.11.0-@ember/routing":"ember-4.11.0-@ember/routing-b682c936e9","ember-4.11.0-ember":"ember-4.11.0-ember-03672a5b63","ember-4.11.0-@ember/template":"ember-4.11.0-@ember/template-f43cc089a7","ember-4.11.0-@glimmer/component":"ember-4.11.0-@glimmer/component-bb142d144c","ember-4.11.0-@glimmer/tracking":"ember-4.11.0-@glimmer/tracking-2e837e2392","ember-4.11.0-@glimmer/tracking/primitives/cache":"ember-4.11.0-@glimmer/tracking/primitives/cache-a3ae4eb88b","ember-4.11.0-@ember/object":"ember-4.11.0-@ember/object-2095d88fe5","ember-4.11.0-@ember/owner":"ember-4.11.0-@ember/owner-cc8fbf86d2","ember-4.11.0-@ember/utils":"ember-4.11.0-@ember/utils-8bf656dee0","ember-4.11.0-@ember/application":"ember-4.11.0-@ember/application-9fa084ce57","ember-4.11.0-@ember/application/namespace":"ember-4.11.0-@ember/application/namespace-a658524471","ember-4.11.0-@ember/array":"ember-4.11.0-@ember/array-52ab061689","ember-4.11.0-@ember/array/proxy":"ember-4.11.0-@ember/array/proxy-9bf33ac0fe","ember-4.11.0-@ember/canary-features":"ember-4.11.0-@ember/canary-features-61a86c98ed","ember-4.11.0-@ember/component/template-only":"ember-4.11.0-@ember/component/template-only-3437a46760","ember-4.11.0-ember/controller":"ember-4.11.0-ember/controller-98606bb5e9","ember-4.11.0-@ember/debug":"ember-4.11.0-@ember/debug-af003277a1","ember-4.11.0-@ember/debug/container-debug-adapter":"ember-4.11.0-@ember/debug/container-debug-adapter-ee9bca639d","ember-4.11.0-@ember/debug/data-adapter":"ember-4.11.0-@ember/debug/data-adapter-00f0b963c9","ember-4.11.0-@ember/destroyable":"ember-4.11.0-@ember/destroyable-fb761c27dc","ember-4.11.0-@ember/engine":"ember-4.11.0-@ember/engine-09c76101b2","ember-4.11.0-@ember/enumerable":"ember-4.11.0-@ember/enumerable-6b60540ebc","ember-4.11.0-@ember/error":"ember-4.11.0-@ember/error-4108899e64","ember-4.11.0-@ember/helper":"ember-4.11.0-@ember/helper-8f9817f465","ember-4.11.0-@ember/instrumentation":"ember-4.11.0-@ember/instrumentation-9927e703cb","ember-4.11.0-@ember/object/core":"ember-4.11.0-@ember/object/core-a742fa1cd3","ember-4.11.0-@ember/object/evented":"ember-4.11.0-@ember/object/evented-ba11dc3cda","ember-4.11.0-@ember/object/mixin":"ember-4.11.0-@ember/object/mixin-09a0eba80e","ember-4.11.0-@ember/object/observable":"ember-4.11.0-@ember/object/observable-55d3d0c358","ember-4.11.0-@ember/object/promise-proxy-mixin":"ember-4.11.0-@ember/object/promise-proxy-mixin-70168a70f7","ember-4.11.0-@ember/object/proxy":"ember-4.11.0-@ember/object/proxy-e2cf7ebfed","ember-4.11.0-@ember/polyfills":"ember-4.11.0-@ember/polyfills-19f053aae5","ember-4.11.0-@ember/renderer":"ember-4.11.0-@ember/renderer-c18d567ceb","ember-4.11.0-ember/routing":"ember-4.11.0-ember/routing-222433c2e1","ember-4.11.0-@ember/routing/auto-location":"ember-4.11.0-@ember/routing/auto-location-44bc159d62","ember-4.11.0-@ember/routing/hash-location":"ember-4.11.0-@ember/routing/hash-location-c8af6454f3","ember-4.11.0-@ember/routing/history-location":"ember-4.11.0-@ember/routing/history-location-57d4ab9009","ember-4.11.0-@ember/routing/location":"ember-4.11.0-@ember/routing/location-e50c6c1dbd","ember-4.11.0-@ember/routing/none-location":"ember-4.11.0-@ember/routing/none-location-51036a74e2","ember-4.11.0-@ember/routing/route-info":"ember-4.11.0-@ember/routing/route-info-8f66138945","ember-4.11.0-@ember/routing/route":"ember-4.11.0-@ember/routing/route-f084e24de0","ember-4.11.0-@ember/routing/router-service":"ember-4.11.0-@ember/routing/router-service-40af0eb87f","ember-4.11.0-@ember/routing/router":"ember-4.11.0-@ember/routing/router-c24d3ecfac","ember-4.11.0-@ember/routing/transition":"ember-4.11.0-@ember/routing/transition-c433e9ef07","ember-4.11.0-@ember/runloop":"ember-4.11.0-@ember/runloop-06cddbf6ba","ember-4.11.0-@ember/service":"ember-4.11.0-@ember/service-6cf8bce8ed","ember-4.11.0-@ember/string":"ember-4.11.0-@ember/string-2ada57de71","ember-4.11.0-@ember/test":"ember-4.11.0-@ember/test-a8e1860b21"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Error":"Error-158974c414"}}} \ No newline at end of file diff --git a/rev-index/ember-4.12.1.json b/rev-index/ember-4.12.1.json deleted file mode 100644 index 2bc4aeab7..000000000 --- a/rev-index/ember-4.12.1.json +++ /dev/null @@ -1 +0,0 @@ -{"data":{"id":"ember-4.12.1","type":"project-version","attributes":{"version":"4.12.1"},"relationships":{"classes":{"data":[{"id":"ember-4.12.1-Promise","type":"class"},{"id":"ember-4.12.1-EventTarget","type":"class"},{"id":"ember-4.12.1-Container","type":"class"},{"id":"ember-4.12.1-Registry","type":"class"},{"id":"ember-4.12.1-EmberENV","type":"class"},{"id":"ember-4.12.1-Ember.Templates.helpers","type":"class"},{"id":"ember-4.12.1-ComponentStateBucket","type":"class"},{"id":"ember-4.12.1-SafeString","type":"class"},{"id":"ember-4.12.1-Component","type":"class"},{"id":"ember-4.12.1-Helper","type":"class"},{"id":"ember-4.12.1-ComputedProperty","type":"class"},{"id":"ember-4.12.1-Descriptor","type":"class"},{"id":"ember-4.12.1-Ember.InjectedProperty","type":"class"},{"id":"ember-4.12.1-Libraries","type":"class"},{"id":"ember-4.12.1-FullName","type":"class"},{"id":"ember-4.12.1-BasicRegistry","type":"class"},{"id":"ember-4.12.1-BasicContainer","type":"class"},{"id":"ember-4.12.1-Owner","type":"class"},{"id":"ember-4.12.1-RegisterOptions","type":"class"},{"id":"ember-4.12.1-Factory","type":"class"},{"id":"ember-4.12.1-FactoryManager","type":"class"},{"id":"ember-4.12.1-Resolver","type":"class"},{"id":"ember-4.12.1-InternalFactory","type":"class"},{"id":"ember-4.12.1-ContainerProxy","type":"class"},{"id":"ember-4.12.1-RegistryProxy","type":"class"},{"id":"ember-4.12.1-Ember.ProxyMixin","type":"class"},{"id":"ember-4.12.1-Ember.ActionHandler","type":"class"},{"id":"ember-4.12.1-Ember.Comparable","type":"class"},{"id":"ember-4.12.1-ContainerProxyMixin","type":"class"},{"id":"ember-4.12.1-RegistryProxyMixin","type":"class"},{"id":"ember-4.12.1-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.12.1-Ember.String","type":"class"},{"id":"ember-4.12.1-Ember.ActionSupport","type":"class"},{"id":"ember-4.12.1-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.12.1-Ember.ViewMixin","type":"class"},{"id":"ember-4.12.1-Ember.EventDispatcher","type":"class"},{"id":"ember-4.12.1-Ember.CoreView","type":"class"},{"id":"ember-4.12.1-Application","type":"class"},{"id":"ember-4.12.1-ApplicationInstance","type":"class"},{"id":"ember-4.12.1-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.12.1-Namespace","type":"class"},{"id":"ember-4.12.1-EmberArray","type":"class"},{"id":"ember-4.12.1-MutableArray","type":"class"},{"id":"ember-4.12.1-Ember.NativeArray","type":"class"},{"id":"ember-4.12.1-ArrayProxy","type":"class"},{"id":"ember-4.12.1-Ember.ControllerMixin","type":"class"},{"id":"ember-4.12.1-Ember.Controller","type":"class"},{"id":"ember-4.12.1-ContainerDebugAdapter","type":"class"},{"id":"ember-4.12.1-DataAdapter","type":"class"},{"id":"ember-4.12.1-Engine","type":"class"},{"id":"ember-4.12.1-EngineInstance","type":"class"},{"id":"ember-4.12.1-Enumerable","type":"class"},{"id":"ember-4.12.1-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.12.1-Ember.Error","type":"class"},{"id":"ember-4.12.1-CoreObject","type":"class"},{"id":"ember-4.12.1-Evented","type":"class"},{"id":"ember-4.12.1-EmberObject","type":"class"},{"id":"ember-4.12.1-Mixin","type":"class"},{"id":"ember-4.12.1-Observable","type":"class"},{"id":"ember-4.12.1-PromiseProxyMixin","type":"class"},{"id":"ember-4.12.1-ObjectProxy","type":"class"},{"id":"ember-4.12.1-Renderer","type":"class"},{"id":"ember-4.12.1-BucketCache","type":"class"},{"id":"ember-4.12.1-RoutingService","type":"class"},{"id":"ember-4.12.1-HashLocation","type":"class"},{"id":"ember-4.12.1-HistoryLocation","type":"class"},{"id":"ember-4.12.1-Location","type":"class"},{"id":"ember-4.12.1-NoneLocation","type":"class"},{"id":"ember-4.12.1-RouteInfo","type":"class"},{"id":"ember-4.12.1-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.12.1-Route","type":"class"},{"id":"ember-4.12.1-RouterService","type":"class"},{"id":"ember-4.12.1-EmberRouter","type":"class"},{"id":"ember-4.12.1-Transition","type":"class"},{"id":"ember-4.12.1-Service","type":"class"},{"id":"ember-4.12.1-String","type":"class"},{"id":"ember-4.12.1-TestAdapter","type":"class"},{"id":"ember-4.12.1-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.12.1-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.12.1-FEATURES","type":"namespace"},{"id":"ember-4.12.1-Instrumentation","type":"namespace"},{"id":"ember-4.12.1-AutoLocation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.12.1-rsvp","type":"module"},{"id":"ember-4.12.1-@ember/component","type":"module"},{"id":"ember-4.12.1-@ember/routing","type":"module"},{"id":"ember-4.12.1-ember","type":"module"},{"id":"ember-4.12.1-@ember/template","type":"module"},{"id":"ember-4.12.1-@glimmer/component","type":"module"},{"id":"ember-4.12.1-@glimmer/tracking","type":"module"},{"id":"ember-4.12.1-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.12.1-@ember/object","type":"module"},{"id":"ember-4.12.1-@ember/owner","type":"module"},{"id":"ember-4.12.1-@ember/utils","type":"module"},{"id":"ember-4.12.1-@ember/application","type":"module"},{"id":"ember-4.12.1-@ember/application/namespace","type":"module"},{"id":"ember-4.12.1-@ember/array","type":"module"},{"id":"ember-4.12.1-@ember/array/proxy","type":"module"},{"id":"ember-4.12.1-@ember/canary-features","type":"module"},{"id":"ember-4.12.1-@ember/component/template-only","type":"module"},{"id":"ember-4.12.1-@ember/controller","type":"module"},{"id":"ember-4.12.1-@ember/debug","type":"module"},{"id":"ember-4.12.1-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.12.1-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.12.1-@ember/destroyable","type":"module"},{"id":"ember-4.12.1-@ember/engine","type":"module"},{"id":"ember-4.12.1-@ember/enumerable","type":"module"},{"id":"ember-4.12.1-@ember/error","type":"module"},{"id":"ember-4.12.1-@ember/helper","type":"module"},{"id":"ember-4.12.1-@ember/instrumentation","type":"module"},{"id":"ember-4.12.1-@ember/object/core","type":"module"},{"id":"ember-4.12.1-@ember/object/evented","type":"module"},{"id":"ember-4.12.1-@ember/object/mixin","type":"module"},{"id":"ember-4.12.1-@ember/object/observable","type":"module"},{"id":"ember-4.12.1-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.12.1-@ember/object/proxy","type":"module"},{"id":"ember-4.12.1-@ember/polyfills","type":"module"},{"id":"ember-4.12.1-@ember/renderer","type":"module"},{"id":"ember-4.12.1-ember/routing","type":"module"},{"id":"ember-4.12.1-@ember/routing/auto-location","type":"module"},{"id":"ember-4.12.1-@ember/routing/hash-location","type":"module"},{"id":"ember-4.12.1-@ember/routing/history-location","type":"module"},{"id":"ember-4.12.1-@ember/routing/location","type":"module"},{"id":"ember-4.12.1-@ember/routing/none-location","type":"module"},{"id":"ember-4.12.1-@ember/routing/route-info","type":"module"},{"id":"ember-4.12.1-@ember/routing/route","type":"module"},{"id":"ember-4.12.1-@ember/routing/router-service","type":"module"},{"id":"ember-4.12.1-@ember/routing/router","type":"module"},{"id":"ember-4.12.1-@ember/routing/transition","type":"module"},{"id":"ember-4.12.1-@ember/runloop","type":"module"},{"id":"ember-4.12.1-@ember/service","type":"module"},{"id":"ember-4.12.1-@ember/string","type":"module"},{"id":"ember-4.12.1-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.12.1-Container","type":"class"},{"id":"ember-4.12.1-Registry","type":"class"},{"id":"ember-4.12.1-ComponentStateBucket","type":"class"},{"id":"ember-4.12.1-Descriptor","type":"class"},{"id":"ember-4.12.1-Ember.InjectedProperty","type":"class"},{"id":"ember-4.12.1-Libraries","type":"class"},{"id":"ember-4.12.1-BasicRegistry","type":"class"},{"id":"ember-4.12.1-BasicContainer","type":"class"},{"id":"ember-4.12.1-InternalFactory","type":"class"},{"id":"ember-4.12.1-ContainerProxy","type":"class"},{"id":"ember-4.12.1-RegistryProxy","type":"class"},{"id":"ember-4.12.1-Ember.ProxyMixin","type":"class"},{"id":"ember-4.12.1-Ember.ActionHandler","type":"class"},{"id":"ember-4.12.1-Ember.Comparable","type":"class"},{"id":"ember-4.12.1-ContainerProxyMixin","type":"class"},{"id":"ember-4.12.1-RegistryProxyMixin","type":"class"},{"id":"ember-4.12.1-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.12.1-Ember.String","type":"class"},{"id":"ember-4.12.1-Ember.ActionSupport","type":"class"},{"id":"ember-4.12.1-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.12.1-Ember.ViewMixin","type":"class"},{"id":"ember-4.12.1-Ember.EventDispatcher","type":"class"},{"id":"ember-4.12.1-Ember.CoreView","type":"class"},{"id":"ember-4.12.1-Ember.ControllerMixin","type":"class"},{"id":"ember-4.12.1-Enumerable","type":"class"},{"id":"ember-4.12.1-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.12.1-Ember.Error","type":"class"},{"id":"ember-4.12.1-BucketCache","type":"class"},{"id":"ember-4.12.1-RoutingService","type":"class"},{"id":"ember-4.12.1-Location","type":"class"},{"id":"ember-4.12.1-String","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.12.1-Promise","type":"class"},{"id":"ember-4.12.1-EventTarget","type":"class"},{"id":"ember-4.12.1-EmberENV","type":"class"},{"id":"ember-4.12.1-Ember.Templates.helpers","type":"class"},{"id":"ember-4.12.1-SafeString","type":"class"},{"id":"ember-4.12.1-Component","type":"class"},{"id":"ember-4.12.1-Helper","type":"class"},{"id":"ember-4.12.1-ComputedProperty","type":"class"},{"id":"ember-4.12.1-FullName","type":"class"},{"id":"ember-4.12.1-Owner","type":"class"},{"id":"ember-4.12.1-RegisterOptions","type":"class"},{"id":"ember-4.12.1-Factory","type":"class"},{"id":"ember-4.12.1-FactoryManager","type":"class"},{"id":"ember-4.12.1-Resolver","type":"class"},{"id":"ember-4.12.1-Application","type":"class"},{"id":"ember-4.12.1-ApplicationInstance","type":"class"},{"id":"ember-4.12.1-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.12.1-Namespace","type":"class"},{"id":"ember-4.12.1-EmberArray","type":"class"},{"id":"ember-4.12.1-MutableArray","type":"class"},{"id":"ember-4.12.1-Ember.NativeArray","type":"class"},{"id":"ember-4.12.1-ArrayProxy","type":"class"},{"id":"ember-4.12.1-Ember.Controller","type":"class"},{"id":"ember-4.12.1-ContainerDebugAdapter","type":"class"},{"id":"ember-4.12.1-DataAdapter","type":"class"},{"id":"ember-4.12.1-Engine","type":"class"},{"id":"ember-4.12.1-EngineInstance","type":"class"},{"id":"ember-4.12.1-CoreObject","type":"class"},{"id":"ember-4.12.1-Evented","type":"class"},{"id":"ember-4.12.1-EmberObject","type":"class"},{"id":"ember-4.12.1-Mixin","type":"class"},{"id":"ember-4.12.1-Observable","type":"class"},{"id":"ember-4.12.1-PromiseProxyMixin","type":"class"},{"id":"ember-4.12.1-ObjectProxy","type":"class"},{"id":"ember-4.12.1-Renderer","type":"class"},{"id":"ember-4.12.1-HashLocation","type":"class"},{"id":"ember-4.12.1-HistoryLocation","type":"class"},{"id":"ember-4.12.1-NoneLocation","type":"class"},{"id":"ember-4.12.1-RouteInfo","type":"class"},{"id":"ember-4.12.1-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.12.1-Route","type":"class"},{"id":"ember-4.12.1-RouterService","type":"class"},{"id":"ember-4.12.1-EmberRouter","type":"class"},{"id":"ember-4.12.1-Transition","type":"class"},{"id":"ember-4.12.1-Service","type":"class"},{"id":"ember-4.12.1-TestAdapter","type":"class"},{"id":"ember-4.12.1-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.12.1-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.12.1-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.12.1-FEATURES","type":"namespace"},{"id":"ember-4.12.1-AutoLocation","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.12.1-ember","type":"module"},{"id":"ember-4.12.1-@ember/enumerable","type":"module"},{"id":"ember-4.12.1-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.12.1-rsvp","type":"module"},{"id":"ember-4.12.1-@ember/component","type":"module"},{"id":"ember-4.12.1-@ember/routing","type":"module"},{"id":"ember-4.12.1-@ember/template","type":"module"},{"id":"ember-4.12.1-@glimmer/component","type":"module"},{"id":"ember-4.12.1-@glimmer/tracking","type":"module"},{"id":"ember-4.12.1-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.12.1-@ember/object","type":"module"},{"id":"ember-4.12.1-@ember/owner","type":"module"},{"id":"ember-4.12.1-@ember/utils","type":"module"},{"id":"ember-4.12.1-@ember/application","type":"module"},{"id":"ember-4.12.1-@ember/application/namespace","type":"module"},{"id":"ember-4.12.1-@ember/array","type":"module"},{"id":"ember-4.12.1-@ember/array/proxy","type":"module"},{"id":"ember-4.12.1-@ember/canary-features","type":"module"},{"id":"ember-4.12.1-@ember/component/template-only","type":"module"},{"id":"ember-4.12.1-@ember/controller","type":"module"},{"id":"ember-4.12.1-@ember/debug","type":"module"},{"id":"ember-4.12.1-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.12.1-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.12.1-@ember/destroyable","type":"module"},{"id":"ember-4.12.1-@ember/engine","type":"module"},{"id":"ember-4.12.1-@ember/error","type":"module"},{"id":"ember-4.12.1-@ember/helper","type":"module"},{"id":"ember-4.12.1-@ember/object/core","type":"module"},{"id":"ember-4.12.1-@ember/object/evented","type":"module"},{"id":"ember-4.12.1-@ember/object/mixin","type":"module"},{"id":"ember-4.12.1-@ember/object/observable","type":"module"},{"id":"ember-4.12.1-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.12.1-@ember/object/proxy","type":"module"},{"id":"ember-4.12.1-@ember/polyfills","type":"module"},{"id":"ember-4.12.1-@ember/renderer","type":"module"},{"id":"ember-4.12.1-ember/routing","type":"module"},{"id":"ember-4.12.1-@ember/routing/auto-location","type":"module"},{"id":"ember-4.12.1-@ember/routing/hash-location","type":"module"},{"id":"ember-4.12.1-@ember/routing/history-location","type":"module"},{"id":"ember-4.12.1-@ember/routing/location","type":"module"},{"id":"ember-4.12.1-@ember/routing/none-location","type":"module"},{"id":"ember-4.12.1-@ember/routing/route-info","type":"module"},{"id":"ember-4.12.1-@ember/routing/route","type":"module"},{"id":"ember-4.12.1-@ember/routing/router-service","type":"module"},{"id":"ember-4.12.1-@ember/routing/router","type":"module"},{"id":"ember-4.12.1-@ember/routing/transition","type":"module"},{"id":"ember-4.12.1-@ember/runloop","type":"module"},{"id":"ember-4.12.1-@ember/service","type":"module"},{"id":"ember-4.12.1-@ember/string","type":"module"},{"id":"ember-4.12.1-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.12.1-Promise":"ember-4.12.1-Promise-54b7f198b8","ember-4.12.1-EventTarget":"ember-4.12.1-EventTarget-8bc312f28e","ember-4.12.1-Container":"ember-4.12.1-Container-ebacd7be32","ember-4.12.1-Registry":"ember-4.12.1-Registry-5bfb097b19","ember-4.12.1-EmberENV":"ember-4.12.1-EmberENV-e94d2c95ab","ember-4.12.1-Ember.Templates.helpers":"ember-4.12.1-Ember.Templates.helpers-bd36695ee7","ember-4.12.1-ComponentStateBucket":"ember-4.12.1-ComponentStateBucket-852941b0a1","ember-4.12.1-SafeString":"ember-4.12.1-SafeString-c2b3cb09f0","ember-4.12.1-Component":"ember-4.12.1-Component-1ea80e1741","ember-4.12.1-Helper":"ember-4.12.1-Helper-059161efac","ember-4.12.1-ComputedProperty":"ember-4.12.1-ComputedProperty-787ea57d5f","ember-4.12.1-Descriptor":"ember-4.12.1-Descriptor-88c6183c13","ember-4.12.1-Ember.InjectedProperty":"ember-4.12.1-Ember.InjectedProperty-a7d658de98","ember-4.12.1-Libraries":"ember-4.12.1-Libraries-51b68c8407","ember-4.12.1-FullName":"ember-4.12.1-FullName-c8c6cea4ac","ember-4.12.1-BasicRegistry":"ember-4.12.1-BasicRegistry-fbe8c9119c","ember-4.12.1-BasicContainer":"ember-4.12.1-BasicContainer-2474d54d7c","ember-4.12.1-Owner":"ember-4.12.1-Owner-aedacf9fef","ember-4.12.1-RegisterOptions":"ember-4.12.1-RegisterOptions-196aeb1d1c","ember-4.12.1-Factory":"ember-4.12.1-Factory-725219bfb6","ember-4.12.1-FactoryManager":"ember-4.12.1-FactoryManager-f4e3846f8a","ember-4.12.1-Resolver":"ember-4.12.1-Resolver-3ac28ae637","ember-4.12.1-InternalFactory":"ember-4.12.1-InternalFactory-7f1b3783fb","ember-4.12.1-ContainerProxy":"ember-4.12.1-ContainerProxy-c9dce3e98b","ember-4.12.1-RegistryProxy":"ember-4.12.1-RegistryProxy-b2dd073871","ember-4.12.1-Ember.ProxyMixin":"ember-4.12.1-Ember.ProxyMixin-f3c9f8406c","ember-4.12.1-Ember.ActionHandler":"ember-4.12.1-Ember.ActionHandler-0d6d68a9dd","ember-4.12.1-Ember.Comparable":"ember-4.12.1-Ember.Comparable-3afc2de3ee","ember-4.12.1-ContainerProxyMixin":"ember-4.12.1-ContainerProxyMixin-d884258c05","ember-4.12.1-RegistryProxyMixin":"ember-4.12.1-RegistryProxyMixin-868d2e7b30","ember-4.12.1-Ember.TargetActionSupport":"ember-4.12.1-Ember.TargetActionSupport-20f79aa3b5","ember-4.12.1-Ember.String":"ember-4.12.1-Ember.String-819b180df8","ember-4.12.1-Ember.ActionSupport":"ember-4.12.1-Ember.ActionSupport-9fd3130f31","ember-4.12.1-Ember.ClassNamesSupport":"ember-4.12.1-Ember.ClassNamesSupport-2eafff586d","ember-4.12.1-Ember.ViewMixin":"ember-4.12.1-Ember.ViewMixin-46fa3aa964","ember-4.12.1-Ember.EventDispatcher":"ember-4.12.1-Ember.EventDispatcher-47b31ebdf6","ember-4.12.1-Ember.CoreView":"ember-4.12.1-Ember.CoreView-d80819e982","ember-4.12.1-Application":"ember-4.12.1-Application-918c026414","ember-4.12.1-ApplicationInstance":"ember-4.12.1-ApplicationInstance-af788aa2af","ember-4.12.1-ApplicationInstance.BootOptions":"ember-4.12.1-ApplicationInstance.BootOptions-eb97f21167","ember-4.12.1-Namespace":"ember-4.12.1-Namespace-e6549a348e","ember-4.12.1-EmberArray":"ember-4.12.1-EmberArray-d54fcc05af","ember-4.12.1-MutableArray":"ember-4.12.1-MutableArray-35f7406660","ember-4.12.1-Ember.NativeArray":"ember-4.12.1-Ember.NativeArray-acfee2da3d","ember-4.12.1-ArrayProxy":"ember-4.12.1-ArrayProxy-823f753c72","ember-4.12.1-Ember.ControllerMixin":"ember-4.12.1-Ember.ControllerMixin-6e4eca0de4","ember-4.12.1-Ember.Controller":"ember-4.12.1-Ember.Controller-389d43a0cf","ember-4.12.1-ContainerDebugAdapter":"ember-4.12.1-ContainerDebugAdapter-5c4635111e","ember-4.12.1-DataAdapter":"ember-4.12.1-DataAdapter-58971af5b8","ember-4.12.1-Engine":"ember-4.12.1-Engine-c383b2450f","ember-4.12.1-EngineInstance":"ember-4.12.1-EngineInstance-9f0950c34b","ember-4.12.1-Enumerable":"ember-4.12.1-Enumerable-1c3b7ce2a3","ember-4.12.1-Ember.MutableEnumerable":"ember-4.12.1-Ember.MutableEnumerable-c496da316d","ember-4.12.1-Ember.Error":"ember-4.12.1-Ember.Error-2386d3ba55","ember-4.12.1-CoreObject":"ember-4.12.1-CoreObject-a39201c892","ember-4.12.1-Evented":"ember-4.12.1-Evented-bcafa1960a","ember-4.12.1-EmberObject":"ember-4.12.1-EmberObject-178a2fab55","ember-4.12.1-Mixin":"ember-4.12.1-Mixin-56bf58a3a0","ember-4.12.1-Observable":"ember-4.12.1-Observable-e947bd4474","ember-4.12.1-PromiseProxyMixin":"ember-4.12.1-PromiseProxyMixin-ff42e92ffd","ember-4.12.1-ObjectProxy":"ember-4.12.1-ObjectProxy-bb88de3038","ember-4.12.1-Renderer":"ember-4.12.1-Renderer-37c8acf81b","ember-4.12.1-BucketCache":"ember-4.12.1-BucketCache-b83769154c","ember-4.12.1-RoutingService":"ember-4.12.1-RoutingService-4482645bf2","ember-4.12.1-HashLocation":"ember-4.12.1-HashLocation-ddafe3a3a6","ember-4.12.1-HistoryLocation":"ember-4.12.1-HistoryLocation-d91fd1935a","ember-4.12.1-Location":"ember-4.12.1-Location-ede9e1e60f","ember-4.12.1-NoneLocation":"ember-4.12.1-NoneLocation-52ec6b840a","ember-4.12.1-RouteInfo":"ember-4.12.1-RouteInfo-74ccc9cae0","ember-4.12.1-RouteInfoWithAttributes":"ember-4.12.1-RouteInfoWithAttributes-21b8b9330c","ember-4.12.1-Route":"ember-4.12.1-Route-f37356a011","ember-4.12.1-RouterService":"ember-4.12.1-RouterService-fdf945c5c4","ember-4.12.1-EmberRouter":"ember-4.12.1-EmberRouter-88c5f2ab3a","ember-4.12.1-Transition":"ember-4.12.1-Transition-60184af5dd","ember-4.12.1-Service":"ember-4.12.1-Service-296af98ef7","ember-4.12.1-String":"ember-4.12.1-String-41f2d40414","ember-4.12.1-TestAdapter":"ember-4.12.1-TestAdapter-c71010b042","ember-4.12.1-Ember.Test.QUnitAdapter":"ember-4.12.1-Ember.Test.QUnitAdapter-8ad90f80b9","ember-4.12.1-Ember.Test":"ember-4.12.1-Ember.Test-9796ffa389","ember-4.12.1-Ember":"ember-4.12.1-Ember-9d704ab923","ember-4.12.1-Ember.Templates.components":"ember-4.12.1-Ember.Templates.components-2b8ad12ec2","ember-4.12.1-rsvp":"ember-4.12.1-rsvp-2b4998f7ea","ember-4.12.1-@ember/application":"ember-4.12.1-@ember/application-c977ee6794","ember-4.12.1-@ember/array":"ember-4.12.1-@ember/array-0f6574653d","ember-4.12.1-@ember/component":"ember-4.12.1-@ember/component-f80a72fc72","ember-4.12.1-@ember/component/helper":"ember-4.12.1-@ember/component/helper-4b0e2cdd75","ember-4.12.1-@ember/component/template-only":"ember-4.12.1-@ember/component/template-only-348f94d828","ember-4.12.1-@ember/debug":"ember-4.12.1-@ember/debug-d4c8570053","ember-4.12.1-@ember/destroyable":"ember-4.12.1-@ember/destroyable-308a93840c","ember-4.12.1-@ember/engine":"ember-4.12.1-@ember/engine-704febb64e","ember-4.12.1-@ember/helper":"ember-4.12.1-@ember/helper-ef9de90d8d","ember-4.12.1-@ember/instrumentation":"ember-4.12.1-@ember/instrumentation-4652eb7619","ember-4.12.1-@ember/object":"ember-4.12.1-@ember/object-603c9f7dc3","ember-4.12.1-@ember/object/compat":"ember-4.12.1-@ember/object/compat-2096008353","ember-4.12.1-@ember/object/computed":"ember-4.12.1-@ember/object/computed-d3cb7b2a2b","ember-4.12.1-@ember/object/evented":"ember-4.12.1-@ember/object/evented-3b046e4e25","ember-4.12.1-@ember/object/events":"ember-4.12.1-@ember/object/events-abb640cda3","ember-4.12.1-@ember/object/internals":"ember-4.12.1-@ember/object/internals-5d46ce6d31","ember-4.12.1-@ember/object/mixin":"ember-4.12.1-@ember/object/mixin-4472f02df3","ember-4.12.1-@ember/object/observers":"ember-4.12.1-@ember/object/observers-9eba8387c2","ember-4.12.1-@ember/owner":"ember-4.12.1-@ember/owner-6a4fedbee5","ember-4.12.1-@ember/polyfills":"ember-4.12.1-@ember/polyfills-3d9508e94f","ember-4.12.1-@ember/routing":"ember-4.12.1-@ember/routing-c17e7697fb","ember-4.12.1-@ember/runloop":"ember-4.12.1-@ember/runloop-c5b2144f6a","ember-4.12.1-@ember/service":"ember-4.12.1-@ember/service-57bffdefe8","ember-4.12.1-@ember/template":"ember-4.12.1-@ember/template-98ee6ab267","ember-4.12.1-@ember/test":"ember-4.12.1-@ember/test-1fd8caf21c","ember-4.12.1-@ember/utils":"ember-4.12.1-@ember/utils-70146b5648","ember-4.12.1-@glimmer/tracking":"ember-4.12.1-@glimmer/tracking-5d6bf95268","ember-4.12.1-@glimmer/tracking/primitives/cache":"ember-4.12.1-@glimmer/tracking/primitives/cache-4c37a858a5","ember-4.12.1-Ember.@ember/controller":"ember-4.12.1-Ember.@ember/controller-d0732a0a6d"},"namespace":{"ember-4.12.1-FEATURES":"ember-4.12.1-FEATURES-0042eb5583","ember-4.12.1-Instrumentation":"ember-4.12.1-Instrumentation-15d3fa04c8","ember-4.12.1-AutoLocation":"ember-4.12.1-AutoLocation-9b0646baf8"},"module":{"ember-4.12.1-rsvp":"ember-4.12.1-rsvp-00ae08689e","ember-4.12.1-@ember/component":"ember-4.12.1-@ember/component-e42655d49a","ember-4.12.1-@ember/routing":"ember-4.12.1-@ember/routing-453023ea1b","ember-4.12.1-ember":"ember-4.12.1-ember-1360ed6169","ember-4.12.1-@ember/template":"ember-4.12.1-@ember/template-d4ddc419da","ember-4.12.1-@glimmer/component":"ember-4.12.1-@glimmer/component-9ec1618899","ember-4.12.1-@glimmer/tracking":"ember-4.12.1-@glimmer/tracking-5eedc88056","ember-4.12.1-@glimmer/tracking/primitives/cache":"ember-4.12.1-@glimmer/tracking/primitives/cache-f7675fd721","ember-4.12.1-@ember/object":"ember-4.12.1-@ember/object-df7d456228","ember-4.12.1-@ember/owner":"ember-4.12.1-@ember/owner-b1ec9934cb","ember-4.12.1-@ember/utils":"ember-4.12.1-@ember/utils-4cbbce5ae6","ember-4.12.1-@ember/application":"ember-4.12.1-@ember/application-57400f0f42","ember-4.12.1-@ember/application/namespace":"ember-4.12.1-@ember/application/namespace-df0f3ba35e","ember-4.12.1-@ember/array":"ember-4.12.1-@ember/array-c167d6802e","ember-4.12.1-@ember/array/proxy":"ember-4.12.1-@ember/array/proxy-db3b2da21c","ember-4.12.1-@ember/canary-features":"ember-4.12.1-@ember/canary-features-069bae3d06","ember-4.12.1-@ember/component/template-only":"ember-4.12.1-@ember/component/template-only-e09c18502f","ember-4.12.1-@ember/controller":"ember-4.12.1-@ember/controller-056ef2f915","ember-4.12.1-@ember/debug":"ember-4.12.1-@ember/debug-245ec65767","ember-4.12.1-@ember/debug/container-debug-adapter":"ember-4.12.1-@ember/debug/container-debug-adapter-cb265689c5","ember-4.12.1-@ember/debug/data-adapter":"ember-4.12.1-@ember/debug/data-adapter-49c4b28104","ember-4.12.1-@ember/destroyable":"ember-4.12.1-@ember/destroyable-532511959e","ember-4.12.1-@ember/engine":"ember-4.12.1-@ember/engine-a6e6ef870b","ember-4.12.1-@ember/enumerable":"ember-4.12.1-@ember/enumerable-e932195429","ember-4.12.1-@ember/error":"ember-4.12.1-@ember/error-d624fe1f49","ember-4.12.1-@ember/helper":"ember-4.12.1-@ember/helper-40c49fd4b6","ember-4.12.1-@ember/instrumentation":"ember-4.12.1-@ember/instrumentation-fe2dba7365","ember-4.12.1-@ember/object/core":"ember-4.12.1-@ember/object/core-792bc42d55","ember-4.12.1-@ember/object/evented":"ember-4.12.1-@ember/object/evented-84a6839f92","ember-4.12.1-@ember/object/mixin":"ember-4.12.1-@ember/object/mixin-6cd1ccee01","ember-4.12.1-@ember/object/observable":"ember-4.12.1-@ember/object/observable-a55837e659","ember-4.12.1-@ember/object/promise-proxy-mixin":"ember-4.12.1-@ember/object/promise-proxy-mixin-46b6520087","ember-4.12.1-@ember/object/proxy":"ember-4.12.1-@ember/object/proxy-45895b596c","ember-4.12.1-@ember/polyfills":"ember-4.12.1-@ember/polyfills-3e97a51770","ember-4.12.1-@ember/renderer":"ember-4.12.1-@ember/renderer-0308badd1d","ember-4.12.1-ember/routing":"ember-4.12.1-ember/routing-d1ae3422cb","ember-4.12.1-@ember/routing/auto-location":"ember-4.12.1-@ember/routing/auto-location-16551661ec","ember-4.12.1-@ember/routing/hash-location":"ember-4.12.1-@ember/routing/hash-location-2f69885701","ember-4.12.1-@ember/routing/history-location":"ember-4.12.1-@ember/routing/history-location-0a4793b8b8","ember-4.12.1-@ember/routing/location":"ember-4.12.1-@ember/routing/location-f23c0262ca","ember-4.12.1-@ember/routing/none-location":"ember-4.12.1-@ember/routing/none-location-17b09544e3","ember-4.12.1-@ember/routing/route-info":"ember-4.12.1-@ember/routing/route-info-f7e76b8e3c","ember-4.12.1-@ember/routing/route":"ember-4.12.1-@ember/routing/route-173cfaf337","ember-4.12.1-@ember/routing/router-service":"ember-4.12.1-@ember/routing/router-service-2f3cce023f","ember-4.12.1-@ember/routing/router":"ember-4.12.1-@ember/routing/router-1a60cd1a33","ember-4.12.1-@ember/routing/transition":"ember-4.12.1-@ember/routing/transition-c7f7552260","ember-4.12.1-@ember/runloop":"ember-4.12.1-@ember/runloop-e62a37f5ee","ember-4.12.1-@ember/service":"ember-4.12.1-@ember/service-7ed5b7958d","ember-4.12.1-@ember/string":"ember-4.12.1-@ember/string-ea4ac6dc50","ember-4.12.1-@ember/test":"ember-4.12.1-@ember/test-6aaddcc6b9"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Error":"Error-158974c414"}}} \ No newline at end of file diff --git a/rev-index/ember-4.12.3.json b/rev-index/ember-4.12.3.json new file mode 100644 index 000000000..e4e91a506 --- /dev/null +++ b/rev-index/ember-4.12.3.json @@ -0,0 +1 @@ +{"data":{"id":"ember-4.12.3","type":"project-version","attributes":{"version":"4.12.3"},"relationships":{"classes":{"data":[{"id":"ember-4.12.3-Promise","type":"class"},{"id":"ember-4.12.3-EventTarget","type":"class"},{"id":"ember-4.12.3-Container","type":"class"},{"id":"ember-4.12.3-Registry","type":"class"},{"id":"ember-4.12.3-EmberENV","type":"class"},{"id":"ember-4.12.3-Ember.Templates.helpers","type":"class"},{"id":"ember-4.12.3-ComponentStateBucket","type":"class"},{"id":"ember-4.12.3-SafeString","type":"class"},{"id":"ember-4.12.3-Component","type":"class"},{"id":"ember-4.12.3-Helper","type":"class"},{"id":"ember-4.12.3-ComputedProperty","type":"class"},{"id":"ember-4.12.3-Descriptor","type":"class"},{"id":"ember-4.12.3-Ember.InjectedProperty","type":"class"},{"id":"ember-4.12.3-Libraries","type":"class"},{"id":"ember-4.12.3-FullName","type":"class"},{"id":"ember-4.12.3-BasicRegistry","type":"class"},{"id":"ember-4.12.3-BasicContainer","type":"class"},{"id":"ember-4.12.3-Owner","type":"class"},{"id":"ember-4.12.3-RegisterOptions","type":"class"},{"id":"ember-4.12.3-Factory","type":"class"},{"id":"ember-4.12.3-FactoryManager","type":"class"},{"id":"ember-4.12.3-Resolver","type":"class"},{"id":"ember-4.12.3-InternalFactory","type":"class"},{"id":"ember-4.12.3-ContainerProxy","type":"class"},{"id":"ember-4.12.3-RegistryProxy","type":"class"},{"id":"ember-4.12.3-Ember.ProxyMixin","type":"class"},{"id":"ember-4.12.3-Ember.ActionHandler","type":"class"},{"id":"ember-4.12.3-Ember.Comparable","type":"class"},{"id":"ember-4.12.3-ContainerProxyMixin","type":"class"},{"id":"ember-4.12.3-RegistryProxyMixin","type":"class"},{"id":"ember-4.12.3-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.12.3-Ember.String","type":"class"},{"id":"ember-4.12.3-Ember.ActionSupport","type":"class"},{"id":"ember-4.12.3-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.12.3-Ember.ViewMixin","type":"class"},{"id":"ember-4.12.3-Ember.EventDispatcher","type":"class"},{"id":"ember-4.12.3-Ember.CoreView","type":"class"},{"id":"ember-4.12.3-Application","type":"class"},{"id":"ember-4.12.3-ApplicationInstance","type":"class"},{"id":"ember-4.12.3-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.12.3-Namespace","type":"class"},{"id":"ember-4.12.3-EmberArray","type":"class"},{"id":"ember-4.12.3-MutableArray","type":"class"},{"id":"ember-4.12.3-Ember.NativeArray","type":"class"},{"id":"ember-4.12.3-ArrayProxy","type":"class"},{"id":"ember-4.12.3-Ember.ControllerMixin","type":"class"},{"id":"ember-4.12.3-Ember.Controller","type":"class"},{"id":"ember-4.12.3-ContainerDebugAdapter","type":"class"},{"id":"ember-4.12.3-DataAdapter","type":"class"},{"id":"ember-4.12.3-Engine","type":"class"},{"id":"ember-4.12.3-EngineInstance","type":"class"},{"id":"ember-4.12.3-Enumerable","type":"class"},{"id":"ember-4.12.3-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.12.3-Ember.Error","type":"class"},{"id":"ember-4.12.3-CoreObject","type":"class"},{"id":"ember-4.12.3-Evented","type":"class"},{"id":"ember-4.12.3-EmberObject","type":"class"},{"id":"ember-4.12.3-Mixin","type":"class"},{"id":"ember-4.12.3-Observable","type":"class"},{"id":"ember-4.12.3-PromiseProxyMixin","type":"class"},{"id":"ember-4.12.3-ObjectProxy","type":"class"},{"id":"ember-4.12.3-Renderer","type":"class"},{"id":"ember-4.12.3-BucketCache","type":"class"},{"id":"ember-4.12.3-RoutingService","type":"class"},{"id":"ember-4.12.3-HashLocation","type":"class"},{"id":"ember-4.12.3-HistoryLocation","type":"class"},{"id":"ember-4.12.3-Location","type":"class"},{"id":"ember-4.12.3-NoneLocation","type":"class"},{"id":"ember-4.12.3-RouteInfo","type":"class"},{"id":"ember-4.12.3-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.12.3-Route","type":"class"},{"id":"ember-4.12.3-RouterService","type":"class"},{"id":"ember-4.12.3-EmberRouter","type":"class"},{"id":"ember-4.12.3-Transition","type":"class"},{"id":"ember-4.12.3-Service","type":"class"},{"id":"ember-4.12.3-String","type":"class"},{"id":"ember-4.12.3-TestAdapter","type":"class"},{"id":"ember-4.12.3-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.12.3-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.12.3-FEATURES","type":"namespace"},{"id":"ember-4.12.3-Instrumentation","type":"namespace"},{"id":"ember-4.12.3-AutoLocation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.12.3-rsvp","type":"module"},{"id":"ember-4.12.3-@ember/component","type":"module"},{"id":"ember-4.12.3-@ember/routing","type":"module"},{"id":"ember-4.12.3-ember","type":"module"},{"id":"ember-4.12.3-@ember/template","type":"module"},{"id":"ember-4.12.3-@glimmer/component","type":"module"},{"id":"ember-4.12.3-@glimmer/tracking","type":"module"},{"id":"ember-4.12.3-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.12.3-@ember/object","type":"module"},{"id":"ember-4.12.3-@ember/owner","type":"module"},{"id":"ember-4.12.3-@ember/utils","type":"module"},{"id":"ember-4.12.3-@ember/application","type":"module"},{"id":"ember-4.12.3-@ember/application/namespace","type":"module"},{"id":"ember-4.12.3-@ember/array","type":"module"},{"id":"ember-4.12.3-@ember/array/proxy","type":"module"},{"id":"ember-4.12.3-@ember/canary-features","type":"module"},{"id":"ember-4.12.3-@ember/component/template-only","type":"module"},{"id":"ember-4.12.3-@ember/controller","type":"module"},{"id":"ember-4.12.3-@ember/debug","type":"module"},{"id":"ember-4.12.3-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.12.3-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.12.3-@ember/destroyable","type":"module"},{"id":"ember-4.12.3-@ember/engine","type":"module"},{"id":"ember-4.12.3-@ember/enumerable","type":"module"},{"id":"ember-4.12.3-@ember/error","type":"module"},{"id":"ember-4.12.3-@ember/helper","type":"module"},{"id":"ember-4.12.3-@ember/instrumentation","type":"module"},{"id":"ember-4.12.3-@ember/object/core","type":"module"},{"id":"ember-4.12.3-@ember/object/evented","type":"module"},{"id":"ember-4.12.3-@ember/object/mixin","type":"module"},{"id":"ember-4.12.3-@ember/object/observable","type":"module"},{"id":"ember-4.12.3-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.12.3-@ember/object/proxy","type":"module"},{"id":"ember-4.12.3-@ember/polyfills","type":"module"},{"id":"ember-4.12.3-@ember/renderer","type":"module"},{"id":"ember-4.12.3-ember/routing","type":"module"},{"id":"ember-4.12.3-@ember/routing/auto-location","type":"module"},{"id":"ember-4.12.3-@ember/routing/hash-location","type":"module"},{"id":"ember-4.12.3-@ember/routing/history-location","type":"module"},{"id":"ember-4.12.3-@ember/routing/location","type":"module"},{"id":"ember-4.12.3-@ember/routing/none-location","type":"module"},{"id":"ember-4.12.3-@ember/routing/route-info","type":"module"},{"id":"ember-4.12.3-@ember/routing/route","type":"module"},{"id":"ember-4.12.3-@ember/routing/router-service","type":"module"},{"id":"ember-4.12.3-@ember/routing/router","type":"module"},{"id":"ember-4.12.3-@ember/routing/transition","type":"module"},{"id":"ember-4.12.3-@ember/runloop","type":"module"},{"id":"ember-4.12.3-@ember/service","type":"module"},{"id":"ember-4.12.3-@ember/string","type":"module"},{"id":"ember-4.12.3-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.12.3-Container","type":"class"},{"id":"ember-4.12.3-Registry","type":"class"},{"id":"ember-4.12.3-ComponentStateBucket","type":"class"},{"id":"ember-4.12.3-Descriptor","type":"class"},{"id":"ember-4.12.3-Ember.InjectedProperty","type":"class"},{"id":"ember-4.12.3-Libraries","type":"class"},{"id":"ember-4.12.3-BasicRegistry","type":"class"},{"id":"ember-4.12.3-BasicContainer","type":"class"},{"id":"ember-4.12.3-InternalFactory","type":"class"},{"id":"ember-4.12.3-ContainerProxy","type":"class"},{"id":"ember-4.12.3-RegistryProxy","type":"class"},{"id":"ember-4.12.3-Ember.ProxyMixin","type":"class"},{"id":"ember-4.12.3-Ember.ActionHandler","type":"class"},{"id":"ember-4.12.3-Ember.Comparable","type":"class"},{"id":"ember-4.12.3-ContainerProxyMixin","type":"class"},{"id":"ember-4.12.3-RegistryProxyMixin","type":"class"},{"id":"ember-4.12.3-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.12.3-Ember.String","type":"class"},{"id":"ember-4.12.3-Ember.ActionSupport","type":"class"},{"id":"ember-4.12.3-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.12.3-Ember.ViewMixin","type":"class"},{"id":"ember-4.12.3-Ember.EventDispatcher","type":"class"},{"id":"ember-4.12.3-Ember.CoreView","type":"class"},{"id":"ember-4.12.3-Ember.ControllerMixin","type":"class"},{"id":"ember-4.12.3-Enumerable","type":"class"},{"id":"ember-4.12.3-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.12.3-Ember.Error","type":"class"},{"id":"ember-4.12.3-BucketCache","type":"class"},{"id":"ember-4.12.3-RoutingService","type":"class"},{"id":"ember-4.12.3-Location","type":"class"},{"id":"ember-4.12.3-String","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.12.3-Promise","type":"class"},{"id":"ember-4.12.3-EventTarget","type":"class"},{"id":"ember-4.12.3-EmberENV","type":"class"},{"id":"ember-4.12.3-Ember.Templates.helpers","type":"class"},{"id":"ember-4.12.3-SafeString","type":"class"},{"id":"ember-4.12.3-Component","type":"class"},{"id":"ember-4.12.3-Helper","type":"class"},{"id":"ember-4.12.3-ComputedProperty","type":"class"},{"id":"ember-4.12.3-FullName","type":"class"},{"id":"ember-4.12.3-Owner","type":"class"},{"id":"ember-4.12.3-RegisterOptions","type":"class"},{"id":"ember-4.12.3-Factory","type":"class"},{"id":"ember-4.12.3-FactoryManager","type":"class"},{"id":"ember-4.12.3-Resolver","type":"class"},{"id":"ember-4.12.3-Application","type":"class"},{"id":"ember-4.12.3-ApplicationInstance","type":"class"},{"id":"ember-4.12.3-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.12.3-Namespace","type":"class"},{"id":"ember-4.12.3-EmberArray","type":"class"},{"id":"ember-4.12.3-MutableArray","type":"class"},{"id":"ember-4.12.3-Ember.NativeArray","type":"class"},{"id":"ember-4.12.3-ArrayProxy","type":"class"},{"id":"ember-4.12.3-Ember.Controller","type":"class"},{"id":"ember-4.12.3-ContainerDebugAdapter","type":"class"},{"id":"ember-4.12.3-DataAdapter","type":"class"},{"id":"ember-4.12.3-Engine","type":"class"},{"id":"ember-4.12.3-EngineInstance","type":"class"},{"id":"ember-4.12.3-CoreObject","type":"class"},{"id":"ember-4.12.3-Evented","type":"class"},{"id":"ember-4.12.3-EmberObject","type":"class"},{"id":"ember-4.12.3-Mixin","type":"class"},{"id":"ember-4.12.3-Observable","type":"class"},{"id":"ember-4.12.3-PromiseProxyMixin","type":"class"},{"id":"ember-4.12.3-ObjectProxy","type":"class"},{"id":"ember-4.12.3-Renderer","type":"class"},{"id":"ember-4.12.3-HashLocation","type":"class"},{"id":"ember-4.12.3-HistoryLocation","type":"class"},{"id":"ember-4.12.3-NoneLocation","type":"class"},{"id":"ember-4.12.3-RouteInfo","type":"class"},{"id":"ember-4.12.3-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.12.3-Route","type":"class"},{"id":"ember-4.12.3-RouterService","type":"class"},{"id":"ember-4.12.3-EmberRouter","type":"class"},{"id":"ember-4.12.3-Transition","type":"class"},{"id":"ember-4.12.3-Service","type":"class"},{"id":"ember-4.12.3-TestAdapter","type":"class"},{"id":"ember-4.12.3-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.12.3-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.12.3-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.12.3-FEATURES","type":"namespace"},{"id":"ember-4.12.3-AutoLocation","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.12.3-ember","type":"module"},{"id":"ember-4.12.3-@ember/enumerable","type":"module"},{"id":"ember-4.12.3-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.12.3-rsvp","type":"module"},{"id":"ember-4.12.3-@ember/component","type":"module"},{"id":"ember-4.12.3-@ember/routing","type":"module"},{"id":"ember-4.12.3-@ember/template","type":"module"},{"id":"ember-4.12.3-@glimmer/component","type":"module"},{"id":"ember-4.12.3-@glimmer/tracking","type":"module"},{"id":"ember-4.12.3-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.12.3-@ember/object","type":"module"},{"id":"ember-4.12.3-@ember/owner","type":"module"},{"id":"ember-4.12.3-@ember/utils","type":"module"},{"id":"ember-4.12.3-@ember/application","type":"module"},{"id":"ember-4.12.3-@ember/application/namespace","type":"module"},{"id":"ember-4.12.3-@ember/array","type":"module"},{"id":"ember-4.12.3-@ember/array/proxy","type":"module"},{"id":"ember-4.12.3-@ember/canary-features","type":"module"},{"id":"ember-4.12.3-@ember/component/template-only","type":"module"},{"id":"ember-4.12.3-@ember/controller","type":"module"},{"id":"ember-4.12.3-@ember/debug","type":"module"},{"id":"ember-4.12.3-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.12.3-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.12.3-@ember/destroyable","type":"module"},{"id":"ember-4.12.3-@ember/engine","type":"module"},{"id":"ember-4.12.3-@ember/error","type":"module"},{"id":"ember-4.12.3-@ember/helper","type":"module"},{"id":"ember-4.12.3-@ember/object/core","type":"module"},{"id":"ember-4.12.3-@ember/object/evented","type":"module"},{"id":"ember-4.12.3-@ember/object/mixin","type":"module"},{"id":"ember-4.12.3-@ember/object/observable","type":"module"},{"id":"ember-4.12.3-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.12.3-@ember/object/proxy","type":"module"},{"id":"ember-4.12.3-@ember/polyfills","type":"module"},{"id":"ember-4.12.3-@ember/renderer","type":"module"},{"id":"ember-4.12.3-ember/routing","type":"module"},{"id":"ember-4.12.3-@ember/routing/auto-location","type":"module"},{"id":"ember-4.12.3-@ember/routing/hash-location","type":"module"},{"id":"ember-4.12.3-@ember/routing/history-location","type":"module"},{"id":"ember-4.12.3-@ember/routing/location","type":"module"},{"id":"ember-4.12.3-@ember/routing/none-location","type":"module"},{"id":"ember-4.12.3-@ember/routing/route-info","type":"module"},{"id":"ember-4.12.3-@ember/routing/route","type":"module"},{"id":"ember-4.12.3-@ember/routing/router-service","type":"module"},{"id":"ember-4.12.3-@ember/routing/router","type":"module"},{"id":"ember-4.12.3-@ember/routing/transition","type":"module"},{"id":"ember-4.12.3-@ember/runloop","type":"module"},{"id":"ember-4.12.3-@ember/service","type":"module"},{"id":"ember-4.12.3-@ember/string","type":"module"},{"id":"ember-4.12.3-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.12.3-Promise":"ember-4.12.3-Promise-8f7668eb20","ember-4.12.3-EventTarget":"ember-4.12.3-EventTarget-fa52075556","ember-4.12.3-Container":"ember-4.12.3-Container-976f9da7fb","ember-4.12.3-Registry":"ember-4.12.3-Registry-78990188bb","ember-4.12.3-EmberENV":"ember-4.12.3-EmberENV-5f5dc8ea0d","ember-4.12.3-Ember.Templates.helpers":"ember-4.12.3-Ember.Templates.helpers-7c08d25ebe","ember-4.12.3-ComponentStateBucket":"ember-4.12.3-ComponentStateBucket-a4bbf559ac","ember-4.12.3-SafeString":"ember-4.12.3-SafeString-01ff1278b3","ember-4.12.3-Component":"ember-4.12.3-Component-2955549b6a","ember-4.12.3-Helper":"ember-4.12.3-Helper-1bd43a0c71","ember-4.12.3-ComputedProperty":"ember-4.12.3-ComputedProperty-4fd201aa95","ember-4.12.3-Descriptor":"ember-4.12.3-Descriptor-0259090ac1","ember-4.12.3-Ember.InjectedProperty":"ember-4.12.3-Ember.InjectedProperty-1d5e957153","ember-4.12.3-Libraries":"ember-4.12.3-Libraries-72485f5ef6","ember-4.12.3-FullName":"ember-4.12.3-FullName-fc1f9753a8","ember-4.12.3-BasicRegistry":"ember-4.12.3-BasicRegistry-897c533361","ember-4.12.3-BasicContainer":"ember-4.12.3-BasicContainer-a6f6a1c3f3","ember-4.12.3-Owner":"ember-4.12.3-Owner-f2bae50a77","ember-4.12.3-RegisterOptions":"ember-4.12.3-RegisterOptions-cbf1f2924d","ember-4.12.3-Factory":"ember-4.12.3-Factory-a48a43ea55","ember-4.12.3-FactoryManager":"ember-4.12.3-FactoryManager-1d8e4e89d5","ember-4.12.3-Resolver":"ember-4.12.3-Resolver-f43131415d","ember-4.12.3-InternalFactory":"ember-4.12.3-InternalFactory-ac20dd88d3","ember-4.12.3-ContainerProxy":"ember-4.12.3-ContainerProxy-5cbf744615","ember-4.12.3-RegistryProxy":"ember-4.12.3-RegistryProxy-a3d8a2b083","ember-4.12.3-Ember.ProxyMixin":"ember-4.12.3-Ember.ProxyMixin-48486132e0","ember-4.12.3-Ember.ActionHandler":"ember-4.12.3-Ember.ActionHandler-704f4c1f54","ember-4.12.3-Ember.Comparable":"ember-4.12.3-Ember.Comparable-da46e01091","ember-4.12.3-ContainerProxyMixin":"ember-4.12.3-ContainerProxyMixin-a69e3e8823","ember-4.12.3-RegistryProxyMixin":"ember-4.12.3-RegistryProxyMixin-5529c2d05f","ember-4.12.3-Ember.TargetActionSupport":"ember-4.12.3-Ember.TargetActionSupport-127139bc9d","ember-4.12.3-Ember.String":"ember-4.12.3-Ember.String-d46664855b","ember-4.12.3-Ember.ActionSupport":"ember-4.12.3-Ember.ActionSupport-341f9b66b9","ember-4.12.3-Ember.ClassNamesSupport":"ember-4.12.3-Ember.ClassNamesSupport-23c430e31e","ember-4.12.3-Ember.ViewMixin":"ember-4.12.3-Ember.ViewMixin-a283d3abfb","ember-4.12.3-Ember.EventDispatcher":"ember-4.12.3-Ember.EventDispatcher-c06bf46659","ember-4.12.3-Ember.CoreView":"ember-4.12.3-Ember.CoreView-e98e7e5cc7","ember-4.12.3-Application":"ember-4.12.3-Application-7ce49e55b4","ember-4.12.3-ApplicationInstance":"ember-4.12.3-ApplicationInstance-d387569d70","ember-4.12.3-ApplicationInstance.BootOptions":"ember-4.12.3-ApplicationInstance.BootOptions-f46f614d20","ember-4.12.3-Namespace":"ember-4.12.3-Namespace-78c4c6fa96","ember-4.12.3-EmberArray":"ember-4.12.3-EmberArray-16725cadd3","ember-4.12.3-MutableArray":"ember-4.12.3-MutableArray-d65a595923","ember-4.12.3-Ember.NativeArray":"ember-4.12.3-Ember.NativeArray-ad6f5979c2","ember-4.12.3-ArrayProxy":"ember-4.12.3-ArrayProxy-701dffffbd","ember-4.12.3-Ember.ControllerMixin":"ember-4.12.3-Ember.ControllerMixin-14e882ed75","ember-4.12.3-Ember.Controller":"ember-4.12.3-Ember.Controller-a2f9ae6cde","ember-4.12.3-ContainerDebugAdapter":"ember-4.12.3-ContainerDebugAdapter-4f3d85db1d","ember-4.12.3-DataAdapter":"ember-4.12.3-DataAdapter-4a8e940600","ember-4.12.3-Engine":"ember-4.12.3-Engine-cf71feddc8","ember-4.12.3-EngineInstance":"ember-4.12.3-EngineInstance-c21786e656","ember-4.12.3-Enumerable":"ember-4.12.3-Enumerable-812f883494","ember-4.12.3-Ember.MutableEnumerable":"ember-4.12.3-Ember.MutableEnumerable-76efe79b36","ember-4.12.3-Ember.Error":"ember-4.12.3-Ember.Error-9b4e80b255","ember-4.12.3-CoreObject":"ember-4.12.3-CoreObject-3f8bc3ffb3","ember-4.12.3-Evented":"ember-4.12.3-Evented-0baf9ee6ca","ember-4.12.3-EmberObject":"ember-4.12.3-EmberObject-4e3e58a56d","ember-4.12.3-Mixin":"ember-4.12.3-Mixin-3d2c2aed70","ember-4.12.3-Observable":"ember-4.12.3-Observable-7750ff3350","ember-4.12.3-PromiseProxyMixin":"ember-4.12.3-PromiseProxyMixin-2662b79cdb","ember-4.12.3-ObjectProxy":"ember-4.12.3-ObjectProxy-eceaadb77a","ember-4.12.3-Renderer":"ember-4.12.3-Renderer-ef9f25c1f4","ember-4.12.3-BucketCache":"ember-4.12.3-BucketCache-81e32bfa6d","ember-4.12.3-RoutingService":"ember-4.12.3-RoutingService-bd9a0542e6","ember-4.12.3-HashLocation":"ember-4.12.3-HashLocation-c0a25a4587","ember-4.12.3-HistoryLocation":"ember-4.12.3-HistoryLocation-a619e9b94b","ember-4.12.3-Location":"ember-4.12.3-Location-fc9393f301","ember-4.12.3-NoneLocation":"ember-4.12.3-NoneLocation-c532184e35","ember-4.12.3-RouteInfo":"ember-4.12.3-RouteInfo-3c6b11f6e3","ember-4.12.3-RouteInfoWithAttributes":"ember-4.12.3-RouteInfoWithAttributes-fedba4b1b8","ember-4.12.3-Route":"ember-4.12.3-Route-5a50fd966f","ember-4.12.3-RouterService":"ember-4.12.3-RouterService-271bea0a44","ember-4.12.3-EmberRouter":"ember-4.12.3-EmberRouter-130fff02b5","ember-4.12.3-Transition":"ember-4.12.3-Transition-960d23580e","ember-4.12.3-Service":"ember-4.12.3-Service-40844a28a1","ember-4.12.3-String":"ember-4.12.3-String-08b5bad3c1","ember-4.12.3-TestAdapter":"ember-4.12.3-TestAdapter-0758b2d19b","ember-4.12.3-Ember.Test.QUnitAdapter":"ember-4.12.3-Ember.Test.QUnitAdapter-d984751a16","ember-4.12.3-Ember.Test":"ember-4.12.3-Ember.Test-8f3fbcf922","ember-4.12.3-Ember":"ember-4.12.3-Ember-cf9a032bf3","ember-4.12.3-Ember.Templates.components":"ember-4.12.3-Ember.Templates.components-687d6d8e13","ember-4.12.3-rsvp":"ember-4.12.3-rsvp-5dff387a76","ember-4.12.3-@ember/application":"ember-4.12.3-@ember/application-b0060415b4","ember-4.12.3-@ember/array":"ember-4.12.3-@ember/array-77f9d2fa5d","ember-4.12.3-@ember/component":"ember-4.12.3-@ember/component-c185c8f0a1","ember-4.12.3-@ember/component/helper":"ember-4.12.3-@ember/component/helper-a4ae953c59","ember-4.12.3-@ember/component/template-only":"ember-4.12.3-@ember/component/template-only-a96fa608b4","ember-4.12.3-@ember/debug":"ember-4.12.3-@ember/debug-10b4bd9991","ember-4.12.3-@ember/destroyable":"ember-4.12.3-@ember/destroyable-9c74c9b2d3","ember-4.12.3-@ember/engine":"ember-4.12.3-@ember/engine-db89b1cab5","ember-4.12.3-@ember/helper":"ember-4.12.3-@ember/helper-b2c753db35","ember-4.12.3-@ember/instrumentation":"ember-4.12.3-@ember/instrumentation-32792a04ed","ember-4.12.3-@ember/object":"ember-4.12.3-@ember/object-6df0b868ac","ember-4.12.3-@ember/object/compat":"ember-4.12.3-@ember/object/compat-f691127b05","ember-4.12.3-@ember/object/computed":"ember-4.12.3-@ember/object/computed-e80eb42511","ember-4.12.3-@ember/object/evented":"ember-4.12.3-@ember/object/evented-3974b91ec2","ember-4.12.3-@ember/object/events":"ember-4.12.3-@ember/object/events-74f08070f8","ember-4.12.3-@ember/object/internals":"ember-4.12.3-@ember/object/internals-1e5248b86e","ember-4.12.3-@ember/object/mixin":"ember-4.12.3-@ember/object/mixin-53e82367d1","ember-4.12.3-@ember/object/observers":"ember-4.12.3-@ember/object/observers-fb02f6c762","ember-4.12.3-@ember/owner":"ember-4.12.3-@ember/owner-dd510d5f54","ember-4.12.3-@ember/polyfills":"ember-4.12.3-@ember/polyfills-899df87a07","ember-4.12.3-@ember/routing":"ember-4.12.3-@ember/routing-348d6e4746","ember-4.12.3-@ember/runloop":"ember-4.12.3-@ember/runloop-bd9cea2adc","ember-4.12.3-@ember/service":"ember-4.12.3-@ember/service-b493a7bf53","ember-4.12.3-@ember/template":"ember-4.12.3-@ember/template-ee1199d182","ember-4.12.3-@ember/test":"ember-4.12.3-@ember/test-3cdbc3de76","ember-4.12.3-@ember/utils":"ember-4.12.3-@ember/utils-b45b721b3f","ember-4.12.3-@glimmer/tracking":"ember-4.12.3-@glimmer/tracking-275ccf5163","ember-4.12.3-@glimmer/tracking/primitives/cache":"ember-4.12.3-@glimmer/tracking/primitives/cache-e7afa4be71","ember-4.12.3-Ember.@ember/controller":"ember-4.12.3-Ember.@ember/controller-2fb1e3560d"},"namespace":{"ember-4.12.3-FEATURES":"ember-4.12.3-FEATURES-28cc85d11f","ember-4.12.3-Instrumentation":"ember-4.12.3-Instrumentation-71b987bb60","ember-4.12.3-AutoLocation":"ember-4.12.3-AutoLocation-50f7cb4523"},"module":{"ember-4.12.3-rsvp":"ember-4.12.3-rsvp-675afaac7d","ember-4.12.3-@ember/component":"ember-4.12.3-@ember/component-49ea15a340","ember-4.12.3-@ember/routing":"ember-4.12.3-@ember/routing-ecd61d86ea","ember-4.12.3-ember":"ember-4.12.3-ember-ef16cc3892","ember-4.12.3-@ember/template":"ember-4.12.3-@ember/template-0549980fe7","ember-4.12.3-@glimmer/component":"ember-4.12.3-@glimmer/component-771578a395","ember-4.12.3-@glimmer/tracking":"ember-4.12.3-@glimmer/tracking-fa2e1c51e3","ember-4.12.3-@glimmer/tracking/primitives/cache":"ember-4.12.3-@glimmer/tracking/primitives/cache-7dcae8144c","ember-4.12.3-@ember/object":"ember-4.12.3-@ember/object-d62a557a66","ember-4.12.3-@ember/owner":"ember-4.12.3-@ember/owner-5b2efe8012","ember-4.12.3-@ember/utils":"ember-4.12.3-@ember/utils-28ac183b1d","ember-4.12.3-@ember/application":"ember-4.12.3-@ember/application-19a35559d4","ember-4.12.3-@ember/application/namespace":"ember-4.12.3-@ember/application/namespace-0b5d64cb9c","ember-4.12.3-@ember/array":"ember-4.12.3-@ember/array-979df3651c","ember-4.12.3-@ember/array/proxy":"ember-4.12.3-@ember/array/proxy-d6c4968f23","ember-4.12.3-@ember/canary-features":"ember-4.12.3-@ember/canary-features-16c264b934","ember-4.12.3-@ember/component/template-only":"ember-4.12.3-@ember/component/template-only-c625d140ca","ember-4.12.3-@ember/controller":"ember-4.12.3-@ember/controller-4c53bb6cd5","ember-4.12.3-@ember/debug":"ember-4.12.3-@ember/debug-df4f46a7b4","ember-4.12.3-@ember/debug/container-debug-adapter":"ember-4.12.3-@ember/debug/container-debug-adapter-dd1126f7a8","ember-4.12.3-@ember/debug/data-adapter":"ember-4.12.3-@ember/debug/data-adapter-afdc96146e","ember-4.12.3-@ember/destroyable":"ember-4.12.3-@ember/destroyable-f3eeb6e830","ember-4.12.3-@ember/engine":"ember-4.12.3-@ember/engine-5660bceb34","ember-4.12.3-@ember/enumerable":"ember-4.12.3-@ember/enumerable-8fff8a907f","ember-4.12.3-@ember/error":"ember-4.12.3-@ember/error-0b41d1dd35","ember-4.12.3-@ember/helper":"ember-4.12.3-@ember/helper-fa7b3fe76d","ember-4.12.3-@ember/instrumentation":"ember-4.12.3-@ember/instrumentation-ae03844038","ember-4.12.3-@ember/object/core":"ember-4.12.3-@ember/object/core-f8a649d859","ember-4.12.3-@ember/object/evented":"ember-4.12.3-@ember/object/evented-2ac97828ae","ember-4.12.3-@ember/object/mixin":"ember-4.12.3-@ember/object/mixin-05dc33dff2","ember-4.12.3-@ember/object/observable":"ember-4.12.3-@ember/object/observable-0aa2e2e798","ember-4.12.3-@ember/object/promise-proxy-mixin":"ember-4.12.3-@ember/object/promise-proxy-mixin-f711c33df5","ember-4.12.3-@ember/object/proxy":"ember-4.12.3-@ember/object/proxy-86054b78d5","ember-4.12.3-@ember/polyfills":"ember-4.12.3-@ember/polyfills-2d444577e7","ember-4.12.3-@ember/renderer":"ember-4.12.3-@ember/renderer-888b061c86","ember-4.12.3-ember/routing":"ember-4.12.3-ember/routing-24e75ed7ed","ember-4.12.3-@ember/routing/auto-location":"ember-4.12.3-@ember/routing/auto-location-7da46b7731","ember-4.12.3-@ember/routing/hash-location":"ember-4.12.3-@ember/routing/hash-location-48a69a8ad7","ember-4.12.3-@ember/routing/history-location":"ember-4.12.3-@ember/routing/history-location-f8c29255b0","ember-4.12.3-@ember/routing/location":"ember-4.12.3-@ember/routing/location-58acaededa","ember-4.12.3-@ember/routing/none-location":"ember-4.12.3-@ember/routing/none-location-98052e015b","ember-4.12.3-@ember/routing/route-info":"ember-4.12.3-@ember/routing/route-info-e7a8af6cd3","ember-4.12.3-@ember/routing/route":"ember-4.12.3-@ember/routing/route-c8258097d9","ember-4.12.3-@ember/routing/router-service":"ember-4.12.3-@ember/routing/router-service-d0f8b25eae","ember-4.12.3-@ember/routing/router":"ember-4.12.3-@ember/routing/router-b571c7a719","ember-4.12.3-@ember/routing/transition":"ember-4.12.3-@ember/routing/transition-c25f8278c5","ember-4.12.3-@ember/runloop":"ember-4.12.3-@ember/runloop-9ebea7933c","ember-4.12.3-@ember/service":"ember-4.12.3-@ember/service-29051f6013","ember-4.12.3-@ember/string":"ember-4.12.3-@ember/string-94fb39470a","ember-4.12.3-@ember/test":"ember-4.12.3-@ember/test-617a0faf0e"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Error":"Error-158974c414"}}} \ No newline at end of file diff --git a/rev-index/ember-4.2.0.json b/rev-index/ember-4.2.0.json index 2f84f76e7..690a9764a 100644 --- a/rev-index/ember-4.2.0.json +++ b/rev-index/ember-4.2.0.json @@ -1 +1 @@ -{"data":{"id":"ember-4.2.0","type":"project-version","attributes":{"version":"4.2.0"},"relationships":{"classes":{"data":[{"id":"ember-4.2.0-Promise","type":"class"},{"id":"ember-4.2.0-EventTarget","type":"class"},{"id":"ember-4.2.0-Container","type":"class"},{"id":"ember-4.2.0-Registry","type":"class"},{"id":"ember-4.2.0-EmberENV","type":"class"},{"id":"ember-4.2.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.2.0-DataAdapter","type":"class"},{"id":"ember-4.2.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.2.0-ComponentStateBucket","type":"class"},{"id":"ember-4.2.0-Component","type":"class"},{"id":"ember-4.2.0-Helper","type":"class"},{"id":"ember-4.2.0-ComputedProperty","type":"class"},{"id":"ember-4.2.0-Descriptor","type":"class"},{"id":"ember-4.2.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.2.0-Libraries","type":"class"},{"id":"ember-4.2.0-Mixin","type":"class"},{"id":"ember-4.2.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.2.0-Location","type":"class"},{"id":"ember-4.2.0-HashLocation","type":"class"},{"id":"ember-4.2.0-HistoryLocation","type":"class"},{"id":"ember-4.2.0-NoneLocation","type":"class"},{"id":"ember-4.2.0-RouterService","type":"class"},{"id":"ember-4.2.0-RoutingService","type":"class"},{"id":"ember-4.2.0-BucketCache","type":"class"},{"id":"ember-4.2.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.2.0-RouteInfo","type":"class"},{"id":"ember-4.2.0-Route","type":"class"},{"id":"ember-4.2.0-EmberRouter","type":"class"},{"id":"ember-4.2.0-Transition","type":"class"},{"id":"ember-4.2.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.2.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.2.0-EmberArray","type":"class"},{"id":"ember-4.2.0-MutableArray","type":"class"},{"id":"ember-4.2.0-Ember.NativeArray","type":"class"},{"id":"ember-4.2.0-Ember.Comparable","type":"class"},{"id":"ember-4.2.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.2.0-Enumerable","type":"class"},{"id":"ember-4.2.0-Evented","type":"class"},{"id":"ember-4.2.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.2.0-Observable","type":"class"},{"id":"ember-4.2.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.2.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.2.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.2.0-ArrayProxy","type":"class"},{"id":"ember-4.2.0-CoreObject","type":"class"},{"id":"ember-4.2.0-Ember.Namespace","type":"class"},{"id":"ember-4.2.0-EmberObject","type":"class"},{"id":"ember-4.2.0-ObjectProxy","type":"class"},{"id":"ember-4.2.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.2.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.2.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.2.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.2.0-Ember.CoreView","type":"class"},{"id":"ember-4.2.0-Application","type":"class"},{"id":"ember-4.2.0-ApplicationInstance","type":"class"},{"id":"ember-4.2.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.2.0-Controller","type":"class"},{"id":"ember-4.2.0-Engine","type":"class"},{"id":"ember-4.2.0-EngineInstance","type":"class"},{"id":"ember-4.2.0-Ember.Error","type":"class"},{"id":"ember-4.2.0-Service","type":"class"},{"id":"ember-4.2.0-String","type":"class"},{"id":"ember-4.2.0-TestAdapter","type":"class"},{"id":"ember-4.2.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.2.0-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.2.0-AutoLocation","type":"namespace"},{"id":"ember-4.2.0-FEATURES","type":"namespace"},{"id":"ember-4.2.0-Instrumentation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.2.0-rsvp","type":"module"},{"id":"ember-4.2.0-@ember/debug","type":"module"},{"id":"ember-4.2.0-@ember/component","type":"module"},{"id":"ember-4.2.0-@ember/routing","type":"module"},{"id":"ember-4.2.0-ember","type":"module"},{"id":"ember-4.2.0-@ember/template","type":"module"},{"id":"ember-4.2.0-@glimmer/component","type":"module"},{"id":"ember-4.2.0-@glimmer/tracking","type":"module"},{"id":"ember-4.2.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.2.0-@ember/object","type":"module"},{"id":"ember-4.2.0-@ember/utils","type":"module"},{"id":"ember-4.2.0-@ember/application","type":"module"},{"id":"ember-4.2.0-@ember/array","type":"module"},{"id":"ember-4.2.0-@ember/enumerable","type":"module"},{"id":"ember-4.2.0-@ember/canary-features","type":"module"},{"id":"ember-4.2.0-@ember/component/template-only","type":"module"},{"id":"ember-4.2.0-@ember/controller","type":"module"},{"id":"ember-4.2.0-@ember/destroyable","type":"module"},{"id":"ember-4.2.0-@ember/engine","type":"module"},{"id":"ember-4.2.0-@ember/error","type":"module"},{"id":"ember-4.2.0-@ember/helper","type":"module"},{"id":"ember-4.2.0-@ember/instrumentation","type":"module"},{"id":"ember-4.2.0-@ember/polyfills","type":"module"},{"id":"ember-4.2.0-@ember/runloop","type":"module"},{"id":"ember-4.2.0-@ember/service","type":"module"},{"id":"ember-4.2.0-@ember/string","type":"module"},{"id":"ember-4.2.0-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.2.0-Container","type":"class"},{"id":"ember-4.2.0-Registry","type":"class"},{"id":"ember-4.2.0-ComponentStateBucket","type":"class"},{"id":"ember-4.2.0-Descriptor","type":"class"},{"id":"ember-4.2.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.2.0-Libraries","type":"class"},{"id":"ember-4.2.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.2.0-Location","type":"class"},{"id":"ember-4.2.0-RoutingService","type":"class"},{"id":"ember-4.2.0-BucketCache","type":"class"},{"id":"ember-4.2.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.2.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.2.0-Ember.Comparable","type":"class"},{"id":"ember-4.2.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.2.0-Enumerable","type":"class"},{"id":"ember-4.2.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.2.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.2.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.2.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.2.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.2.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.2.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.2.0-Ember.CoreView","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.2.0-Promise","type":"class"},{"id":"ember-4.2.0-EventTarget","type":"class"},{"id":"ember-4.2.0-EmberENV","type":"class"},{"id":"ember-4.2.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.2.0-DataAdapter","type":"class"},{"id":"ember-4.2.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.2.0-Component","type":"class"},{"id":"ember-4.2.0-Helper","type":"class"},{"id":"ember-4.2.0-ComputedProperty","type":"class"},{"id":"ember-4.2.0-Mixin","type":"class"},{"id":"ember-4.2.0-HashLocation","type":"class"},{"id":"ember-4.2.0-HistoryLocation","type":"class"},{"id":"ember-4.2.0-NoneLocation","type":"class"},{"id":"ember-4.2.0-RouterService","type":"class"},{"id":"ember-4.2.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.2.0-RouteInfo","type":"class"},{"id":"ember-4.2.0-Route","type":"class"},{"id":"ember-4.2.0-EmberRouter","type":"class"},{"id":"ember-4.2.0-Transition","type":"class"},{"id":"ember-4.2.0-EmberArray","type":"class"},{"id":"ember-4.2.0-MutableArray","type":"class"},{"id":"ember-4.2.0-Ember.NativeArray","type":"class"},{"id":"ember-4.2.0-Evented","type":"class"},{"id":"ember-4.2.0-Observable","type":"class"},{"id":"ember-4.2.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.2.0-ArrayProxy","type":"class"},{"id":"ember-4.2.0-CoreObject","type":"class"},{"id":"ember-4.2.0-Ember.Namespace","type":"class"},{"id":"ember-4.2.0-EmberObject","type":"class"},{"id":"ember-4.2.0-ObjectProxy","type":"class"},{"id":"ember-4.2.0-Application","type":"class"},{"id":"ember-4.2.0-ApplicationInstance","type":"class"},{"id":"ember-4.2.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.2.0-Controller","type":"class"},{"id":"ember-4.2.0-Engine","type":"class"},{"id":"ember-4.2.0-EngineInstance","type":"class"},{"id":"ember-4.2.0-Ember.Error","type":"class"},{"id":"ember-4.2.0-Service","type":"class"},{"id":"ember-4.2.0-String","type":"class"},{"id":"ember-4.2.0-TestAdapter","type":"class"},{"id":"ember-4.2.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.2.0-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.2.0-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.2.0-AutoLocation","type":"namespace"},{"id":"ember-4.2.0-FEATURES","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.2.0-ember","type":"module"},{"id":"ember-4.2.0-@ember/enumerable","type":"module"},{"id":"ember-4.2.0-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.2.0-rsvp","type":"module"},{"id":"ember-4.2.0-@ember/debug","type":"module"},{"id":"ember-4.2.0-@ember/component","type":"module"},{"id":"ember-4.2.0-@ember/routing","type":"module"},{"id":"ember-4.2.0-@ember/template","type":"module"},{"id":"ember-4.2.0-@glimmer/component","type":"module"},{"id":"ember-4.2.0-@glimmer/tracking","type":"module"},{"id":"ember-4.2.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.2.0-@ember/object","type":"module"},{"id":"ember-4.2.0-@ember/utils","type":"module"},{"id":"ember-4.2.0-@ember/application","type":"module"},{"id":"ember-4.2.0-@ember/array","type":"module"},{"id":"ember-4.2.0-@ember/canary-features","type":"module"},{"id":"ember-4.2.0-@ember/component/template-only","type":"module"},{"id":"ember-4.2.0-@ember/controller","type":"module"},{"id":"ember-4.2.0-@ember/destroyable","type":"module"},{"id":"ember-4.2.0-@ember/engine","type":"module"},{"id":"ember-4.2.0-@ember/error","type":"module"},{"id":"ember-4.2.0-@ember/helper","type":"module"},{"id":"ember-4.2.0-@ember/polyfills","type":"module"},{"id":"ember-4.2.0-@ember/runloop","type":"module"},{"id":"ember-4.2.0-@ember/service","type":"module"},{"id":"ember-4.2.0-@ember/string","type":"module"},{"id":"ember-4.2.0-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.2.0-Promise":"ember-4.2.0-Promise-740468db04","ember-4.2.0-EventTarget":"ember-4.2.0-EventTarget-ea7ce0d10c","ember-4.2.0-Container":"ember-4.2.0-Container-edeeec1345","ember-4.2.0-Registry":"ember-4.2.0-Registry-efc52b8b5f","ember-4.2.0-EmberENV":"ember-4.2.0-EmberENV-bc13fe1cdd","ember-4.2.0-ContainerDebugAdapter":"ember-4.2.0-ContainerDebugAdapter-4d5c8f61d4","ember-4.2.0-DataAdapter":"ember-4.2.0-DataAdapter-fd95c0533e","ember-4.2.0-Ember.Templates.helpers":"ember-4.2.0-Ember.Templates.helpers-5e0afa822e","ember-4.2.0-ComponentStateBucket":"ember-4.2.0-ComponentStateBucket-33322ac53c","ember-4.2.0-Component":"ember-4.2.0-Component-a20517bf0f","ember-4.2.0-Helper":"ember-4.2.0-Helper-1a59abbe5c","ember-4.2.0-ComputedProperty":"ember-4.2.0-ComputedProperty-749ee13e92","ember-4.2.0-Descriptor":"ember-4.2.0-Descriptor-eac34686bb","ember-4.2.0-Ember.InjectedProperty":"ember-4.2.0-Ember.InjectedProperty-278c7f97a8","ember-4.2.0-Libraries":"ember-4.2.0-Libraries-c8dc328951","ember-4.2.0-Mixin":"ember-4.2.0-Mixin-15f1153e09","ember-4.2.0-Ember.ControllerMixin":"ember-4.2.0-Ember.ControllerMixin-6bfa2cabe3","ember-4.2.0-Location":"ember-4.2.0-Location-26cf070fbf","ember-4.2.0-HashLocation":"ember-4.2.0-HashLocation-b5fa40eb63","ember-4.2.0-HistoryLocation":"ember-4.2.0-HistoryLocation-1bb58f291e","ember-4.2.0-NoneLocation":"ember-4.2.0-NoneLocation-e600276a7c","ember-4.2.0-RouterService":"ember-4.2.0-RouterService-8d0098c9f4","ember-4.2.0-RoutingService":"ember-4.2.0-RoutingService-71b3a0e7d6","ember-4.2.0-BucketCache":"ember-4.2.0-BucketCache-b7182d3082","ember-4.2.0-RouteInfoWithAttributes":"ember-4.2.0-RouteInfoWithAttributes-32af2e7625","ember-4.2.0-RouteInfo":"ember-4.2.0-RouteInfo-92f83cd547","ember-4.2.0-Route":"ember-4.2.0-Route-b4e38051fe","ember-4.2.0-EmberRouter":"ember-4.2.0-EmberRouter-555581f9ba","ember-4.2.0-Transition":"ember-4.2.0-Transition-1de21fa363","ember-4.2.0-Ember.ProxyMixin":"ember-4.2.0-Ember.ProxyMixin-636cebad42","ember-4.2.0-Ember.ActionHandler":"ember-4.2.0-Ember.ActionHandler-c99e1ae866","ember-4.2.0-EmberArray":"ember-4.2.0-EmberArray-30ea86bdb7","ember-4.2.0-MutableArray":"ember-4.2.0-MutableArray-324106db45","ember-4.2.0-Ember.NativeArray":"ember-4.2.0-Ember.NativeArray-7a85440b40","ember-4.2.0-Ember.Comparable":"ember-4.2.0-Ember.Comparable-e5868ea5c7","ember-4.2.0-ContainerProxyMixin":"ember-4.2.0-ContainerProxyMixin-8024d1b63a","ember-4.2.0-Enumerable":"ember-4.2.0-Enumerable-c4f4d3aa61","ember-4.2.0-Evented":"ember-4.2.0-Evented-3a392abe19","ember-4.2.0-Ember.MutableEnumerable":"ember-4.2.0-Ember.MutableEnumerable-debf989269","ember-4.2.0-Observable":"ember-4.2.0-Observable-746d3eeed8","ember-4.2.0-PromiseProxyMixin":"ember-4.2.0-PromiseProxyMixin-fe8ae1d600","ember-4.2.0-RegistryProxyMixin":"ember-4.2.0-RegistryProxyMixin-d417959822","ember-4.2.0-Ember.TargetActionSupport":"ember-4.2.0-Ember.TargetActionSupport-cc6a0b58a7","ember-4.2.0-ArrayProxy":"ember-4.2.0-ArrayProxy-cfcb38a33c","ember-4.2.0-CoreObject":"ember-4.2.0-CoreObject-8189189554","ember-4.2.0-Ember.Namespace":"ember-4.2.0-Ember.Namespace-3458eac1f3","ember-4.2.0-EmberObject":"ember-4.2.0-EmberObject-19a1296c94","ember-4.2.0-ObjectProxy":"ember-4.2.0-ObjectProxy-3cc08f9a1e","ember-4.2.0-Ember.ActionSupport":"ember-4.2.0-Ember.ActionSupport-ff54233f58","ember-4.2.0-Ember.ClassNamesSupport":"ember-4.2.0-Ember.ClassNamesSupport-0c1ced5f94","ember-4.2.0-Ember.ViewMixin":"ember-4.2.0-Ember.ViewMixin-65ec39c975","ember-4.2.0-Ember.EventDispatcher":"ember-4.2.0-Ember.EventDispatcher-5a932fe606","ember-4.2.0-Ember.CoreView":"ember-4.2.0-Ember.CoreView-213905681d","ember-4.2.0-Application":"ember-4.2.0-Application-4bc1cf9e89","ember-4.2.0-ApplicationInstance":"ember-4.2.0-ApplicationInstance-140a1660f9","ember-4.2.0-ApplicationInstance.BootOptions":"ember-4.2.0-ApplicationInstance.BootOptions-1d459a32d7","ember-4.2.0-Controller":"ember-4.2.0-Controller-a9fe9e526d","ember-4.2.0-Engine":"ember-4.2.0-Engine-4b1aded2cd","ember-4.2.0-EngineInstance":"ember-4.2.0-EngineInstance-a2460e1ae1","ember-4.2.0-Ember.Error":"ember-4.2.0-Ember.Error-a087234bd4","ember-4.2.0-Service":"ember-4.2.0-Service-fe782329bd","ember-4.2.0-String":"ember-4.2.0-String-80d9eb6fc5","ember-4.2.0-TestAdapter":"ember-4.2.0-TestAdapter-ed716c813d","ember-4.2.0-Ember.Test.QUnitAdapter":"ember-4.2.0-Ember.Test.QUnitAdapter-23917dc62f","ember-4.2.0-Ember.Test":"ember-4.2.0-Ember.Test-ec5328c44b","ember-4.2.0-Ember":"ember-4.2.0-Ember-9fc1584c70","ember-4.2.0-Ember.Templates.components":"ember-4.2.0-Ember.Templates.components-842abebcbd","ember-4.2.0-rsvp":"ember-4.2.0-rsvp-6c8a978756","ember-4.2.0-@ember/application":"ember-4.2.0-@ember/application-4a8e519993","ember-4.2.0-@ember/array":"ember-4.2.0-@ember/array-b001400d68","ember-4.2.0-@ember/component":"ember-4.2.0-@ember/component-33c7a8f6de","ember-4.2.0-@ember/component/helper":"ember-4.2.0-@ember/component/helper-f50f1e4788","ember-4.2.0-@ember/component/template-only":"ember-4.2.0-@ember/component/template-only-09a3249863","ember-4.2.0-@ember/controller":"ember-4.2.0-@ember/controller-ffcea2f1eb","ember-4.2.0-@ember/debug":"ember-4.2.0-@ember/debug-7e3f0d38e9","ember-4.2.0-@ember/destroyable":"ember-4.2.0-@ember/destroyable-eafe605026","ember-4.2.0-@ember/engine":"ember-4.2.0-@ember/engine-72bab8ef86","ember-4.2.0-@ember/helper":"ember-4.2.0-@ember/helper-591d4d744f","ember-4.2.0-@ember/instrumentation":"ember-4.2.0-@ember/instrumentation-d26ee7a7d9","ember-4.2.0-@ember/object":"ember-4.2.0-@ember/object-7daae93906","ember-4.2.0-@ember/object/compat":"ember-4.2.0-@ember/object/compat-c6551dc224","ember-4.2.0-@ember/object/computed":"ember-4.2.0-@ember/object/computed-d1a08c8efa","ember-4.2.0-@ember/object/evented":"ember-4.2.0-@ember/object/evented-f99051e43a","ember-4.2.0-@ember/object/events":"ember-4.2.0-@ember/object/events-db4635ee9f","ember-4.2.0-@ember/object/internals":"ember-4.2.0-@ember/object/internals-1eb82d4a45","ember-4.2.0-@ember/object/mixin":"ember-4.2.0-@ember/object/mixin-248ceacb1c","ember-4.2.0-@ember/object/observers":"ember-4.2.0-@ember/object/observers-1fa178dfda","ember-4.2.0-@ember/polyfills":"ember-4.2.0-@ember/polyfills-b4d7bb7d55","ember-4.2.0-@ember/routing":"ember-4.2.0-@ember/routing-901c02a0fd","ember-4.2.0-@ember/runloop":"ember-4.2.0-@ember/runloop-987aaedd7b","ember-4.2.0-@ember/service":"ember-4.2.0-@ember/service-5c168eddc5","ember-4.2.0-@ember/template":"ember-4.2.0-@ember/template-71e6ed0f88","ember-4.2.0-@ember/test":"ember-4.2.0-@ember/test-17dff255d6","ember-4.2.0-@ember/utils":"ember-4.2.0-@ember/utils-2653aefd60","ember-4.2.0-@glimmer/tracking":"ember-4.2.0-@glimmer/tracking-3e53e0e300","ember-4.2.0-@glimmer/tracking/primitives/cache":"ember-4.2.0-@glimmer/tracking/primitives/cache-2887bbd06f"},"namespace":{"ember-4.2.0-AutoLocation":"ember-4.2.0-AutoLocation-2d23880c7f","ember-4.2.0-FEATURES":"ember-4.2.0-FEATURES-2299075d8f","ember-4.2.0-Instrumentation":"ember-4.2.0-Instrumentation-ac82c84d5f"},"module":{"ember-4.2.0-rsvp":"ember-4.2.0-rsvp-d931cdcffc","ember-4.2.0-@ember/debug":"ember-4.2.0-@ember/debug-56d6fdbbb1","ember-4.2.0-@ember/component":"ember-4.2.0-@ember/component-36d7d19f1f","ember-4.2.0-@ember/routing":"ember-4.2.0-@ember/routing-b114d35adf","ember-4.2.0-ember":"ember-4.2.0-ember-bb4c23c749","ember-4.2.0-@ember/template":"ember-4.2.0-@ember/template-d163c4a107","ember-4.2.0-@glimmer/component":"ember-4.2.0-@glimmer/component-c730c45b00","ember-4.2.0-@glimmer/tracking":"ember-4.2.0-@glimmer/tracking-05074f97f1","ember-4.2.0-@glimmer/tracking/primitives/cache":"ember-4.2.0-@glimmer/tracking/primitives/cache-6cd18e5393","ember-4.2.0-@ember/object":"ember-4.2.0-@ember/object-4bce51f26c","ember-4.2.0-@ember/utils":"ember-4.2.0-@ember/utils-6886c1fc7f","ember-4.2.0-@ember/application":"ember-4.2.0-@ember/application-dd2297e398","ember-4.2.0-@ember/array":"ember-4.2.0-@ember/array-d5800c9f0c","ember-4.2.0-@ember/enumerable":"ember-4.2.0-@ember/enumerable-5319d13ff8","ember-4.2.0-@ember/canary-features":"ember-4.2.0-@ember/canary-features-0a48b03425","ember-4.2.0-@ember/component/template-only":"ember-4.2.0-@ember/component/template-only-f3f21a67ed","ember-4.2.0-@ember/controller":"ember-4.2.0-@ember/controller-02b93ac2ca","ember-4.2.0-@ember/destroyable":"ember-4.2.0-@ember/destroyable-4aabb0331d","ember-4.2.0-@ember/engine":"ember-4.2.0-@ember/engine-e7c797939f","ember-4.2.0-@ember/error":"ember-4.2.0-@ember/error-25e6543b48","ember-4.2.0-@ember/helper":"ember-4.2.0-@ember/helper-9db9d321db","ember-4.2.0-@ember/instrumentation":"ember-4.2.0-@ember/instrumentation-dba3017579","ember-4.2.0-@ember/polyfills":"ember-4.2.0-@ember/polyfills-2989e00ec5","ember-4.2.0-@ember/runloop":"ember-4.2.0-@ember/runloop-a442abf433","ember-4.2.0-@ember/service":"ember-4.2.0-@ember/service-619cd0b129","ember-4.2.0-@ember/string":"ember-4.2.0-@ember/string-d6f75ad19a","ember-4.2.0-@ember/test":"ember-4.2.0-@ember/test-9e115ce88e"},"missing":{"Ember.Object":"Ember.Object-9c32970d20","Error":"Error-158974c414"}}} \ No newline at end of file +{"data":{"id":"ember-4.2.0","type":"project-version","attributes":{"version":"4.2.0"},"relationships":{"classes":{"data":[{"id":"ember-4.2.0-Promise","type":"class"},{"id":"ember-4.2.0-EventTarget","type":"class"},{"id":"ember-4.2.0-Container","type":"class"},{"id":"ember-4.2.0-Registry","type":"class"},{"id":"ember-4.2.0-EmberENV","type":"class"},{"id":"ember-4.2.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.2.0-DataAdapter","type":"class"},{"id":"ember-4.2.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.2.0-ComponentStateBucket","type":"class"},{"id":"ember-4.2.0-Component","type":"class"},{"id":"ember-4.2.0-Helper","type":"class"},{"id":"ember-4.2.0-ComputedProperty","type":"class"},{"id":"ember-4.2.0-Descriptor","type":"class"},{"id":"ember-4.2.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.2.0-Libraries","type":"class"},{"id":"ember-4.2.0-Mixin","type":"class"},{"id":"ember-4.2.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.2.0-Location","type":"class"},{"id":"ember-4.2.0-HashLocation","type":"class"},{"id":"ember-4.2.0-HistoryLocation","type":"class"},{"id":"ember-4.2.0-NoneLocation","type":"class"},{"id":"ember-4.2.0-RouterService","type":"class"},{"id":"ember-4.2.0-RoutingService","type":"class"},{"id":"ember-4.2.0-BucketCache","type":"class"},{"id":"ember-4.2.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.2.0-RouteInfo","type":"class"},{"id":"ember-4.2.0-Route","type":"class"},{"id":"ember-4.2.0-EmberRouter","type":"class"},{"id":"ember-4.2.0-Transition","type":"class"},{"id":"ember-4.2.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.2.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.2.0-EmberArray","type":"class"},{"id":"ember-4.2.0-MutableArray","type":"class"},{"id":"ember-4.2.0-Ember.NativeArray","type":"class"},{"id":"ember-4.2.0-Ember.Comparable","type":"class"},{"id":"ember-4.2.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.2.0-Enumerable","type":"class"},{"id":"ember-4.2.0-Evented","type":"class"},{"id":"ember-4.2.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.2.0-Observable","type":"class"},{"id":"ember-4.2.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.2.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.2.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.2.0-ArrayProxy","type":"class"},{"id":"ember-4.2.0-CoreObject","type":"class"},{"id":"ember-4.2.0-Ember.Namespace","type":"class"},{"id":"ember-4.2.0-EmberObject","type":"class"},{"id":"ember-4.2.0-ObjectProxy","type":"class"},{"id":"ember-4.2.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.2.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.2.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.2.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.2.0-Ember.CoreView","type":"class"},{"id":"ember-4.2.0-Application","type":"class"},{"id":"ember-4.2.0-ApplicationInstance","type":"class"},{"id":"ember-4.2.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.2.0-Controller","type":"class"},{"id":"ember-4.2.0-Engine","type":"class"},{"id":"ember-4.2.0-EngineInstance","type":"class"},{"id":"ember-4.2.0-Ember.Error","type":"class"},{"id":"ember-4.2.0-Service","type":"class"},{"id":"ember-4.2.0-String","type":"class"},{"id":"ember-4.2.0-TestAdapter","type":"class"},{"id":"ember-4.2.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.2.0-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.2.0-AutoLocation","type":"namespace"},{"id":"ember-4.2.0-FEATURES","type":"namespace"},{"id":"ember-4.2.0-Instrumentation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.2.0-rsvp","type":"module"},{"id":"ember-4.2.0-@ember/debug","type":"module"},{"id":"ember-4.2.0-@ember/component","type":"module"},{"id":"ember-4.2.0-@ember/routing","type":"module"},{"id":"ember-4.2.0-ember","type":"module"},{"id":"ember-4.2.0-@ember/template","type":"module"},{"id":"ember-4.2.0-@glimmer/component","type":"module"},{"id":"ember-4.2.0-@glimmer/tracking","type":"module"},{"id":"ember-4.2.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.2.0-@ember/object","type":"module"},{"id":"ember-4.2.0-@ember/utils","type":"module"},{"id":"ember-4.2.0-@ember/application","type":"module"},{"id":"ember-4.2.0-@ember/array","type":"module"},{"id":"ember-4.2.0-@ember/enumerable","type":"module"},{"id":"ember-4.2.0-@ember/canary-features","type":"module"},{"id":"ember-4.2.0-@ember/component/template-only","type":"module"},{"id":"ember-4.2.0-@ember/controller","type":"module"},{"id":"ember-4.2.0-@ember/destroyable","type":"module"},{"id":"ember-4.2.0-@ember/engine","type":"module"},{"id":"ember-4.2.0-@ember/error","type":"module"},{"id":"ember-4.2.0-@ember/helper","type":"module"},{"id":"ember-4.2.0-@ember/instrumentation","type":"module"},{"id":"ember-4.2.0-@ember/polyfills","type":"module"},{"id":"ember-4.2.0-@ember/runloop","type":"module"},{"id":"ember-4.2.0-@ember/service","type":"module"},{"id":"ember-4.2.0-@ember/string","type":"module"},{"id":"ember-4.2.0-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.2.0-Container","type":"class"},{"id":"ember-4.2.0-Registry","type":"class"},{"id":"ember-4.2.0-ComponentStateBucket","type":"class"},{"id":"ember-4.2.0-Descriptor","type":"class"},{"id":"ember-4.2.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.2.0-Libraries","type":"class"},{"id":"ember-4.2.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.2.0-Location","type":"class"},{"id":"ember-4.2.0-RoutingService","type":"class"},{"id":"ember-4.2.0-BucketCache","type":"class"},{"id":"ember-4.2.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.2.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.2.0-Ember.Comparable","type":"class"},{"id":"ember-4.2.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.2.0-Enumerable","type":"class"},{"id":"ember-4.2.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.2.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.2.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.2.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.2.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.2.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.2.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.2.0-Ember.CoreView","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.2.0-Promise","type":"class"},{"id":"ember-4.2.0-EventTarget","type":"class"},{"id":"ember-4.2.0-EmberENV","type":"class"},{"id":"ember-4.2.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.2.0-DataAdapter","type":"class"},{"id":"ember-4.2.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.2.0-Component","type":"class"},{"id":"ember-4.2.0-Helper","type":"class"},{"id":"ember-4.2.0-ComputedProperty","type":"class"},{"id":"ember-4.2.0-Mixin","type":"class"},{"id":"ember-4.2.0-HashLocation","type":"class"},{"id":"ember-4.2.0-HistoryLocation","type":"class"},{"id":"ember-4.2.0-NoneLocation","type":"class"},{"id":"ember-4.2.0-RouterService","type":"class"},{"id":"ember-4.2.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.2.0-RouteInfo","type":"class"},{"id":"ember-4.2.0-Route","type":"class"},{"id":"ember-4.2.0-EmberRouter","type":"class"},{"id":"ember-4.2.0-Transition","type":"class"},{"id":"ember-4.2.0-EmberArray","type":"class"},{"id":"ember-4.2.0-MutableArray","type":"class"},{"id":"ember-4.2.0-Ember.NativeArray","type":"class"},{"id":"ember-4.2.0-Evented","type":"class"},{"id":"ember-4.2.0-Observable","type":"class"},{"id":"ember-4.2.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.2.0-ArrayProxy","type":"class"},{"id":"ember-4.2.0-CoreObject","type":"class"},{"id":"ember-4.2.0-Ember.Namespace","type":"class"},{"id":"ember-4.2.0-EmberObject","type":"class"},{"id":"ember-4.2.0-ObjectProxy","type":"class"},{"id":"ember-4.2.0-Application","type":"class"},{"id":"ember-4.2.0-ApplicationInstance","type":"class"},{"id":"ember-4.2.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.2.0-Controller","type":"class"},{"id":"ember-4.2.0-Engine","type":"class"},{"id":"ember-4.2.0-EngineInstance","type":"class"},{"id":"ember-4.2.0-Ember.Error","type":"class"},{"id":"ember-4.2.0-Service","type":"class"},{"id":"ember-4.2.0-String","type":"class"},{"id":"ember-4.2.0-TestAdapter","type":"class"},{"id":"ember-4.2.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.2.0-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.2.0-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.2.0-AutoLocation","type":"namespace"},{"id":"ember-4.2.0-FEATURES","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.2.0-ember","type":"module"},{"id":"ember-4.2.0-@ember/enumerable","type":"module"},{"id":"ember-4.2.0-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.2.0-rsvp","type":"module"},{"id":"ember-4.2.0-@ember/debug","type":"module"},{"id":"ember-4.2.0-@ember/component","type":"module"},{"id":"ember-4.2.0-@ember/routing","type":"module"},{"id":"ember-4.2.0-@ember/template","type":"module"},{"id":"ember-4.2.0-@glimmer/component","type":"module"},{"id":"ember-4.2.0-@glimmer/tracking","type":"module"},{"id":"ember-4.2.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.2.0-@ember/object","type":"module"},{"id":"ember-4.2.0-@ember/utils","type":"module"},{"id":"ember-4.2.0-@ember/application","type":"module"},{"id":"ember-4.2.0-@ember/array","type":"module"},{"id":"ember-4.2.0-@ember/canary-features","type":"module"},{"id":"ember-4.2.0-@ember/component/template-only","type":"module"},{"id":"ember-4.2.0-@ember/controller","type":"module"},{"id":"ember-4.2.0-@ember/destroyable","type":"module"},{"id":"ember-4.2.0-@ember/engine","type":"module"},{"id":"ember-4.2.0-@ember/error","type":"module"},{"id":"ember-4.2.0-@ember/helper","type":"module"},{"id":"ember-4.2.0-@ember/polyfills","type":"module"},{"id":"ember-4.2.0-@ember/runloop","type":"module"},{"id":"ember-4.2.0-@ember/service","type":"module"},{"id":"ember-4.2.0-@ember/string","type":"module"},{"id":"ember-4.2.0-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.2.0-Promise":"ember-4.2.0-Promise-e953a8ff09","ember-4.2.0-EventTarget":"ember-4.2.0-EventTarget-ea7ce0d10c","ember-4.2.0-Container":"ember-4.2.0-Container-c4396f09a6","ember-4.2.0-Registry":"ember-4.2.0-Registry-fc078ad52f","ember-4.2.0-EmberENV":"ember-4.2.0-EmberENV-bc13fe1cdd","ember-4.2.0-ContainerDebugAdapter":"ember-4.2.0-ContainerDebugAdapter-95b28a34d2","ember-4.2.0-DataAdapter":"ember-4.2.0-DataAdapter-a72d2d9849","ember-4.2.0-Ember.Templates.helpers":"ember-4.2.0-Ember.Templates.helpers-aa05f78e30","ember-4.2.0-ComponentStateBucket":"ember-4.2.0-ComponentStateBucket-33322ac53c","ember-4.2.0-Component":"ember-4.2.0-Component-d65aaafd4b","ember-4.2.0-Helper":"ember-4.2.0-Helper-fa927a2bb0","ember-4.2.0-ComputedProperty":"ember-4.2.0-ComputedProperty-47a677369f","ember-4.2.0-Descriptor":"ember-4.2.0-Descriptor-eac34686bb","ember-4.2.0-Ember.InjectedProperty":"ember-4.2.0-Ember.InjectedProperty-278c7f97a8","ember-4.2.0-Libraries":"ember-4.2.0-Libraries-c8dc328951","ember-4.2.0-Mixin":"ember-4.2.0-Mixin-d5317e4294","ember-4.2.0-Ember.ControllerMixin":"ember-4.2.0-Ember.ControllerMixin-1f376906a2","ember-4.2.0-Location":"ember-4.2.0-Location-affd212101","ember-4.2.0-HashLocation":"ember-4.2.0-HashLocation-6f1040da73","ember-4.2.0-HistoryLocation":"ember-4.2.0-HistoryLocation-4fe9b0c303","ember-4.2.0-NoneLocation":"ember-4.2.0-NoneLocation-db3cb8c452","ember-4.2.0-RouterService":"ember-4.2.0-RouterService-8a10bc3ade","ember-4.2.0-RoutingService":"ember-4.2.0-RoutingService-71b3a0e7d6","ember-4.2.0-BucketCache":"ember-4.2.0-BucketCache-b7182d3082","ember-4.2.0-RouteInfoWithAttributes":"ember-4.2.0-RouteInfoWithAttributes-1949059641","ember-4.2.0-RouteInfo":"ember-4.2.0-RouteInfo-492eaca499","ember-4.2.0-Route":"ember-4.2.0-Route-0467ae62d6","ember-4.2.0-EmberRouter":"ember-4.2.0-EmberRouter-ce136050b3","ember-4.2.0-Transition":"ember-4.2.0-Transition-1de21fa363","ember-4.2.0-Ember.ProxyMixin":"ember-4.2.0-Ember.ProxyMixin-636cebad42","ember-4.2.0-Ember.ActionHandler":"ember-4.2.0-Ember.ActionHandler-dd0b12c50d","ember-4.2.0-EmberArray":"ember-4.2.0-EmberArray-dd7d5e45cb","ember-4.2.0-MutableArray":"ember-4.2.0-MutableArray-e80dd61506","ember-4.2.0-Ember.NativeArray":"ember-4.2.0-Ember.NativeArray-d126a78662","ember-4.2.0-Ember.Comparable":"ember-4.2.0-Ember.Comparable-e5868ea5c7","ember-4.2.0-ContainerProxyMixin":"ember-4.2.0-ContainerProxyMixin-fd281e03ec","ember-4.2.0-Enumerable":"ember-4.2.0-Enumerable-c4f4d3aa61","ember-4.2.0-Evented":"ember-4.2.0-Evented-c3c1656769","ember-4.2.0-Ember.MutableEnumerable":"ember-4.2.0-Ember.MutableEnumerable-debf989269","ember-4.2.0-Observable":"ember-4.2.0-Observable-c987f713f4","ember-4.2.0-PromiseProxyMixin":"ember-4.2.0-PromiseProxyMixin-0ee270add6","ember-4.2.0-RegistryProxyMixin":"ember-4.2.0-RegistryProxyMixin-7e1fe0007e","ember-4.2.0-Ember.TargetActionSupport":"ember-4.2.0-Ember.TargetActionSupport-ffafc58ad7","ember-4.2.0-ArrayProxy":"ember-4.2.0-ArrayProxy-d241bf0163","ember-4.2.0-CoreObject":"ember-4.2.0-CoreObject-e0de4910c5","ember-4.2.0-Ember.Namespace":"ember-4.2.0-Ember.Namespace-a880994e53","ember-4.2.0-EmberObject":"ember-4.2.0-EmberObject-b9e73e88c3","ember-4.2.0-ObjectProxy":"ember-4.2.0-ObjectProxy-969659b01e","ember-4.2.0-Ember.ActionSupport":"ember-4.2.0-Ember.ActionSupport-ff54233f58","ember-4.2.0-Ember.ClassNamesSupport":"ember-4.2.0-Ember.ClassNamesSupport-0c1ced5f94","ember-4.2.0-Ember.ViewMixin":"ember-4.2.0-Ember.ViewMixin-17f69dbeb2","ember-4.2.0-Ember.EventDispatcher":"ember-4.2.0-Ember.EventDispatcher-1b58df40c5","ember-4.2.0-Ember.CoreView":"ember-4.2.0-Ember.CoreView-f418d982ed","ember-4.2.0-Application":"ember-4.2.0-Application-2607ff3ad0","ember-4.2.0-ApplicationInstance":"ember-4.2.0-ApplicationInstance-778c70b4d1","ember-4.2.0-ApplicationInstance.BootOptions":"ember-4.2.0-ApplicationInstance.BootOptions-861f5137fd","ember-4.2.0-Controller":"ember-4.2.0-Controller-0ceb718a53","ember-4.2.0-Engine":"ember-4.2.0-Engine-a449c31447","ember-4.2.0-EngineInstance":"ember-4.2.0-EngineInstance-cc7ad7238a","ember-4.2.0-Ember.Error":"ember-4.2.0-Ember.Error-a087234bd4","ember-4.2.0-Service":"ember-4.2.0-Service-cef3ce7280","ember-4.2.0-String":"ember-4.2.0-String-80edcb4d22","ember-4.2.0-TestAdapter":"ember-4.2.0-TestAdapter-ed716c813d","ember-4.2.0-Ember.Test.QUnitAdapter":"ember-4.2.0-Ember.Test.QUnitAdapter-23917dc62f","ember-4.2.0-Ember.Test":"ember-4.2.0-Ember.Test-0c06a955ef","ember-4.2.0-Ember":"ember-4.2.0-Ember-9fc1584c70","ember-4.2.0-Ember.Templates.components":"ember-4.2.0-Ember.Templates.components-4ce2e39e53","ember-4.2.0-rsvp":"ember-4.2.0-rsvp-7e1e86af62","ember-4.2.0-@ember/application":"ember-4.2.0-@ember/application-f833b8ff5c","ember-4.2.0-@ember/array":"ember-4.2.0-@ember/array-b001400d68","ember-4.2.0-@ember/component":"ember-4.2.0-@ember/component-33c7a8f6de","ember-4.2.0-@ember/component/helper":"ember-4.2.0-@ember/component/helper-b74a42f401","ember-4.2.0-@ember/component/template-only":"ember-4.2.0-@ember/component/template-only-09a3249863","ember-4.2.0-@ember/controller":"ember-4.2.0-@ember/controller-35aba4ebcb","ember-4.2.0-@ember/debug":"ember-4.2.0-@ember/debug-5151a29715","ember-4.2.0-@ember/destroyable":"ember-4.2.0-@ember/destroyable-285a2306c6","ember-4.2.0-@ember/engine":"ember-4.2.0-@ember/engine-72bab8ef86","ember-4.2.0-@ember/helper":"ember-4.2.0-@ember/helper-833098b4a6","ember-4.2.0-@ember/instrumentation":"ember-4.2.0-@ember/instrumentation-d26ee7a7d9","ember-4.2.0-@ember/object":"ember-4.2.0-@ember/object-580812e3d7","ember-4.2.0-@ember/object/compat":"ember-4.2.0-@ember/object/compat-f4cae836ef","ember-4.2.0-@ember/object/computed":"ember-4.2.0-@ember/object/computed-97f63b5990","ember-4.2.0-@ember/object/evented":"ember-4.2.0-@ember/object/evented-20871288c5","ember-4.2.0-@ember/object/events":"ember-4.2.0-@ember/object/events-db4635ee9f","ember-4.2.0-@ember/object/internals":"ember-4.2.0-@ember/object/internals-1eb82d4a45","ember-4.2.0-@ember/object/mixin":"ember-4.2.0-@ember/object/mixin-248ceacb1c","ember-4.2.0-@ember/object/observers":"ember-4.2.0-@ember/object/observers-1fa178dfda","ember-4.2.0-@ember/polyfills":"ember-4.2.0-@ember/polyfills-311542a3d4","ember-4.2.0-@ember/routing":"ember-4.2.0-@ember/routing-901c02a0fd","ember-4.2.0-@ember/runloop":"ember-4.2.0-@ember/runloop-254ddfc3f9","ember-4.2.0-@ember/service":"ember-4.2.0-@ember/service-f6e60210ed","ember-4.2.0-@ember/template":"ember-4.2.0-@ember/template-71e6ed0f88","ember-4.2.0-@ember/test":"ember-4.2.0-@ember/test-d53686b80b","ember-4.2.0-@ember/utils":"ember-4.2.0-@ember/utils-39cddc591f","ember-4.2.0-@glimmer/tracking":"ember-4.2.0-@glimmer/tracking-c5abca90f9","ember-4.2.0-@glimmer/tracking/primitives/cache":"ember-4.2.0-@glimmer/tracking/primitives/cache-83d6053101"},"namespace":{"ember-4.2.0-AutoLocation":"ember-4.2.0-AutoLocation-6fb57ce111","ember-4.2.0-FEATURES":"ember-4.2.0-FEATURES-2299075d8f","ember-4.2.0-Instrumentation":"ember-4.2.0-Instrumentation-6d326dec6d"},"module":{"ember-4.2.0-rsvp":"ember-4.2.0-rsvp-d931cdcffc","ember-4.2.0-@ember/debug":"ember-4.2.0-@ember/debug-56d6fdbbb1","ember-4.2.0-@ember/component":"ember-4.2.0-@ember/component-2d67285cc1","ember-4.2.0-@ember/routing":"ember-4.2.0-@ember/routing-b114d35adf","ember-4.2.0-ember":"ember-4.2.0-ember-bb4c23c749","ember-4.2.0-@ember/template":"ember-4.2.0-@ember/template-d163c4a107","ember-4.2.0-@glimmer/component":"ember-4.2.0-@glimmer/component-1ac56683f0","ember-4.2.0-@glimmer/tracking":"ember-4.2.0-@glimmer/tracking-05074f97f1","ember-4.2.0-@glimmer/tracking/primitives/cache":"ember-4.2.0-@glimmer/tracking/primitives/cache-6cd18e5393","ember-4.2.0-@ember/object":"ember-4.2.0-@ember/object-4bce51f26c","ember-4.2.0-@ember/utils":"ember-4.2.0-@ember/utils-6886c1fc7f","ember-4.2.0-@ember/application":"ember-4.2.0-@ember/application-dd2297e398","ember-4.2.0-@ember/array":"ember-4.2.0-@ember/array-d5800c9f0c","ember-4.2.0-@ember/enumerable":"ember-4.2.0-@ember/enumerable-5319d13ff8","ember-4.2.0-@ember/canary-features":"ember-4.2.0-@ember/canary-features-0a48b03425","ember-4.2.0-@ember/component/template-only":"ember-4.2.0-@ember/component/template-only-f3f21a67ed","ember-4.2.0-@ember/controller":"ember-4.2.0-@ember/controller-02b93ac2ca","ember-4.2.0-@ember/destroyable":"ember-4.2.0-@ember/destroyable-4aabb0331d","ember-4.2.0-@ember/engine":"ember-4.2.0-@ember/engine-e7c797939f","ember-4.2.0-@ember/error":"ember-4.2.0-@ember/error-25e6543b48","ember-4.2.0-@ember/helper":"ember-4.2.0-@ember/helper-9db9d321db","ember-4.2.0-@ember/instrumentation":"ember-4.2.0-@ember/instrumentation-dba3017579","ember-4.2.0-@ember/polyfills":"ember-4.2.0-@ember/polyfills-2989e00ec5","ember-4.2.0-@ember/runloop":"ember-4.2.0-@ember/runloop-a442abf433","ember-4.2.0-@ember/service":"ember-4.2.0-@ember/service-619cd0b129","ember-4.2.0-@ember/string":"ember-4.2.0-@ember/string-d6f75ad19a","ember-4.2.0-@ember/test":"ember-4.2.0-@ember/test-9e115ce88e"},"missing":{"Ember.Object":"Ember.Object-9c32970d20","Error":"Error-158974c414"}}} \ No newline at end of file diff --git a/rev-index/ember-4.3.0.json b/rev-index/ember-4.3.0.json index 1a2db2f84..41fd68ec9 100644 --- a/rev-index/ember-4.3.0.json +++ b/rev-index/ember-4.3.0.json @@ -1 +1 @@ -{"data":{"id":"ember-4.3.0","type":"project-version","attributes":{"version":"4.3.0"},"relationships":{"classes":{"data":[{"id":"ember-4.3.0-Promise","type":"class"},{"id":"ember-4.3.0-EventTarget","type":"class"},{"id":"ember-4.3.0-Container","type":"class"},{"id":"ember-4.3.0-Registry","type":"class"},{"id":"ember-4.3.0-EmberENV","type":"class"},{"id":"ember-4.3.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.3.0-DataAdapter","type":"class"},{"id":"ember-4.3.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.3.0-ComponentStateBucket","type":"class"},{"id":"ember-4.3.0-Component","type":"class"},{"id":"ember-4.3.0-Helper","type":"class"},{"id":"ember-4.3.0-ComputedProperty","type":"class"},{"id":"ember-4.3.0-Descriptor","type":"class"},{"id":"ember-4.3.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.3.0-Libraries","type":"class"},{"id":"ember-4.3.0-Mixin","type":"class"},{"id":"ember-4.3.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.3.0-Location","type":"class"},{"id":"ember-4.3.0-HashLocation","type":"class"},{"id":"ember-4.3.0-HistoryLocation","type":"class"},{"id":"ember-4.3.0-NoneLocation","type":"class"},{"id":"ember-4.3.0-RouterService","type":"class"},{"id":"ember-4.3.0-RoutingService","type":"class"},{"id":"ember-4.3.0-BucketCache","type":"class"},{"id":"ember-4.3.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.3.0-RouteInfo","type":"class"},{"id":"ember-4.3.0-Route","type":"class"},{"id":"ember-4.3.0-EmberRouter","type":"class"},{"id":"ember-4.3.0-Transition","type":"class"},{"id":"ember-4.3.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.3.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.3.0-EmberArray","type":"class"},{"id":"ember-4.3.0-MutableArray","type":"class"},{"id":"ember-4.3.0-Ember.NativeArray","type":"class"},{"id":"ember-4.3.0-Ember.Comparable","type":"class"},{"id":"ember-4.3.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.3.0-Enumerable","type":"class"},{"id":"ember-4.3.0-Evented","type":"class"},{"id":"ember-4.3.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.3.0-Observable","type":"class"},{"id":"ember-4.3.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.3.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.3.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.3.0-ArrayProxy","type":"class"},{"id":"ember-4.3.0-CoreObject","type":"class"},{"id":"ember-4.3.0-Namespace","type":"class"},{"id":"ember-4.3.0-EmberObject","type":"class"},{"id":"ember-4.3.0-ObjectProxy","type":"class"},{"id":"ember-4.3.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.3.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.3.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.3.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.3.0-Ember.CoreView","type":"class"},{"id":"ember-4.3.0-Application","type":"class"},{"id":"ember-4.3.0-ApplicationInstance","type":"class"},{"id":"ember-4.3.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.3.0-Controller","type":"class"},{"id":"ember-4.3.0-Engine","type":"class"},{"id":"ember-4.3.0-EngineInstance","type":"class"},{"id":"ember-4.3.0-Ember.Error","type":"class"},{"id":"ember-4.3.0-Service","type":"class"},{"id":"ember-4.3.0-String","type":"class"},{"id":"ember-4.3.0-TestAdapter","type":"class"},{"id":"ember-4.3.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.3.0-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.3.0-AutoLocation","type":"namespace"},{"id":"ember-4.3.0-FEATURES","type":"namespace"},{"id":"ember-4.3.0-Instrumentation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.3.0-rsvp","type":"module"},{"id":"ember-4.3.0-@ember/debug","type":"module"},{"id":"ember-4.3.0-@ember/component","type":"module"},{"id":"ember-4.3.0-@ember/routing","type":"module"},{"id":"ember-4.3.0-ember","type":"module"},{"id":"ember-4.3.0-@ember/template","type":"module"},{"id":"ember-4.3.0-@glimmer/component","type":"module"},{"id":"ember-4.3.0-@glimmer/tracking","type":"module"},{"id":"ember-4.3.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.3.0-@ember/object","type":"module"},{"id":"ember-4.3.0-@ember/utils","type":"module"},{"id":"ember-4.3.0-@ember/application","type":"module"},{"id":"ember-4.3.0-@ember/array","type":"module"},{"id":"ember-4.3.0-@ember/enumerable","type":"module"},{"id":"ember-4.3.0-@ember/canary-features","type":"module"},{"id":"ember-4.3.0-@ember/component/template-only","type":"module"},{"id":"ember-4.3.0-@ember/controller","type":"module"},{"id":"ember-4.3.0-@ember/destroyable","type":"module"},{"id":"ember-4.3.0-@ember/engine","type":"module"},{"id":"ember-4.3.0-@ember/error","type":"module"},{"id":"ember-4.3.0-@ember/helper","type":"module"},{"id":"ember-4.3.0-@ember/instrumentation","type":"module"},{"id":"ember-4.3.0-@ember/polyfills","type":"module"},{"id":"ember-4.3.0-@ember/runloop","type":"module"},{"id":"ember-4.3.0-@ember/service","type":"module"},{"id":"ember-4.3.0-@ember/string","type":"module"},{"id":"ember-4.3.0-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.3.0-Container","type":"class"},{"id":"ember-4.3.0-Registry","type":"class"},{"id":"ember-4.3.0-ComponentStateBucket","type":"class"},{"id":"ember-4.3.0-Descriptor","type":"class"},{"id":"ember-4.3.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.3.0-Libraries","type":"class"},{"id":"ember-4.3.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.3.0-Location","type":"class"},{"id":"ember-4.3.0-RoutingService","type":"class"},{"id":"ember-4.3.0-BucketCache","type":"class"},{"id":"ember-4.3.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.3.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.3.0-Ember.Comparable","type":"class"},{"id":"ember-4.3.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.3.0-Enumerable","type":"class"},{"id":"ember-4.3.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.3.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.3.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.3.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.3.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.3.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.3.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.3.0-Ember.CoreView","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.3.0-Promise","type":"class"},{"id":"ember-4.3.0-EventTarget","type":"class"},{"id":"ember-4.3.0-EmberENV","type":"class"},{"id":"ember-4.3.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.3.0-DataAdapter","type":"class"},{"id":"ember-4.3.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.3.0-Component","type":"class"},{"id":"ember-4.3.0-Helper","type":"class"},{"id":"ember-4.3.0-ComputedProperty","type":"class"},{"id":"ember-4.3.0-Mixin","type":"class"},{"id":"ember-4.3.0-HashLocation","type":"class"},{"id":"ember-4.3.0-HistoryLocation","type":"class"},{"id":"ember-4.3.0-NoneLocation","type":"class"},{"id":"ember-4.3.0-RouterService","type":"class"},{"id":"ember-4.3.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.3.0-RouteInfo","type":"class"},{"id":"ember-4.3.0-Route","type":"class"},{"id":"ember-4.3.0-EmberRouter","type":"class"},{"id":"ember-4.3.0-Transition","type":"class"},{"id":"ember-4.3.0-EmberArray","type":"class"},{"id":"ember-4.3.0-MutableArray","type":"class"},{"id":"ember-4.3.0-Ember.NativeArray","type":"class"},{"id":"ember-4.3.0-Evented","type":"class"},{"id":"ember-4.3.0-Observable","type":"class"},{"id":"ember-4.3.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.3.0-ArrayProxy","type":"class"},{"id":"ember-4.3.0-CoreObject","type":"class"},{"id":"ember-4.3.0-Namespace","type":"class"},{"id":"ember-4.3.0-EmberObject","type":"class"},{"id":"ember-4.3.0-ObjectProxy","type":"class"},{"id":"ember-4.3.0-Application","type":"class"},{"id":"ember-4.3.0-ApplicationInstance","type":"class"},{"id":"ember-4.3.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.3.0-Controller","type":"class"},{"id":"ember-4.3.0-Engine","type":"class"},{"id":"ember-4.3.0-EngineInstance","type":"class"},{"id":"ember-4.3.0-Ember.Error","type":"class"},{"id":"ember-4.3.0-Service","type":"class"},{"id":"ember-4.3.0-String","type":"class"},{"id":"ember-4.3.0-TestAdapter","type":"class"},{"id":"ember-4.3.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.3.0-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.3.0-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.3.0-AutoLocation","type":"namespace"},{"id":"ember-4.3.0-FEATURES","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.3.0-ember","type":"module"},{"id":"ember-4.3.0-@ember/enumerable","type":"module"},{"id":"ember-4.3.0-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.3.0-rsvp","type":"module"},{"id":"ember-4.3.0-@ember/debug","type":"module"},{"id":"ember-4.3.0-@ember/component","type":"module"},{"id":"ember-4.3.0-@ember/routing","type":"module"},{"id":"ember-4.3.0-@ember/template","type":"module"},{"id":"ember-4.3.0-@glimmer/component","type":"module"},{"id":"ember-4.3.0-@glimmer/tracking","type":"module"},{"id":"ember-4.3.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.3.0-@ember/object","type":"module"},{"id":"ember-4.3.0-@ember/utils","type":"module"},{"id":"ember-4.3.0-@ember/application","type":"module"},{"id":"ember-4.3.0-@ember/array","type":"module"},{"id":"ember-4.3.0-@ember/canary-features","type":"module"},{"id":"ember-4.3.0-@ember/component/template-only","type":"module"},{"id":"ember-4.3.0-@ember/controller","type":"module"},{"id":"ember-4.3.0-@ember/destroyable","type":"module"},{"id":"ember-4.3.0-@ember/engine","type":"module"},{"id":"ember-4.3.0-@ember/error","type":"module"},{"id":"ember-4.3.0-@ember/helper","type":"module"},{"id":"ember-4.3.0-@ember/polyfills","type":"module"},{"id":"ember-4.3.0-@ember/runloop","type":"module"},{"id":"ember-4.3.0-@ember/service","type":"module"},{"id":"ember-4.3.0-@ember/string","type":"module"},{"id":"ember-4.3.0-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.3.0-Promise":"ember-4.3.0-Promise-200ed82432","ember-4.3.0-EventTarget":"ember-4.3.0-EventTarget-c0fdec96f9","ember-4.3.0-Container":"ember-4.3.0-Container-54a3aafd21","ember-4.3.0-Registry":"ember-4.3.0-Registry-9d0f1dbd60","ember-4.3.0-EmberENV":"ember-4.3.0-EmberENV-91aaf2a72a","ember-4.3.0-ContainerDebugAdapter":"ember-4.3.0-ContainerDebugAdapter-e523a98554","ember-4.3.0-DataAdapter":"ember-4.3.0-DataAdapter-77973d029d","ember-4.3.0-Ember.Templates.helpers":"ember-4.3.0-Ember.Templates.helpers-0628d28c02","ember-4.3.0-ComponentStateBucket":"ember-4.3.0-ComponentStateBucket-dbc4c3aa02","ember-4.3.0-Component":"ember-4.3.0-Component-7c5a569b76","ember-4.3.0-Helper":"ember-4.3.0-Helper-6cc8eeb561","ember-4.3.0-ComputedProperty":"ember-4.3.0-ComputedProperty-7d8a8443bb","ember-4.3.0-Descriptor":"ember-4.3.0-Descriptor-eeedee82ad","ember-4.3.0-Ember.InjectedProperty":"ember-4.3.0-Ember.InjectedProperty-8a57f28560","ember-4.3.0-Libraries":"ember-4.3.0-Libraries-71f3def824","ember-4.3.0-Mixin":"ember-4.3.0-Mixin-300df07a36","ember-4.3.0-Ember.ControllerMixin":"ember-4.3.0-Ember.ControllerMixin-3385a45496","ember-4.3.0-Location":"ember-4.3.0-Location-0fa7ee1077","ember-4.3.0-HashLocation":"ember-4.3.0-HashLocation-31483185fc","ember-4.3.0-HistoryLocation":"ember-4.3.0-HistoryLocation-ea13c7ee81","ember-4.3.0-NoneLocation":"ember-4.3.0-NoneLocation-1024268b9c","ember-4.3.0-RouterService":"ember-4.3.0-RouterService-642666b2c8","ember-4.3.0-RoutingService":"ember-4.3.0-RoutingService-81fc040ddb","ember-4.3.0-BucketCache":"ember-4.3.0-BucketCache-8613fbd25c","ember-4.3.0-RouteInfoWithAttributes":"ember-4.3.0-RouteInfoWithAttributes-f4f4cec6bd","ember-4.3.0-RouteInfo":"ember-4.3.0-RouteInfo-a45beb5230","ember-4.3.0-Route":"ember-4.3.0-Route-bde6e84d7a","ember-4.3.0-EmberRouter":"ember-4.3.0-EmberRouter-bed92a290c","ember-4.3.0-Transition":"ember-4.3.0-Transition-d0b1a66b77","ember-4.3.0-Ember.ProxyMixin":"ember-4.3.0-Ember.ProxyMixin-300d00c66f","ember-4.3.0-Ember.ActionHandler":"ember-4.3.0-Ember.ActionHandler-a232eb3b70","ember-4.3.0-EmberArray":"ember-4.3.0-EmberArray-b4d37cec4e","ember-4.3.0-MutableArray":"ember-4.3.0-MutableArray-c64496f714","ember-4.3.0-Ember.NativeArray":"ember-4.3.0-Ember.NativeArray-ed55b7a8f2","ember-4.3.0-Ember.Comparable":"ember-4.3.0-Ember.Comparable-20734cc5a9","ember-4.3.0-ContainerProxyMixin":"ember-4.3.0-ContainerProxyMixin-c7ef28e4ab","ember-4.3.0-Enumerable":"ember-4.3.0-Enumerable-cce828b00d","ember-4.3.0-Evented":"ember-4.3.0-Evented-cc96fb2939","ember-4.3.0-Ember.MutableEnumerable":"ember-4.3.0-Ember.MutableEnumerable-11c51ddd0b","ember-4.3.0-Observable":"ember-4.3.0-Observable-7ad0bf97c3","ember-4.3.0-PromiseProxyMixin":"ember-4.3.0-PromiseProxyMixin-69368fa05e","ember-4.3.0-RegistryProxyMixin":"ember-4.3.0-RegistryProxyMixin-a6cb818689","ember-4.3.0-Ember.TargetActionSupport":"ember-4.3.0-Ember.TargetActionSupport-afb93645bc","ember-4.3.0-ArrayProxy":"ember-4.3.0-ArrayProxy-768c498441","ember-4.3.0-CoreObject":"ember-4.3.0-CoreObject-ffcd5eb2c6","ember-4.3.0-Namespace":"ember-4.3.0-Namespace-66e5073f74","ember-4.3.0-EmberObject":"ember-4.3.0-EmberObject-9c216c3385","ember-4.3.0-ObjectProxy":"ember-4.3.0-ObjectProxy-2c62a91b58","ember-4.3.0-Ember.ActionSupport":"ember-4.3.0-Ember.ActionSupport-864952fa23","ember-4.3.0-Ember.ClassNamesSupport":"ember-4.3.0-Ember.ClassNamesSupport-d5dcbaedd8","ember-4.3.0-Ember.ViewMixin":"ember-4.3.0-Ember.ViewMixin-58949d3b98","ember-4.3.0-Ember.EventDispatcher":"ember-4.3.0-Ember.EventDispatcher-599ee673c5","ember-4.3.0-Ember.CoreView":"ember-4.3.0-Ember.CoreView-6968b0d580","ember-4.3.0-Application":"ember-4.3.0-Application-083a2211f7","ember-4.3.0-ApplicationInstance":"ember-4.3.0-ApplicationInstance-0a85368e74","ember-4.3.0-ApplicationInstance.BootOptions":"ember-4.3.0-ApplicationInstance.BootOptions-31b14e8d6c","ember-4.3.0-Controller":"ember-4.3.0-Controller-b5f3cf8743","ember-4.3.0-Engine":"ember-4.3.0-Engine-95d9291d11","ember-4.3.0-EngineInstance":"ember-4.3.0-EngineInstance-bccf404bbc","ember-4.3.0-Ember.Error":"ember-4.3.0-Ember.Error-ea1c6804b5","ember-4.3.0-Service":"ember-4.3.0-Service-5bafc0f586","ember-4.3.0-String":"ember-4.3.0-String-1b3db5dd5f","ember-4.3.0-TestAdapter":"ember-4.3.0-TestAdapter-7850dc1248","ember-4.3.0-Ember.Test.QUnitAdapter":"ember-4.3.0-Ember.Test.QUnitAdapter-b7543b0b2a","ember-4.3.0-Ember.Test":"ember-4.3.0-Ember.Test-3aaafe237f","ember-4.3.0-Ember":"ember-4.3.0-Ember-edf515c4f5","ember-4.3.0-Ember.Templates.components":"ember-4.3.0-Ember.Templates.components-b47d6ad279","ember-4.3.0-rsvp":"ember-4.3.0-rsvp-eb7915a75c","ember-4.3.0-@ember/application":"ember-4.3.0-@ember/application-07cdd1fc98","ember-4.3.0-@ember/array":"ember-4.3.0-@ember/array-c533151d07","ember-4.3.0-@ember/component":"ember-4.3.0-@ember/component-fabe2da313","ember-4.3.0-@ember/component/helper":"ember-4.3.0-@ember/component/helper-b11cefcbab","ember-4.3.0-@ember/component/template-only":"ember-4.3.0-@ember/component/template-only-00b2b626f1","ember-4.3.0-@ember/controller":"ember-4.3.0-@ember/controller-3e28ed89dc","ember-4.3.0-@ember/debug":"ember-4.3.0-@ember/debug-292dfd4a8c","ember-4.3.0-@ember/destroyable":"ember-4.3.0-@ember/destroyable-4ead650874","ember-4.3.0-@ember/engine":"ember-4.3.0-@ember/engine-fdea2f4489","ember-4.3.0-@ember/helper":"ember-4.3.0-@ember/helper-77e9d8bede","ember-4.3.0-@ember/instrumentation":"ember-4.3.0-@ember/instrumentation-393aa41072","ember-4.3.0-@ember/object":"ember-4.3.0-@ember/object-3b60684078","ember-4.3.0-@ember/object/compat":"ember-4.3.0-@ember/object/compat-e5071de000","ember-4.3.0-@ember/object/computed":"ember-4.3.0-@ember/object/computed-4c6c93881e","ember-4.3.0-@ember/object/evented":"ember-4.3.0-@ember/object/evented-48db4ee41d","ember-4.3.0-@ember/object/events":"ember-4.3.0-@ember/object/events-319569d605","ember-4.3.0-@ember/object/internals":"ember-4.3.0-@ember/object/internals-3f6404d2eb","ember-4.3.0-@ember/object/mixin":"ember-4.3.0-@ember/object/mixin-6cd5197273","ember-4.3.0-@ember/object/observers":"ember-4.3.0-@ember/object/observers-7ab7ec896c","ember-4.3.0-@ember/polyfills":"ember-4.3.0-@ember/polyfills-8ee8efad90","ember-4.3.0-@ember/routing":"ember-4.3.0-@ember/routing-55b55d7b41","ember-4.3.0-@ember/runloop":"ember-4.3.0-@ember/runloop-621b9fe56b","ember-4.3.0-@ember/service":"ember-4.3.0-@ember/service-aba7212977","ember-4.3.0-@ember/template":"ember-4.3.0-@ember/template-1c15305f7b","ember-4.3.0-@ember/test":"ember-4.3.0-@ember/test-c7422033ff","ember-4.3.0-@ember/utils":"ember-4.3.0-@ember/utils-92eeef1fbc","ember-4.3.0-@glimmer/tracking":"ember-4.3.0-@glimmer/tracking-02c1516fea","ember-4.3.0-@glimmer/tracking/primitives/cache":"ember-4.3.0-@glimmer/tracking/primitives/cache-533eae8dc6"},"namespace":{"ember-4.3.0-AutoLocation":"ember-4.3.0-AutoLocation-ac0f5e7293","ember-4.3.0-FEATURES":"ember-4.3.0-FEATURES-0ae822daf4","ember-4.3.0-Instrumentation":"ember-4.3.0-Instrumentation-adca5eebb8"},"module":{"ember-4.3.0-rsvp":"ember-4.3.0-rsvp-ba07eaece0","ember-4.3.0-@ember/debug":"ember-4.3.0-@ember/debug-5e78c71571","ember-4.3.0-@ember/component":"ember-4.3.0-@ember/component-31a329eb54","ember-4.3.0-@ember/routing":"ember-4.3.0-@ember/routing-47a7a7fad1","ember-4.3.0-ember":"ember-4.3.0-ember-395b14f47d","ember-4.3.0-@ember/template":"ember-4.3.0-@ember/template-3221103265","ember-4.3.0-@glimmer/component":"ember-4.3.0-@glimmer/component-7451f13538","ember-4.3.0-@glimmer/tracking":"ember-4.3.0-@glimmer/tracking-3dbd17acbc","ember-4.3.0-@glimmer/tracking/primitives/cache":"ember-4.3.0-@glimmer/tracking/primitives/cache-677b038f7d","ember-4.3.0-@ember/object":"ember-4.3.0-@ember/object-27c97d2d18","ember-4.3.0-@ember/utils":"ember-4.3.0-@ember/utils-75abf6a4aa","ember-4.3.0-@ember/application":"ember-4.3.0-@ember/application-652c0c4fa0","ember-4.3.0-@ember/array":"ember-4.3.0-@ember/array-8c5fa12469","ember-4.3.0-@ember/enumerable":"ember-4.3.0-@ember/enumerable-6ae2ff9ce7","ember-4.3.0-@ember/canary-features":"ember-4.3.0-@ember/canary-features-da8a110f1d","ember-4.3.0-@ember/component/template-only":"ember-4.3.0-@ember/component/template-only-72068e02d1","ember-4.3.0-@ember/controller":"ember-4.3.0-@ember/controller-cadffcb248","ember-4.3.0-@ember/destroyable":"ember-4.3.0-@ember/destroyable-dd195fd1fc","ember-4.3.0-@ember/engine":"ember-4.3.0-@ember/engine-68956c17ba","ember-4.3.0-@ember/error":"ember-4.3.0-@ember/error-5baa11ddd1","ember-4.3.0-@ember/helper":"ember-4.3.0-@ember/helper-532d501dee","ember-4.3.0-@ember/instrumentation":"ember-4.3.0-@ember/instrumentation-9376297447","ember-4.3.0-@ember/polyfills":"ember-4.3.0-@ember/polyfills-9a77fbda0e","ember-4.3.0-@ember/runloop":"ember-4.3.0-@ember/runloop-28b310b226","ember-4.3.0-@ember/service":"ember-4.3.0-@ember/service-663f6e7d51","ember-4.3.0-@ember/string":"ember-4.3.0-@ember/string-ae6df77144","ember-4.3.0-@ember/test":"ember-4.3.0-@ember/test-c954ed43db"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Ember.Object":"Ember.Object-9c32970d20","Error":"Error-158974c414"}}} \ No newline at end of file +{"data":{"id":"ember-4.3.0","type":"project-version","attributes":{"version":"4.3.0"},"relationships":{"classes":{"data":[{"id":"ember-4.3.0-Promise","type":"class"},{"id":"ember-4.3.0-EventTarget","type":"class"},{"id":"ember-4.3.0-Container","type":"class"},{"id":"ember-4.3.0-Registry","type":"class"},{"id":"ember-4.3.0-EmberENV","type":"class"},{"id":"ember-4.3.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.3.0-DataAdapter","type":"class"},{"id":"ember-4.3.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.3.0-ComponentStateBucket","type":"class"},{"id":"ember-4.3.0-Component","type":"class"},{"id":"ember-4.3.0-Helper","type":"class"},{"id":"ember-4.3.0-ComputedProperty","type":"class"},{"id":"ember-4.3.0-Descriptor","type":"class"},{"id":"ember-4.3.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.3.0-Libraries","type":"class"},{"id":"ember-4.3.0-Mixin","type":"class"},{"id":"ember-4.3.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.3.0-Location","type":"class"},{"id":"ember-4.3.0-HashLocation","type":"class"},{"id":"ember-4.3.0-HistoryLocation","type":"class"},{"id":"ember-4.3.0-NoneLocation","type":"class"},{"id":"ember-4.3.0-RouterService","type":"class"},{"id":"ember-4.3.0-RoutingService","type":"class"},{"id":"ember-4.3.0-BucketCache","type":"class"},{"id":"ember-4.3.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.3.0-RouteInfo","type":"class"},{"id":"ember-4.3.0-Route","type":"class"},{"id":"ember-4.3.0-EmberRouter","type":"class"},{"id":"ember-4.3.0-Transition","type":"class"},{"id":"ember-4.3.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.3.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.3.0-EmberArray","type":"class"},{"id":"ember-4.3.0-MutableArray","type":"class"},{"id":"ember-4.3.0-Ember.NativeArray","type":"class"},{"id":"ember-4.3.0-Ember.Comparable","type":"class"},{"id":"ember-4.3.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.3.0-Enumerable","type":"class"},{"id":"ember-4.3.0-Evented","type":"class"},{"id":"ember-4.3.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.3.0-Observable","type":"class"},{"id":"ember-4.3.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.3.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.3.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.3.0-ArrayProxy","type":"class"},{"id":"ember-4.3.0-CoreObject","type":"class"},{"id":"ember-4.3.0-Namespace","type":"class"},{"id":"ember-4.3.0-EmberObject","type":"class"},{"id":"ember-4.3.0-ObjectProxy","type":"class"},{"id":"ember-4.3.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.3.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.3.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.3.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.3.0-Ember.CoreView","type":"class"},{"id":"ember-4.3.0-Application","type":"class"},{"id":"ember-4.3.0-ApplicationInstance","type":"class"},{"id":"ember-4.3.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.3.0-Controller","type":"class"},{"id":"ember-4.3.0-Engine","type":"class"},{"id":"ember-4.3.0-EngineInstance","type":"class"},{"id":"ember-4.3.0-Ember.Error","type":"class"},{"id":"ember-4.3.0-Service","type":"class"},{"id":"ember-4.3.0-String","type":"class"},{"id":"ember-4.3.0-TestAdapter","type":"class"},{"id":"ember-4.3.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.3.0-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.3.0-AutoLocation","type":"namespace"},{"id":"ember-4.3.0-FEATURES","type":"namespace"},{"id":"ember-4.3.0-Instrumentation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.3.0-rsvp","type":"module"},{"id":"ember-4.3.0-@ember/debug","type":"module"},{"id":"ember-4.3.0-@ember/component","type":"module"},{"id":"ember-4.3.0-@ember/routing","type":"module"},{"id":"ember-4.3.0-ember","type":"module"},{"id":"ember-4.3.0-@ember/template","type":"module"},{"id":"ember-4.3.0-@glimmer/component","type":"module"},{"id":"ember-4.3.0-@glimmer/tracking","type":"module"},{"id":"ember-4.3.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.3.0-@ember/object","type":"module"},{"id":"ember-4.3.0-@ember/utils","type":"module"},{"id":"ember-4.3.0-@ember/application","type":"module"},{"id":"ember-4.3.0-@ember/array","type":"module"},{"id":"ember-4.3.0-@ember/enumerable","type":"module"},{"id":"ember-4.3.0-@ember/canary-features","type":"module"},{"id":"ember-4.3.0-@ember/component/template-only","type":"module"},{"id":"ember-4.3.0-@ember/controller","type":"module"},{"id":"ember-4.3.0-@ember/destroyable","type":"module"},{"id":"ember-4.3.0-@ember/engine","type":"module"},{"id":"ember-4.3.0-@ember/error","type":"module"},{"id":"ember-4.3.0-@ember/helper","type":"module"},{"id":"ember-4.3.0-@ember/instrumentation","type":"module"},{"id":"ember-4.3.0-@ember/polyfills","type":"module"},{"id":"ember-4.3.0-@ember/runloop","type":"module"},{"id":"ember-4.3.0-@ember/service","type":"module"},{"id":"ember-4.3.0-@ember/string","type":"module"},{"id":"ember-4.3.0-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.3.0-Container","type":"class"},{"id":"ember-4.3.0-Registry","type":"class"},{"id":"ember-4.3.0-ComponentStateBucket","type":"class"},{"id":"ember-4.3.0-Descriptor","type":"class"},{"id":"ember-4.3.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.3.0-Libraries","type":"class"},{"id":"ember-4.3.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.3.0-Location","type":"class"},{"id":"ember-4.3.0-RoutingService","type":"class"},{"id":"ember-4.3.0-BucketCache","type":"class"},{"id":"ember-4.3.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.3.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.3.0-Ember.Comparable","type":"class"},{"id":"ember-4.3.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.3.0-Enumerable","type":"class"},{"id":"ember-4.3.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.3.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.3.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.3.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.3.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.3.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.3.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.3.0-Ember.CoreView","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.3.0-Promise","type":"class"},{"id":"ember-4.3.0-EventTarget","type":"class"},{"id":"ember-4.3.0-EmberENV","type":"class"},{"id":"ember-4.3.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.3.0-DataAdapter","type":"class"},{"id":"ember-4.3.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.3.0-Component","type":"class"},{"id":"ember-4.3.0-Helper","type":"class"},{"id":"ember-4.3.0-ComputedProperty","type":"class"},{"id":"ember-4.3.0-Mixin","type":"class"},{"id":"ember-4.3.0-HashLocation","type":"class"},{"id":"ember-4.3.0-HistoryLocation","type":"class"},{"id":"ember-4.3.0-NoneLocation","type":"class"},{"id":"ember-4.3.0-RouterService","type":"class"},{"id":"ember-4.3.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.3.0-RouteInfo","type":"class"},{"id":"ember-4.3.0-Route","type":"class"},{"id":"ember-4.3.0-EmberRouter","type":"class"},{"id":"ember-4.3.0-Transition","type":"class"},{"id":"ember-4.3.0-EmberArray","type":"class"},{"id":"ember-4.3.0-MutableArray","type":"class"},{"id":"ember-4.3.0-Ember.NativeArray","type":"class"},{"id":"ember-4.3.0-Evented","type":"class"},{"id":"ember-4.3.0-Observable","type":"class"},{"id":"ember-4.3.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.3.0-ArrayProxy","type":"class"},{"id":"ember-4.3.0-CoreObject","type":"class"},{"id":"ember-4.3.0-Namespace","type":"class"},{"id":"ember-4.3.0-EmberObject","type":"class"},{"id":"ember-4.3.0-ObjectProxy","type":"class"},{"id":"ember-4.3.0-Application","type":"class"},{"id":"ember-4.3.0-ApplicationInstance","type":"class"},{"id":"ember-4.3.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.3.0-Controller","type":"class"},{"id":"ember-4.3.0-Engine","type":"class"},{"id":"ember-4.3.0-EngineInstance","type":"class"},{"id":"ember-4.3.0-Ember.Error","type":"class"},{"id":"ember-4.3.0-Service","type":"class"},{"id":"ember-4.3.0-String","type":"class"},{"id":"ember-4.3.0-TestAdapter","type":"class"},{"id":"ember-4.3.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.3.0-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.3.0-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.3.0-AutoLocation","type":"namespace"},{"id":"ember-4.3.0-FEATURES","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.3.0-ember","type":"module"},{"id":"ember-4.3.0-@ember/enumerable","type":"module"},{"id":"ember-4.3.0-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.3.0-rsvp","type":"module"},{"id":"ember-4.3.0-@ember/debug","type":"module"},{"id":"ember-4.3.0-@ember/component","type":"module"},{"id":"ember-4.3.0-@ember/routing","type":"module"},{"id":"ember-4.3.0-@ember/template","type":"module"},{"id":"ember-4.3.0-@glimmer/component","type":"module"},{"id":"ember-4.3.0-@glimmer/tracking","type":"module"},{"id":"ember-4.3.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.3.0-@ember/object","type":"module"},{"id":"ember-4.3.0-@ember/utils","type":"module"},{"id":"ember-4.3.0-@ember/application","type":"module"},{"id":"ember-4.3.0-@ember/array","type":"module"},{"id":"ember-4.3.0-@ember/canary-features","type":"module"},{"id":"ember-4.3.0-@ember/component/template-only","type":"module"},{"id":"ember-4.3.0-@ember/controller","type":"module"},{"id":"ember-4.3.0-@ember/destroyable","type":"module"},{"id":"ember-4.3.0-@ember/engine","type":"module"},{"id":"ember-4.3.0-@ember/error","type":"module"},{"id":"ember-4.3.0-@ember/helper","type":"module"},{"id":"ember-4.3.0-@ember/polyfills","type":"module"},{"id":"ember-4.3.0-@ember/runloop","type":"module"},{"id":"ember-4.3.0-@ember/service","type":"module"},{"id":"ember-4.3.0-@ember/string","type":"module"},{"id":"ember-4.3.0-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.3.0-Promise":"ember-4.3.0-Promise-8fc1ed98f3","ember-4.3.0-EventTarget":"ember-4.3.0-EventTarget-c0fdec96f9","ember-4.3.0-Container":"ember-4.3.0-Container-4003e8981e","ember-4.3.0-Registry":"ember-4.3.0-Registry-de553b1e0b","ember-4.3.0-EmberENV":"ember-4.3.0-EmberENV-91aaf2a72a","ember-4.3.0-ContainerDebugAdapter":"ember-4.3.0-ContainerDebugAdapter-159b82e26a","ember-4.3.0-DataAdapter":"ember-4.3.0-DataAdapter-c533722546","ember-4.3.0-Ember.Templates.helpers":"ember-4.3.0-Ember.Templates.helpers-4cdf501702","ember-4.3.0-ComponentStateBucket":"ember-4.3.0-ComponentStateBucket-dbc4c3aa02","ember-4.3.0-Component":"ember-4.3.0-Component-1ee9b7e1f0","ember-4.3.0-Helper":"ember-4.3.0-Helper-83273908c3","ember-4.3.0-ComputedProperty":"ember-4.3.0-ComputedProperty-b804ac6c7a","ember-4.3.0-Descriptor":"ember-4.3.0-Descriptor-eeedee82ad","ember-4.3.0-Ember.InjectedProperty":"ember-4.3.0-Ember.InjectedProperty-8a57f28560","ember-4.3.0-Libraries":"ember-4.3.0-Libraries-71f3def824","ember-4.3.0-Mixin":"ember-4.3.0-Mixin-33919892db","ember-4.3.0-Ember.ControllerMixin":"ember-4.3.0-Ember.ControllerMixin-babdab641d","ember-4.3.0-Location":"ember-4.3.0-Location-f7076a33e7","ember-4.3.0-HashLocation":"ember-4.3.0-HashLocation-148ef430a3","ember-4.3.0-HistoryLocation":"ember-4.3.0-HistoryLocation-478ffb946e","ember-4.3.0-NoneLocation":"ember-4.3.0-NoneLocation-e60c140d56","ember-4.3.0-RouterService":"ember-4.3.0-RouterService-9383729787","ember-4.3.0-RoutingService":"ember-4.3.0-RoutingService-81fc040ddb","ember-4.3.0-BucketCache":"ember-4.3.0-BucketCache-8613fbd25c","ember-4.3.0-RouteInfoWithAttributes":"ember-4.3.0-RouteInfoWithAttributes-c52bfe1524","ember-4.3.0-RouteInfo":"ember-4.3.0-RouteInfo-018c924133","ember-4.3.0-Route":"ember-4.3.0-Route-bd160e0495","ember-4.3.0-EmberRouter":"ember-4.3.0-EmberRouter-7846337a35","ember-4.3.0-Transition":"ember-4.3.0-Transition-d0b1a66b77","ember-4.3.0-Ember.ProxyMixin":"ember-4.3.0-Ember.ProxyMixin-300d00c66f","ember-4.3.0-Ember.ActionHandler":"ember-4.3.0-Ember.ActionHandler-9057a63186","ember-4.3.0-EmberArray":"ember-4.3.0-EmberArray-809404702f","ember-4.3.0-MutableArray":"ember-4.3.0-MutableArray-1b8748f291","ember-4.3.0-Ember.NativeArray":"ember-4.3.0-Ember.NativeArray-2f07a774e6","ember-4.3.0-Ember.Comparable":"ember-4.3.0-Ember.Comparable-20734cc5a9","ember-4.3.0-ContainerProxyMixin":"ember-4.3.0-ContainerProxyMixin-5018218740","ember-4.3.0-Enumerable":"ember-4.3.0-Enumerable-cce828b00d","ember-4.3.0-Evented":"ember-4.3.0-Evented-05e295721a","ember-4.3.0-Ember.MutableEnumerable":"ember-4.3.0-Ember.MutableEnumerable-11c51ddd0b","ember-4.3.0-Observable":"ember-4.3.0-Observable-0e9aac8181","ember-4.3.0-PromiseProxyMixin":"ember-4.3.0-PromiseProxyMixin-f4ff672507","ember-4.3.0-RegistryProxyMixin":"ember-4.3.0-RegistryProxyMixin-943153f25e","ember-4.3.0-Ember.TargetActionSupport":"ember-4.3.0-Ember.TargetActionSupport-1bc1f63fbe","ember-4.3.0-ArrayProxy":"ember-4.3.0-ArrayProxy-ef54cc9b02","ember-4.3.0-CoreObject":"ember-4.3.0-CoreObject-c1c5340263","ember-4.3.0-Namespace":"ember-4.3.0-Namespace-281460f032","ember-4.3.0-EmberObject":"ember-4.3.0-EmberObject-89cb64719c","ember-4.3.0-ObjectProxy":"ember-4.3.0-ObjectProxy-ae09ffd09e","ember-4.3.0-Ember.ActionSupport":"ember-4.3.0-Ember.ActionSupport-864952fa23","ember-4.3.0-Ember.ClassNamesSupport":"ember-4.3.0-Ember.ClassNamesSupport-d5dcbaedd8","ember-4.3.0-Ember.ViewMixin":"ember-4.3.0-Ember.ViewMixin-a7e2febe1f","ember-4.3.0-Ember.EventDispatcher":"ember-4.3.0-Ember.EventDispatcher-580d247646","ember-4.3.0-Ember.CoreView":"ember-4.3.0-Ember.CoreView-dfcf4113c1","ember-4.3.0-Application":"ember-4.3.0-Application-6e2c620443","ember-4.3.0-ApplicationInstance":"ember-4.3.0-ApplicationInstance-9ac6cb4a04","ember-4.3.0-ApplicationInstance.BootOptions":"ember-4.3.0-ApplicationInstance.BootOptions-cccd41b1a3","ember-4.3.0-Controller":"ember-4.3.0-Controller-0fef0a544f","ember-4.3.0-Engine":"ember-4.3.0-Engine-841c315a05","ember-4.3.0-EngineInstance":"ember-4.3.0-EngineInstance-7ef98012a7","ember-4.3.0-Ember.Error":"ember-4.3.0-Ember.Error-ea1c6804b5","ember-4.3.0-Service":"ember-4.3.0-Service-ec6bd2c77d","ember-4.3.0-String":"ember-4.3.0-String-5dc1d50338","ember-4.3.0-TestAdapter":"ember-4.3.0-TestAdapter-7850dc1248","ember-4.3.0-Ember.Test.QUnitAdapter":"ember-4.3.0-Ember.Test.QUnitAdapter-b7543b0b2a","ember-4.3.0-Ember.Test":"ember-4.3.0-Ember.Test-38e0f492cb","ember-4.3.0-Ember":"ember-4.3.0-Ember-edf515c4f5","ember-4.3.0-Ember.Templates.components":"ember-4.3.0-Ember.Templates.components-f20d031f2e","ember-4.3.0-rsvp":"ember-4.3.0-rsvp-9660918fcf","ember-4.3.0-@ember/application":"ember-4.3.0-@ember/application-ec01ddfb3e","ember-4.3.0-@ember/array":"ember-4.3.0-@ember/array-c533151d07","ember-4.3.0-@ember/component":"ember-4.3.0-@ember/component-fabe2da313","ember-4.3.0-@ember/component/helper":"ember-4.3.0-@ember/component/helper-9b313d25f1","ember-4.3.0-@ember/component/template-only":"ember-4.3.0-@ember/component/template-only-00b2b626f1","ember-4.3.0-@ember/controller":"ember-4.3.0-@ember/controller-0d655bde06","ember-4.3.0-@ember/debug":"ember-4.3.0-@ember/debug-5dccbda17c","ember-4.3.0-@ember/destroyable":"ember-4.3.0-@ember/destroyable-c102b6e5aa","ember-4.3.0-@ember/engine":"ember-4.3.0-@ember/engine-fdea2f4489","ember-4.3.0-@ember/helper":"ember-4.3.0-@ember/helper-21c41cce34","ember-4.3.0-@ember/instrumentation":"ember-4.3.0-@ember/instrumentation-393aa41072","ember-4.3.0-@ember/object":"ember-4.3.0-@ember/object-c607604d1b","ember-4.3.0-@ember/object/compat":"ember-4.3.0-@ember/object/compat-ea6b801de0","ember-4.3.0-@ember/object/computed":"ember-4.3.0-@ember/object/computed-0992115d21","ember-4.3.0-@ember/object/evented":"ember-4.3.0-@ember/object/evented-88ca2b5a2f","ember-4.3.0-@ember/object/events":"ember-4.3.0-@ember/object/events-319569d605","ember-4.3.0-@ember/object/internals":"ember-4.3.0-@ember/object/internals-3f6404d2eb","ember-4.3.0-@ember/object/mixin":"ember-4.3.0-@ember/object/mixin-6cd5197273","ember-4.3.0-@ember/object/observers":"ember-4.3.0-@ember/object/observers-7ab7ec896c","ember-4.3.0-@ember/polyfills":"ember-4.3.0-@ember/polyfills-483e90f840","ember-4.3.0-@ember/routing":"ember-4.3.0-@ember/routing-55b55d7b41","ember-4.3.0-@ember/runloop":"ember-4.3.0-@ember/runloop-e256b8d7f7","ember-4.3.0-@ember/service":"ember-4.3.0-@ember/service-254ef7a7c9","ember-4.3.0-@ember/template":"ember-4.3.0-@ember/template-1c15305f7b","ember-4.3.0-@ember/test":"ember-4.3.0-@ember/test-4858798fd4","ember-4.3.0-@ember/utils":"ember-4.3.0-@ember/utils-8480194c33","ember-4.3.0-@glimmer/tracking":"ember-4.3.0-@glimmer/tracking-dc2a3e521f","ember-4.3.0-@glimmer/tracking/primitives/cache":"ember-4.3.0-@glimmer/tracking/primitives/cache-dc71d3587c"},"namespace":{"ember-4.3.0-AutoLocation":"ember-4.3.0-AutoLocation-488f98ff7a","ember-4.3.0-FEATURES":"ember-4.3.0-FEATURES-0ae822daf4","ember-4.3.0-Instrumentation":"ember-4.3.0-Instrumentation-e6976f2ae0"},"module":{"ember-4.3.0-rsvp":"ember-4.3.0-rsvp-ba07eaece0","ember-4.3.0-@ember/debug":"ember-4.3.0-@ember/debug-5e78c71571","ember-4.3.0-@ember/component":"ember-4.3.0-@ember/component-7fc588818a","ember-4.3.0-@ember/routing":"ember-4.3.0-@ember/routing-47a7a7fad1","ember-4.3.0-ember":"ember-4.3.0-ember-395b14f47d","ember-4.3.0-@ember/template":"ember-4.3.0-@ember/template-3221103265","ember-4.3.0-@glimmer/component":"ember-4.3.0-@glimmer/component-e7492d180f","ember-4.3.0-@glimmer/tracking":"ember-4.3.0-@glimmer/tracking-3dbd17acbc","ember-4.3.0-@glimmer/tracking/primitives/cache":"ember-4.3.0-@glimmer/tracking/primitives/cache-677b038f7d","ember-4.3.0-@ember/object":"ember-4.3.0-@ember/object-27c97d2d18","ember-4.3.0-@ember/utils":"ember-4.3.0-@ember/utils-75abf6a4aa","ember-4.3.0-@ember/application":"ember-4.3.0-@ember/application-652c0c4fa0","ember-4.3.0-@ember/array":"ember-4.3.0-@ember/array-8c5fa12469","ember-4.3.0-@ember/enumerable":"ember-4.3.0-@ember/enumerable-6ae2ff9ce7","ember-4.3.0-@ember/canary-features":"ember-4.3.0-@ember/canary-features-da8a110f1d","ember-4.3.0-@ember/component/template-only":"ember-4.3.0-@ember/component/template-only-72068e02d1","ember-4.3.0-@ember/controller":"ember-4.3.0-@ember/controller-cadffcb248","ember-4.3.0-@ember/destroyable":"ember-4.3.0-@ember/destroyable-dd195fd1fc","ember-4.3.0-@ember/engine":"ember-4.3.0-@ember/engine-68956c17ba","ember-4.3.0-@ember/error":"ember-4.3.0-@ember/error-5baa11ddd1","ember-4.3.0-@ember/helper":"ember-4.3.0-@ember/helper-532d501dee","ember-4.3.0-@ember/instrumentation":"ember-4.3.0-@ember/instrumentation-9376297447","ember-4.3.0-@ember/polyfills":"ember-4.3.0-@ember/polyfills-9a77fbda0e","ember-4.3.0-@ember/runloop":"ember-4.3.0-@ember/runloop-28b310b226","ember-4.3.0-@ember/service":"ember-4.3.0-@ember/service-663f6e7d51","ember-4.3.0-@ember/string":"ember-4.3.0-@ember/string-ae6df77144","ember-4.3.0-@ember/test":"ember-4.3.0-@ember/test-c954ed43db"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Ember.Object":"Ember.Object-9c32970d20","Error":"Error-158974c414"}}} \ No newline at end of file diff --git a/rev-index/ember-4.5.1.json b/rev-index/ember-4.5.1.json index 93d30a7ba..d2217f0d0 100644 --- a/rev-index/ember-4.5.1.json +++ b/rev-index/ember-4.5.1.json @@ -1 +1 @@ -{"data":{"id":"ember-4.5.1","type":"project-version","attributes":{"version":"4.5.1"},"relationships":{"classes":{"data":[{"id":"ember-4.5.1-Promise","type":"class"},{"id":"ember-4.5.1-EventTarget","type":"class"},{"id":"ember-4.5.1-Container","type":"class"},{"id":"ember-4.5.1-Registry","type":"class"},{"id":"ember-4.5.1-EmberENV","type":"class"},{"id":"ember-4.5.1-ContainerDebugAdapter","type":"class"},{"id":"ember-4.5.1-DataAdapter","type":"class"},{"id":"ember-4.5.1-Ember.Templates.helpers","type":"class"},{"id":"ember-4.5.1-ComponentStateBucket","type":"class"},{"id":"ember-4.5.1-Component","type":"class"},{"id":"ember-4.5.1-Helper","type":"class"},{"id":"ember-4.5.1-ComputedProperty","type":"class"},{"id":"ember-4.5.1-Descriptor","type":"class"},{"id":"ember-4.5.1-Ember.InjectedProperty","type":"class"},{"id":"ember-4.5.1-Libraries","type":"class"},{"id":"ember-4.5.1-Mixin","type":"class"},{"id":"ember-4.5.1-Ember.ControllerMixin","type":"class"},{"id":"ember-4.5.1-Location","type":"class"},{"id":"ember-4.5.1-HashLocation","type":"class"},{"id":"ember-4.5.1-HistoryLocation","type":"class"},{"id":"ember-4.5.1-NoneLocation","type":"class"},{"id":"ember-4.5.1-RouterService","type":"class"},{"id":"ember-4.5.1-RoutingService","type":"class"},{"id":"ember-4.5.1-BucketCache","type":"class"},{"id":"ember-4.5.1-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.5.1-RouteInfo","type":"class"},{"id":"ember-4.5.1-Route","type":"class"},{"id":"ember-4.5.1-EmberRouter","type":"class"},{"id":"ember-4.5.1-Transition","type":"class"},{"id":"ember-4.5.1-Ember.ProxyMixin","type":"class"},{"id":"ember-4.5.1-Ember.ActionHandler","type":"class"},{"id":"ember-4.5.1-EmberArray","type":"class"},{"id":"ember-4.5.1-MutableArray","type":"class"},{"id":"ember-4.5.1-Ember.NativeArray","type":"class"},{"id":"ember-4.5.1-Ember.Comparable","type":"class"},{"id":"ember-4.5.1-ContainerProxyMixin","type":"class"},{"id":"ember-4.5.1-Enumerable","type":"class"},{"id":"ember-4.5.1-Evented","type":"class"},{"id":"ember-4.5.1-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.5.1-Observable","type":"class"},{"id":"ember-4.5.1-PromiseProxyMixin","type":"class"},{"id":"ember-4.5.1-RegistryProxyMixin","type":"class"},{"id":"ember-4.5.1-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.5.1-ArrayProxy","type":"class"},{"id":"ember-4.5.1-CoreObject","type":"class"},{"id":"ember-4.5.1-Namespace","type":"class"},{"id":"ember-4.5.1-EmberObject","type":"class"},{"id":"ember-4.5.1-ObjectProxy","type":"class"},{"id":"ember-4.5.1-Ember.ActionSupport","type":"class"},{"id":"ember-4.5.1-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.5.1-Ember.ViewMixin","type":"class"},{"id":"ember-4.5.1-Ember.EventDispatcher","type":"class"},{"id":"ember-4.5.1-Ember.CoreView","type":"class"},{"id":"ember-4.5.1-Application","type":"class"},{"id":"ember-4.5.1-ApplicationInstance","type":"class"},{"id":"ember-4.5.1-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.5.1-Controller","type":"class"},{"id":"ember-4.5.1-Engine","type":"class"},{"id":"ember-4.5.1-EngineInstance","type":"class"},{"id":"ember-4.5.1-Ember.Error","type":"class"},{"id":"ember-4.5.1-Renderer","type":"class"},{"id":"ember-4.5.1-Service","type":"class"},{"id":"ember-4.5.1-String","type":"class"},{"id":"ember-4.5.1-TestAdapter","type":"class"},{"id":"ember-4.5.1-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.5.1-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.5.1-AutoLocation","type":"namespace"},{"id":"ember-4.5.1-FEATURES","type":"namespace"},{"id":"ember-4.5.1-Instrumentation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.5.1-rsvp","type":"module"},{"id":"ember-4.5.1-@ember/debug","type":"module"},{"id":"ember-4.5.1-@ember/component","type":"module"},{"id":"ember-4.5.1-@ember/routing","type":"module"},{"id":"ember-4.5.1-ember","type":"module"},{"id":"ember-4.5.1-@ember/template","type":"module"},{"id":"ember-4.5.1-@glimmer/component","type":"module"},{"id":"ember-4.5.1-@glimmer/tracking","type":"module"},{"id":"ember-4.5.1-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.5.1-@ember/object","type":"module"},{"id":"ember-4.5.1-@ember/utils","type":"module"},{"id":"ember-4.5.1-@ember/application","type":"module"},{"id":"ember-4.5.1-@ember/array","type":"module"},{"id":"ember-4.5.1-@ember/enumerable","type":"module"},{"id":"ember-4.5.1-@ember/canary-features","type":"module"},{"id":"ember-4.5.1-@ember/component/template-only","type":"module"},{"id":"ember-4.5.1-@ember/controller","type":"module"},{"id":"ember-4.5.1-@ember/destroyable","type":"module"},{"id":"ember-4.5.1-@ember/engine","type":"module"},{"id":"ember-4.5.1-@ember/error","type":"module"},{"id":"ember-4.5.1-@ember/helper","type":"module"},{"id":"ember-4.5.1-@ember/instrumentation","type":"module"},{"id":"ember-4.5.1-@ember/polyfills","type":"module"},{"id":"ember-4.5.1-@ember/renderer","type":"module"},{"id":"ember-4.5.1-@ember/runloop","type":"module"},{"id":"ember-4.5.1-@ember/service","type":"module"},{"id":"ember-4.5.1-@ember/string","type":"module"},{"id":"ember-4.5.1-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.5.1-Container","type":"class"},{"id":"ember-4.5.1-Registry","type":"class"},{"id":"ember-4.5.1-ComponentStateBucket","type":"class"},{"id":"ember-4.5.1-Descriptor","type":"class"},{"id":"ember-4.5.1-Ember.InjectedProperty","type":"class"},{"id":"ember-4.5.1-Libraries","type":"class"},{"id":"ember-4.5.1-Ember.ControllerMixin","type":"class"},{"id":"ember-4.5.1-Location","type":"class"},{"id":"ember-4.5.1-RoutingService","type":"class"},{"id":"ember-4.5.1-BucketCache","type":"class"},{"id":"ember-4.5.1-Ember.ProxyMixin","type":"class"},{"id":"ember-4.5.1-Ember.ActionHandler","type":"class"},{"id":"ember-4.5.1-Ember.Comparable","type":"class"},{"id":"ember-4.5.1-ContainerProxyMixin","type":"class"},{"id":"ember-4.5.1-Enumerable","type":"class"},{"id":"ember-4.5.1-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.5.1-RegistryProxyMixin","type":"class"},{"id":"ember-4.5.1-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.5.1-Ember.ActionSupport","type":"class"},{"id":"ember-4.5.1-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.5.1-Ember.ViewMixin","type":"class"},{"id":"ember-4.5.1-Ember.EventDispatcher","type":"class"},{"id":"ember-4.5.1-Ember.CoreView","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.5.1-Promise","type":"class"},{"id":"ember-4.5.1-EventTarget","type":"class"},{"id":"ember-4.5.1-EmberENV","type":"class"},{"id":"ember-4.5.1-ContainerDebugAdapter","type":"class"},{"id":"ember-4.5.1-DataAdapter","type":"class"},{"id":"ember-4.5.1-Ember.Templates.helpers","type":"class"},{"id":"ember-4.5.1-Component","type":"class"},{"id":"ember-4.5.1-Helper","type":"class"},{"id":"ember-4.5.1-ComputedProperty","type":"class"},{"id":"ember-4.5.1-Mixin","type":"class"},{"id":"ember-4.5.1-HashLocation","type":"class"},{"id":"ember-4.5.1-HistoryLocation","type":"class"},{"id":"ember-4.5.1-NoneLocation","type":"class"},{"id":"ember-4.5.1-RouterService","type":"class"},{"id":"ember-4.5.1-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.5.1-RouteInfo","type":"class"},{"id":"ember-4.5.1-Route","type":"class"},{"id":"ember-4.5.1-EmberRouter","type":"class"},{"id":"ember-4.5.1-Transition","type":"class"},{"id":"ember-4.5.1-EmberArray","type":"class"},{"id":"ember-4.5.1-MutableArray","type":"class"},{"id":"ember-4.5.1-Ember.NativeArray","type":"class"},{"id":"ember-4.5.1-Evented","type":"class"},{"id":"ember-4.5.1-Observable","type":"class"},{"id":"ember-4.5.1-PromiseProxyMixin","type":"class"},{"id":"ember-4.5.1-ArrayProxy","type":"class"},{"id":"ember-4.5.1-CoreObject","type":"class"},{"id":"ember-4.5.1-Namespace","type":"class"},{"id":"ember-4.5.1-EmberObject","type":"class"},{"id":"ember-4.5.1-ObjectProxy","type":"class"},{"id":"ember-4.5.1-Application","type":"class"},{"id":"ember-4.5.1-ApplicationInstance","type":"class"},{"id":"ember-4.5.1-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.5.1-Controller","type":"class"},{"id":"ember-4.5.1-Engine","type":"class"},{"id":"ember-4.5.1-EngineInstance","type":"class"},{"id":"ember-4.5.1-Ember.Error","type":"class"},{"id":"ember-4.5.1-Renderer","type":"class"},{"id":"ember-4.5.1-Service","type":"class"},{"id":"ember-4.5.1-String","type":"class"},{"id":"ember-4.5.1-TestAdapter","type":"class"},{"id":"ember-4.5.1-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.5.1-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.5.1-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.5.1-AutoLocation","type":"namespace"},{"id":"ember-4.5.1-FEATURES","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.5.1-ember","type":"module"},{"id":"ember-4.5.1-@ember/enumerable","type":"module"},{"id":"ember-4.5.1-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.5.1-rsvp","type":"module"},{"id":"ember-4.5.1-@ember/debug","type":"module"},{"id":"ember-4.5.1-@ember/component","type":"module"},{"id":"ember-4.5.1-@ember/routing","type":"module"},{"id":"ember-4.5.1-@ember/template","type":"module"},{"id":"ember-4.5.1-@glimmer/component","type":"module"},{"id":"ember-4.5.1-@glimmer/tracking","type":"module"},{"id":"ember-4.5.1-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.5.1-@ember/object","type":"module"},{"id":"ember-4.5.1-@ember/utils","type":"module"},{"id":"ember-4.5.1-@ember/application","type":"module"},{"id":"ember-4.5.1-@ember/array","type":"module"},{"id":"ember-4.5.1-@ember/canary-features","type":"module"},{"id":"ember-4.5.1-@ember/component/template-only","type":"module"},{"id":"ember-4.5.1-@ember/controller","type":"module"},{"id":"ember-4.5.1-@ember/destroyable","type":"module"},{"id":"ember-4.5.1-@ember/engine","type":"module"},{"id":"ember-4.5.1-@ember/error","type":"module"},{"id":"ember-4.5.1-@ember/helper","type":"module"},{"id":"ember-4.5.1-@ember/polyfills","type":"module"},{"id":"ember-4.5.1-@ember/renderer","type":"module"},{"id":"ember-4.5.1-@ember/runloop","type":"module"},{"id":"ember-4.5.1-@ember/service","type":"module"},{"id":"ember-4.5.1-@ember/string","type":"module"},{"id":"ember-4.5.1-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.5.1-Promise":"ember-4.5.1-Promise-54f9ec341c","ember-4.5.1-EventTarget":"ember-4.5.1-EventTarget-4dd8e6e3b7","ember-4.5.1-Container":"ember-4.5.1-Container-7cff6100c0","ember-4.5.1-Registry":"ember-4.5.1-Registry-ecbb029739","ember-4.5.1-EmberENV":"ember-4.5.1-EmberENV-366754d2e7","ember-4.5.1-ContainerDebugAdapter":"ember-4.5.1-ContainerDebugAdapter-d3a3184bf1","ember-4.5.1-DataAdapter":"ember-4.5.1-DataAdapter-c8c8b375dd","ember-4.5.1-Ember.Templates.helpers":"ember-4.5.1-Ember.Templates.helpers-098deaf9f6","ember-4.5.1-ComponentStateBucket":"ember-4.5.1-ComponentStateBucket-e827046b8f","ember-4.5.1-Component":"ember-4.5.1-Component-1534d8c710","ember-4.5.1-Helper":"ember-4.5.1-Helper-8512a9d7c2","ember-4.5.1-ComputedProperty":"ember-4.5.1-ComputedProperty-0390c96510","ember-4.5.1-Descriptor":"ember-4.5.1-Descriptor-cde2cd874c","ember-4.5.1-Ember.InjectedProperty":"ember-4.5.1-Ember.InjectedProperty-5f70767b8f","ember-4.5.1-Libraries":"ember-4.5.1-Libraries-95d7c2997f","ember-4.5.1-Mixin":"ember-4.5.1-Mixin-e34735b658","ember-4.5.1-Ember.ControllerMixin":"ember-4.5.1-Ember.ControllerMixin-99befb71c2","ember-4.5.1-Location":"ember-4.5.1-Location-b9b95ce9fa","ember-4.5.1-HashLocation":"ember-4.5.1-HashLocation-dd1578f86e","ember-4.5.1-HistoryLocation":"ember-4.5.1-HistoryLocation-d1227ba4e2","ember-4.5.1-NoneLocation":"ember-4.5.1-NoneLocation-6ca11546a9","ember-4.5.1-RouterService":"ember-4.5.1-RouterService-f6ea341957","ember-4.5.1-RoutingService":"ember-4.5.1-RoutingService-a65567c39c","ember-4.5.1-BucketCache":"ember-4.5.1-BucketCache-d0b835aec8","ember-4.5.1-RouteInfoWithAttributes":"ember-4.5.1-RouteInfoWithAttributes-3789ce5b47","ember-4.5.1-RouteInfo":"ember-4.5.1-RouteInfo-909ffd99d3","ember-4.5.1-Route":"ember-4.5.1-Route-3c1509faf7","ember-4.5.1-EmberRouter":"ember-4.5.1-EmberRouter-bd75125b03","ember-4.5.1-Transition":"ember-4.5.1-Transition-46438e83a6","ember-4.5.1-Ember.ProxyMixin":"ember-4.5.1-Ember.ProxyMixin-dea4c77edf","ember-4.5.1-Ember.ActionHandler":"ember-4.5.1-Ember.ActionHandler-155ad39e08","ember-4.5.1-EmberArray":"ember-4.5.1-EmberArray-0b8170e4d6","ember-4.5.1-MutableArray":"ember-4.5.1-MutableArray-2168c95749","ember-4.5.1-Ember.NativeArray":"ember-4.5.1-Ember.NativeArray-3a9db7ee2e","ember-4.5.1-Ember.Comparable":"ember-4.5.1-Ember.Comparable-b69b0c1dd9","ember-4.5.1-ContainerProxyMixin":"ember-4.5.1-ContainerProxyMixin-93f1cf8870","ember-4.5.1-Enumerable":"ember-4.5.1-Enumerable-9e3c5d03e1","ember-4.5.1-Evented":"ember-4.5.1-Evented-f047f3dcc2","ember-4.5.1-Ember.MutableEnumerable":"ember-4.5.1-Ember.MutableEnumerable-7993816e33","ember-4.5.1-Observable":"ember-4.5.1-Observable-812c4b1593","ember-4.5.1-PromiseProxyMixin":"ember-4.5.1-PromiseProxyMixin-288b277e88","ember-4.5.1-RegistryProxyMixin":"ember-4.5.1-RegistryProxyMixin-335050358e","ember-4.5.1-Ember.TargetActionSupport":"ember-4.5.1-Ember.TargetActionSupport-7ea3c99dab","ember-4.5.1-ArrayProxy":"ember-4.5.1-ArrayProxy-a828941e81","ember-4.5.1-CoreObject":"ember-4.5.1-CoreObject-ef78b8843c","ember-4.5.1-Namespace":"ember-4.5.1-Namespace-f9c319ca48","ember-4.5.1-EmberObject":"ember-4.5.1-EmberObject-2a6549554b","ember-4.5.1-ObjectProxy":"ember-4.5.1-ObjectProxy-c9e2fe44b3","ember-4.5.1-Ember.ActionSupport":"ember-4.5.1-Ember.ActionSupport-03233f3890","ember-4.5.1-Ember.ClassNamesSupport":"ember-4.5.1-Ember.ClassNamesSupport-265982a2f5","ember-4.5.1-Ember.ViewMixin":"ember-4.5.1-Ember.ViewMixin-dea6dc8dc8","ember-4.5.1-Ember.EventDispatcher":"ember-4.5.1-Ember.EventDispatcher-3fdbbea914","ember-4.5.1-Ember.CoreView":"ember-4.5.1-Ember.CoreView-470933cb7d","ember-4.5.1-Application":"ember-4.5.1-Application-a9576673f2","ember-4.5.1-ApplicationInstance":"ember-4.5.1-ApplicationInstance-98e90c33a9","ember-4.5.1-ApplicationInstance.BootOptions":"ember-4.5.1-ApplicationInstance.BootOptions-eaf26a8df0","ember-4.5.1-Controller":"ember-4.5.1-Controller-a39a5058b6","ember-4.5.1-Engine":"ember-4.5.1-Engine-53bc17637f","ember-4.5.1-EngineInstance":"ember-4.5.1-EngineInstance-dae01a7a72","ember-4.5.1-Ember.Error":"ember-4.5.1-Ember.Error-aa9a8affba","ember-4.5.1-Renderer":"ember-4.5.1-Renderer-7881716173","ember-4.5.1-Service":"ember-4.5.1-Service-fa6daae2a8","ember-4.5.1-String":"ember-4.5.1-String-d441ac6aae","ember-4.5.1-TestAdapter":"ember-4.5.1-TestAdapter-d7f6db7481","ember-4.5.1-Ember.Test.QUnitAdapter":"ember-4.5.1-Ember.Test.QUnitAdapter-acace7bbe5","ember-4.5.1-Ember.Test":"ember-4.5.1-Ember.Test-62f473bdb6","ember-4.5.1-Ember":"ember-4.5.1-Ember-5fcb2bc61b","ember-4.5.1-Ember.Templates.components":"ember-4.5.1-Ember.Templates.components-fbea1f22fd","ember-4.5.1-rsvp":"ember-4.5.1-rsvp-813868e0bb","ember-4.5.1-@ember/application":"ember-4.5.1-@ember/application-28387431ff","ember-4.5.1-@ember/array":"ember-4.5.1-@ember/array-0745f5c683","ember-4.5.1-@ember/component":"ember-4.5.1-@ember/component-2fc37d648e","ember-4.5.1-@ember/component/helper":"ember-4.5.1-@ember/component/helper-eb99a695ea","ember-4.5.1-@ember/component/template-only":"ember-4.5.1-@ember/component/template-only-163091f03d","ember-4.5.1-@ember/controller":"ember-4.5.1-@ember/controller-bb86ea222c","ember-4.5.1-@ember/debug":"ember-4.5.1-@ember/debug-3cd33c0ea9","ember-4.5.1-@ember/destroyable":"ember-4.5.1-@ember/destroyable-351d6b21b1","ember-4.5.1-@ember/engine":"ember-4.5.1-@ember/engine-f63078e17e","ember-4.5.1-@ember/helper":"ember-4.5.1-@ember/helper-8d929bdf83","ember-4.5.1-@ember/instrumentation":"ember-4.5.1-@ember/instrumentation-ff300c5556","ember-4.5.1-@ember/object":"ember-4.5.1-@ember/object-39f7622e4a","ember-4.5.1-@ember/object/compat":"ember-4.5.1-@ember/object/compat-36d5a5e433","ember-4.5.1-@ember/object/computed":"ember-4.5.1-@ember/object/computed-c37f6523eb","ember-4.5.1-@ember/object/evented":"ember-4.5.1-@ember/object/evented-a44c295ec5","ember-4.5.1-@ember/object/events":"ember-4.5.1-@ember/object/events-a855efd241","ember-4.5.1-@ember/object/internals":"ember-4.5.1-@ember/object/internals-d37795c41c","ember-4.5.1-@ember/object/mixin":"ember-4.5.1-@ember/object/mixin-f0e6ce5ac7","ember-4.5.1-@ember/object/observers":"ember-4.5.1-@ember/object/observers-9027481485","ember-4.5.1-@ember/polyfills":"ember-4.5.1-@ember/polyfills-eb3b901599","ember-4.5.1-@ember/routing":"ember-4.5.1-@ember/routing-99f6dc321d","ember-4.5.1-@ember/runloop":"ember-4.5.1-@ember/runloop-8a693b3e6c","ember-4.5.1-@ember/service":"ember-4.5.1-@ember/service-c4a233f1f2","ember-4.5.1-@ember/template":"ember-4.5.1-@ember/template-e228ea4932","ember-4.5.1-@ember/test":"ember-4.5.1-@ember/test-f3fbe1c054","ember-4.5.1-@ember/utils":"ember-4.5.1-@ember/utils-304a1053f3","ember-4.5.1-@glimmer/tracking":"ember-4.5.1-@glimmer/tracking-d09b63df7a","ember-4.5.1-@glimmer/tracking/primitives/cache":"ember-4.5.1-@glimmer/tracking/primitives/cache-5309f197bc"},"namespace":{"ember-4.5.1-AutoLocation":"ember-4.5.1-AutoLocation-1dc592c30b","ember-4.5.1-FEATURES":"ember-4.5.1-FEATURES-e82b4fe43b","ember-4.5.1-Instrumentation":"ember-4.5.1-Instrumentation-7e55db1b63"},"module":{"ember-4.5.1-rsvp":"ember-4.5.1-rsvp-ed6a93d83c","ember-4.5.1-@ember/debug":"ember-4.5.1-@ember/debug-f03baed254","ember-4.5.1-@ember/component":"ember-4.5.1-@ember/component-0b199b3796","ember-4.5.1-@ember/routing":"ember-4.5.1-@ember/routing-122957b63b","ember-4.5.1-ember":"ember-4.5.1-ember-406d9219c1","ember-4.5.1-@ember/template":"ember-4.5.1-@ember/template-80b74c886f","ember-4.5.1-@glimmer/component":"ember-4.5.1-@glimmer/component-583ddc1359","ember-4.5.1-@glimmer/tracking":"ember-4.5.1-@glimmer/tracking-6768b0b18a","ember-4.5.1-@glimmer/tracking/primitives/cache":"ember-4.5.1-@glimmer/tracking/primitives/cache-d534a380c4","ember-4.5.1-@ember/object":"ember-4.5.1-@ember/object-b7b33a7d02","ember-4.5.1-@ember/utils":"ember-4.5.1-@ember/utils-9df9398e92","ember-4.5.1-@ember/application":"ember-4.5.1-@ember/application-fcadbbf290","ember-4.5.1-@ember/array":"ember-4.5.1-@ember/array-4f34b68132","ember-4.5.1-@ember/enumerable":"ember-4.5.1-@ember/enumerable-b8f37ded9b","ember-4.5.1-@ember/canary-features":"ember-4.5.1-@ember/canary-features-e9652d1be8","ember-4.5.1-@ember/component/template-only":"ember-4.5.1-@ember/component/template-only-386aa0a210","ember-4.5.1-@ember/controller":"ember-4.5.1-@ember/controller-fac883e96c","ember-4.5.1-@ember/destroyable":"ember-4.5.1-@ember/destroyable-99c4d70beb","ember-4.5.1-@ember/engine":"ember-4.5.1-@ember/engine-384d0a0218","ember-4.5.1-@ember/error":"ember-4.5.1-@ember/error-b5d85777fe","ember-4.5.1-@ember/helper":"ember-4.5.1-@ember/helper-c9efad34ab","ember-4.5.1-@ember/instrumentation":"ember-4.5.1-@ember/instrumentation-5dc7699142","ember-4.5.1-@ember/polyfills":"ember-4.5.1-@ember/polyfills-75623813cf","ember-4.5.1-@ember/renderer":"ember-4.5.1-@ember/renderer-ff194b7c9d","ember-4.5.1-@ember/runloop":"ember-4.5.1-@ember/runloop-132400550e","ember-4.5.1-@ember/service":"ember-4.5.1-@ember/service-b428fd5170","ember-4.5.1-@ember/string":"ember-4.5.1-@ember/string-c69ed6f92a","ember-4.5.1-@ember/test":"ember-4.5.1-@ember/test-f25b812f49"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Ember.Object":"Ember.Object-9c32970d20","Error":"Error-158974c414"}}} \ No newline at end of file +{"data":{"id":"ember-4.5.1","type":"project-version","attributes":{"version":"4.5.1"},"relationships":{"classes":{"data":[{"id":"ember-4.5.1-Promise","type":"class"},{"id":"ember-4.5.1-EventTarget","type":"class"},{"id":"ember-4.5.1-Container","type":"class"},{"id":"ember-4.5.1-Registry","type":"class"},{"id":"ember-4.5.1-EmberENV","type":"class"},{"id":"ember-4.5.1-ContainerDebugAdapter","type":"class"},{"id":"ember-4.5.1-DataAdapter","type":"class"},{"id":"ember-4.5.1-Ember.Templates.helpers","type":"class"},{"id":"ember-4.5.1-ComponentStateBucket","type":"class"},{"id":"ember-4.5.1-Component","type":"class"},{"id":"ember-4.5.1-Helper","type":"class"},{"id":"ember-4.5.1-ComputedProperty","type":"class"},{"id":"ember-4.5.1-Descriptor","type":"class"},{"id":"ember-4.5.1-Ember.InjectedProperty","type":"class"},{"id":"ember-4.5.1-Libraries","type":"class"},{"id":"ember-4.5.1-Mixin","type":"class"},{"id":"ember-4.5.1-Ember.ControllerMixin","type":"class"},{"id":"ember-4.5.1-Location","type":"class"},{"id":"ember-4.5.1-HashLocation","type":"class"},{"id":"ember-4.5.1-HistoryLocation","type":"class"},{"id":"ember-4.5.1-NoneLocation","type":"class"},{"id":"ember-4.5.1-RouterService","type":"class"},{"id":"ember-4.5.1-RoutingService","type":"class"},{"id":"ember-4.5.1-BucketCache","type":"class"},{"id":"ember-4.5.1-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.5.1-RouteInfo","type":"class"},{"id":"ember-4.5.1-Route","type":"class"},{"id":"ember-4.5.1-EmberRouter","type":"class"},{"id":"ember-4.5.1-Transition","type":"class"},{"id":"ember-4.5.1-Ember.ProxyMixin","type":"class"},{"id":"ember-4.5.1-Ember.ActionHandler","type":"class"},{"id":"ember-4.5.1-EmberArray","type":"class"},{"id":"ember-4.5.1-MutableArray","type":"class"},{"id":"ember-4.5.1-Ember.NativeArray","type":"class"},{"id":"ember-4.5.1-Ember.Comparable","type":"class"},{"id":"ember-4.5.1-ContainerProxyMixin","type":"class"},{"id":"ember-4.5.1-Enumerable","type":"class"},{"id":"ember-4.5.1-Evented","type":"class"},{"id":"ember-4.5.1-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.5.1-Observable","type":"class"},{"id":"ember-4.5.1-PromiseProxyMixin","type":"class"},{"id":"ember-4.5.1-RegistryProxyMixin","type":"class"},{"id":"ember-4.5.1-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.5.1-ArrayProxy","type":"class"},{"id":"ember-4.5.1-CoreObject","type":"class"},{"id":"ember-4.5.1-Namespace","type":"class"},{"id":"ember-4.5.1-EmberObject","type":"class"},{"id":"ember-4.5.1-ObjectProxy","type":"class"},{"id":"ember-4.5.1-Ember.ActionSupport","type":"class"},{"id":"ember-4.5.1-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.5.1-Ember.ViewMixin","type":"class"},{"id":"ember-4.5.1-Ember.EventDispatcher","type":"class"},{"id":"ember-4.5.1-Ember.CoreView","type":"class"},{"id":"ember-4.5.1-Application","type":"class"},{"id":"ember-4.5.1-ApplicationInstance","type":"class"},{"id":"ember-4.5.1-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.5.1-Controller","type":"class"},{"id":"ember-4.5.1-Engine","type":"class"},{"id":"ember-4.5.1-EngineInstance","type":"class"},{"id":"ember-4.5.1-Ember.Error","type":"class"},{"id":"ember-4.5.1-Renderer","type":"class"},{"id":"ember-4.5.1-Service","type":"class"},{"id":"ember-4.5.1-String","type":"class"},{"id":"ember-4.5.1-TestAdapter","type":"class"},{"id":"ember-4.5.1-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.5.1-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.5.1-AutoLocation","type":"namespace"},{"id":"ember-4.5.1-FEATURES","type":"namespace"},{"id":"ember-4.5.1-Instrumentation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.5.1-rsvp","type":"module"},{"id":"ember-4.5.1-@ember/debug","type":"module"},{"id":"ember-4.5.1-@ember/component","type":"module"},{"id":"ember-4.5.1-@ember/routing","type":"module"},{"id":"ember-4.5.1-ember","type":"module"},{"id":"ember-4.5.1-@ember/template","type":"module"},{"id":"ember-4.5.1-@glimmer/component","type":"module"},{"id":"ember-4.5.1-@glimmer/tracking","type":"module"},{"id":"ember-4.5.1-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.5.1-@ember/object","type":"module"},{"id":"ember-4.5.1-@ember/utils","type":"module"},{"id":"ember-4.5.1-@ember/application","type":"module"},{"id":"ember-4.5.1-@ember/array","type":"module"},{"id":"ember-4.5.1-@ember/enumerable","type":"module"},{"id":"ember-4.5.1-@ember/canary-features","type":"module"},{"id":"ember-4.5.1-@ember/component/template-only","type":"module"},{"id":"ember-4.5.1-@ember/controller","type":"module"},{"id":"ember-4.5.1-@ember/destroyable","type":"module"},{"id":"ember-4.5.1-@ember/engine","type":"module"},{"id":"ember-4.5.1-@ember/error","type":"module"},{"id":"ember-4.5.1-@ember/helper","type":"module"},{"id":"ember-4.5.1-@ember/instrumentation","type":"module"},{"id":"ember-4.5.1-@ember/polyfills","type":"module"},{"id":"ember-4.5.1-@ember/renderer","type":"module"},{"id":"ember-4.5.1-@ember/runloop","type":"module"},{"id":"ember-4.5.1-@ember/service","type":"module"},{"id":"ember-4.5.1-@ember/string","type":"module"},{"id":"ember-4.5.1-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.5.1-Container","type":"class"},{"id":"ember-4.5.1-Registry","type":"class"},{"id":"ember-4.5.1-ComponentStateBucket","type":"class"},{"id":"ember-4.5.1-Descriptor","type":"class"},{"id":"ember-4.5.1-Ember.InjectedProperty","type":"class"},{"id":"ember-4.5.1-Libraries","type":"class"},{"id":"ember-4.5.1-Ember.ControllerMixin","type":"class"},{"id":"ember-4.5.1-Location","type":"class"},{"id":"ember-4.5.1-RoutingService","type":"class"},{"id":"ember-4.5.1-BucketCache","type":"class"},{"id":"ember-4.5.1-Ember.ProxyMixin","type":"class"},{"id":"ember-4.5.1-Ember.ActionHandler","type":"class"},{"id":"ember-4.5.1-Ember.Comparable","type":"class"},{"id":"ember-4.5.1-ContainerProxyMixin","type":"class"},{"id":"ember-4.5.1-Enumerable","type":"class"},{"id":"ember-4.5.1-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.5.1-RegistryProxyMixin","type":"class"},{"id":"ember-4.5.1-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.5.1-Ember.ActionSupport","type":"class"},{"id":"ember-4.5.1-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.5.1-Ember.ViewMixin","type":"class"},{"id":"ember-4.5.1-Ember.EventDispatcher","type":"class"},{"id":"ember-4.5.1-Ember.CoreView","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.5.1-Promise","type":"class"},{"id":"ember-4.5.1-EventTarget","type":"class"},{"id":"ember-4.5.1-EmberENV","type":"class"},{"id":"ember-4.5.1-ContainerDebugAdapter","type":"class"},{"id":"ember-4.5.1-DataAdapter","type":"class"},{"id":"ember-4.5.1-Ember.Templates.helpers","type":"class"},{"id":"ember-4.5.1-Component","type":"class"},{"id":"ember-4.5.1-Helper","type":"class"},{"id":"ember-4.5.1-ComputedProperty","type":"class"},{"id":"ember-4.5.1-Mixin","type":"class"},{"id":"ember-4.5.1-HashLocation","type":"class"},{"id":"ember-4.5.1-HistoryLocation","type":"class"},{"id":"ember-4.5.1-NoneLocation","type":"class"},{"id":"ember-4.5.1-RouterService","type":"class"},{"id":"ember-4.5.1-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.5.1-RouteInfo","type":"class"},{"id":"ember-4.5.1-Route","type":"class"},{"id":"ember-4.5.1-EmberRouter","type":"class"},{"id":"ember-4.5.1-Transition","type":"class"},{"id":"ember-4.5.1-EmberArray","type":"class"},{"id":"ember-4.5.1-MutableArray","type":"class"},{"id":"ember-4.5.1-Ember.NativeArray","type":"class"},{"id":"ember-4.5.1-Evented","type":"class"},{"id":"ember-4.5.1-Observable","type":"class"},{"id":"ember-4.5.1-PromiseProxyMixin","type":"class"},{"id":"ember-4.5.1-ArrayProxy","type":"class"},{"id":"ember-4.5.1-CoreObject","type":"class"},{"id":"ember-4.5.1-Namespace","type":"class"},{"id":"ember-4.5.1-EmberObject","type":"class"},{"id":"ember-4.5.1-ObjectProxy","type":"class"},{"id":"ember-4.5.1-Application","type":"class"},{"id":"ember-4.5.1-ApplicationInstance","type":"class"},{"id":"ember-4.5.1-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.5.1-Controller","type":"class"},{"id":"ember-4.5.1-Engine","type":"class"},{"id":"ember-4.5.1-EngineInstance","type":"class"},{"id":"ember-4.5.1-Ember.Error","type":"class"},{"id":"ember-4.5.1-Renderer","type":"class"},{"id":"ember-4.5.1-Service","type":"class"},{"id":"ember-4.5.1-String","type":"class"},{"id":"ember-4.5.1-TestAdapter","type":"class"},{"id":"ember-4.5.1-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.5.1-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.5.1-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.5.1-AutoLocation","type":"namespace"},{"id":"ember-4.5.1-FEATURES","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.5.1-ember","type":"module"},{"id":"ember-4.5.1-@ember/enumerable","type":"module"},{"id":"ember-4.5.1-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.5.1-rsvp","type":"module"},{"id":"ember-4.5.1-@ember/debug","type":"module"},{"id":"ember-4.5.1-@ember/component","type":"module"},{"id":"ember-4.5.1-@ember/routing","type":"module"},{"id":"ember-4.5.1-@ember/template","type":"module"},{"id":"ember-4.5.1-@glimmer/component","type":"module"},{"id":"ember-4.5.1-@glimmer/tracking","type":"module"},{"id":"ember-4.5.1-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.5.1-@ember/object","type":"module"},{"id":"ember-4.5.1-@ember/utils","type":"module"},{"id":"ember-4.5.1-@ember/application","type":"module"},{"id":"ember-4.5.1-@ember/array","type":"module"},{"id":"ember-4.5.1-@ember/canary-features","type":"module"},{"id":"ember-4.5.1-@ember/component/template-only","type":"module"},{"id":"ember-4.5.1-@ember/controller","type":"module"},{"id":"ember-4.5.1-@ember/destroyable","type":"module"},{"id":"ember-4.5.1-@ember/engine","type":"module"},{"id":"ember-4.5.1-@ember/error","type":"module"},{"id":"ember-4.5.1-@ember/helper","type":"module"},{"id":"ember-4.5.1-@ember/polyfills","type":"module"},{"id":"ember-4.5.1-@ember/renderer","type":"module"},{"id":"ember-4.5.1-@ember/runloop","type":"module"},{"id":"ember-4.5.1-@ember/service","type":"module"},{"id":"ember-4.5.1-@ember/string","type":"module"},{"id":"ember-4.5.1-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.5.1-Promise":"ember-4.5.1-Promise-87bcfe0847","ember-4.5.1-EventTarget":"ember-4.5.1-EventTarget-4dd8e6e3b7","ember-4.5.1-Container":"ember-4.5.1-Container-cab901bd09","ember-4.5.1-Registry":"ember-4.5.1-Registry-adb8831919","ember-4.5.1-EmberENV":"ember-4.5.1-EmberENV-366754d2e7","ember-4.5.1-ContainerDebugAdapter":"ember-4.5.1-ContainerDebugAdapter-b5e02329e3","ember-4.5.1-DataAdapter":"ember-4.5.1-DataAdapter-030ae80920","ember-4.5.1-Ember.Templates.helpers":"ember-4.5.1-Ember.Templates.helpers-27af8be267","ember-4.5.1-ComponentStateBucket":"ember-4.5.1-ComponentStateBucket-e827046b8f","ember-4.5.1-Component":"ember-4.5.1-Component-3d6ca8c512","ember-4.5.1-Helper":"ember-4.5.1-Helper-95a955deda","ember-4.5.1-ComputedProperty":"ember-4.5.1-ComputedProperty-051ca7dcef","ember-4.5.1-Descriptor":"ember-4.5.1-Descriptor-cde2cd874c","ember-4.5.1-Ember.InjectedProperty":"ember-4.5.1-Ember.InjectedProperty-5f70767b8f","ember-4.5.1-Libraries":"ember-4.5.1-Libraries-95d7c2997f","ember-4.5.1-Mixin":"ember-4.5.1-Mixin-40f0008faf","ember-4.5.1-Ember.ControllerMixin":"ember-4.5.1-Ember.ControllerMixin-ffe5a19a2d","ember-4.5.1-Location":"ember-4.5.1-Location-d2a65373af","ember-4.5.1-HashLocation":"ember-4.5.1-HashLocation-8d023e3ec3","ember-4.5.1-HistoryLocation":"ember-4.5.1-HistoryLocation-7d7b9ea8e6","ember-4.5.1-NoneLocation":"ember-4.5.1-NoneLocation-7568c6a5d7","ember-4.5.1-RouterService":"ember-4.5.1-RouterService-09fd542dcb","ember-4.5.1-RoutingService":"ember-4.5.1-RoutingService-a65567c39c","ember-4.5.1-BucketCache":"ember-4.5.1-BucketCache-d0b835aec8","ember-4.5.1-RouteInfoWithAttributes":"ember-4.5.1-RouteInfoWithAttributes-6e894f2c86","ember-4.5.1-RouteInfo":"ember-4.5.1-RouteInfo-66db2e3fc5","ember-4.5.1-Route":"ember-4.5.1-Route-25d41993d8","ember-4.5.1-EmberRouter":"ember-4.5.1-EmberRouter-13b1f6dce7","ember-4.5.1-Transition":"ember-4.5.1-Transition-46438e83a6","ember-4.5.1-Ember.ProxyMixin":"ember-4.5.1-Ember.ProxyMixin-dea4c77edf","ember-4.5.1-Ember.ActionHandler":"ember-4.5.1-Ember.ActionHandler-f71a1f1cd0","ember-4.5.1-EmberArray":"ember-4.5.1-EmberArray-080d97a2cd","ember-4.5.1-MutableArray":"ember-4.5.1-MutableArray-fb7ca681f9","ember-4.5.1-Ember.NativeArray":"ember-4.5.1-Ember.NativeArray-922f241686","ember-4.5.1-Ember.Comparable":"ember-4.5.1-Ember.Comparable-b69b0c1dd9","ember-4.5.1-ContainerProxyMixin":"ember-4.5.1-ContainerProxyMixin-e80dfa0a1d","ember-4.5.1-Enumerable":"ember-4.5.1-Enumerable-9e3c5d03e1","ember-4.5.1-Evented":"ember-4.5.1-Evented-af1beb073e","ember-4.5.1-Ember.MutableEnumerable":"ember-4.5.1-Ember.MutableEnumerable-7993816e33","ember-4.5.1-Observable":"ember-4.5.1-Observable-5d0d22e2d6","ember-4.5.1-PromiseProxyMixin":"ember-4.5.1-PromiseProxyMixin-48fc4ca2cd","ember-4.5.1-RegistryProxyMixin":"ember-4.5.1-RegistryProxyMixin-85abba2c39","ember-4.5.1-Ember.TargetActionSupport":"ember-4.5.1-Ember.TargetActionSupport-970d8a170f","ember-4.5.1-ArrayProxy":"ember-4.5.1-ArrayProxy-c362311937","ember-4.5.1-CoreObject":"ember-4.5.1-CoreObject-f282cfa26f","ember-4.5.1-Namespace":"ember-4.5.1-Namespace-7e30bbee01","ember-4.5.1-EmberObject":"ember-4.5.1-EmberObject-96257f5288","ember-4.5.1-ObjectProxy":"ember-4.5.1-ObjectProxy-8ef9e39d93","ember-4.5.1-Ember.ActionSupport":"ember-4.5.1-Ember.ActionSupport-03233f3890","ember-4.5.1-Ember.ClassNamesSupport":"ember-4.5.1-Ember.ClassNamesSupport-265982a2f5","ember-4.5.1-Ember.ViewMixin":"ember-4.5.1-Ember.ViewMixin-ca211ddd30","ember-4.5.1-Ember.EventDispatcher":"ember-4.5.1-Ember.EventDispatcher-b176602c1c","ember-4.5.1-Ember.CoreView":"ember-4.5.1-Ember.CoreView-f27c5dbab7","ember-4.5.1-Application":"ember-4.5.1-Application-63140add7d","ember-4.5.1-ApplicationInstance":"ember-4.5.1-ApplicationInstance-89848557db","ember-4.5.1-ApplicationInstance.BootOptions":"ember-4.5.1-ApplicationInstance.BootOptions-bdf7acc41d","ember-4.5.1-Controller":"ember-4.5.1-Controller-22f6e8498c","ember-4.5.1-Engine":"ember-4.5.1-Engine-c1d4009df8","ember-4.5.1-EngineInstance":"ember-4.5.1-EngineInstance-ef956a9db6","ember-4.5.1-Ember.Error":"ember-4.5.1-Ember.Error-aa9a8affba","ember-4.5.1-Renderer":"ember-4.5.1-Renderer-7881716173","ember-4.5.1-Service":"ember-4.5.1-Service-a1221cc952","ember-4.5.1-String":"ember-4.5.1-String-e2c97c5217","ember-4.5.1-TestAdapter":"ember-4.5.1-TestAdapter-d7f6db7481","ember-4.5.1-Ember.Test.QUnitAdapter":"ember-4.5.1-Ember.Test.QUnitAdapter-acace7bbe5","ember-4.5.1-Ember.Test":"ember-4.5.1-Ember.Test-0b11c0e92a","ember-4.5.1-Ember":"ember-4.5.1-Ember-5fcb2bc61b","ember-4.5.1-Ember.Templates.components":"ember-4.5.1-Ember.Templates.components-8533baa263","ember-4.5.1-rsvp":"ember-4.5.1-rsvp-eeeff056e1","ember-4.5.1-@ember/application":"ember-4.5.1-@ember/application-09c346a385","ember-4.5.1-@ember/array":"ember-4.5.1-@ember/array-0745f5c683","ember-4.5.1-@ember/component":"ember-4.5.1-@ember/component-2fc37d648e","ember-4.5.1-@ember/component/helper":"ember-4.5.1-@ember/component/helper-dc8f61395c","ember-4.5.1-@ember/component/template-only":"ember-4.5.1-@ember/component/template-only-163091f03d","ember-4.5.1-@ember/controller":"ember-4.5.1-@ember/controller-86218e6955","ember-4.5.1-@ember/debug":"ember-4.5.1-@ember/debug-f156c2e4e6","ember-4.5.1-@ember/destroyable":"ember-4.5.1-@ember/destroyable-9cacec7d15","ember-4.5.1-@ember/engine":"ember-4.5.1-@ember/engine-f63078e17e","ember-4.5.1-@ember/helper":"ember-4.5.1-@ember/helper-424284e513","ember-4.5.1-@ember/instrumentation":"ember-4.5.1-@ember/instrumentation-ff300c5556","ember-4.5.1-@ember/object":"ember-4.5.1-@ember/object-660a33255d","ember-4.5.1-@ember/object/compat":"ember-4.5.1-@ember/object/compat-194b097dac","ember-4.5.1-@ember/object/computed":"ember-4.5.1-@ember/object/computed-18b4d64401","ember-4.5.1-@ember/object/evented":"ember-4.5.1-@ember/object/evented-1804716455","ember-4.5.1-@ember/object/events":"ember-4.5.1-@ember/object/events-a855efd241","ember-4.5.1-@ember/object/internals":"ember-4.5.1-@ember/object/internals-d37795c41c","ember-4.5.1-@ember/object/mixin":"ember-4.5.1-@ember/object/mixin-f0e6ce5ac7","ember-4.5.1-@ember/object/observers":"ember-4.5.1-@ember/object/observers-9027481485","ember-4.5.1-@ember/polyfills":"ember-4.5.1-@ember/polyfills-c54e016ffd","ember-4.5.1-@ember/routing":"ember-4.5.1-@ember/routing-99f6dc321d","ember-4.5.1-@ember/runloop":"ember-4.5.1-@ember/runloop-1c8426a6db","ember-4.5.1-@ember/service":"ember-4.5.1-@ember/service-6ed4d344ea","ember-4.5.1-@ember/template":"ember-4.5.1-@ember/template-780ce187d6","ember-4.5.1-@ember/test":"ember-4.5.1-@ember/test-b2d4b7c12e","ember-4.5.1-@ember/utils":"ember-4.5.1-@ember/utils-49fddeb959","ember-4.5.1-@glimmer/tracking":"ember-4.5.1-@glimmer/tracking-d4e5f86c0e","ember-4.5.1-@glimmer/tracking/primitives/cache":"ember-4.5.1-@glimmer/tracking/primitives/cache-e3adb4f77d"},"namespace":{"ember-4.5.1-AutoLocation":"ember-4.5.1-AutoLocation-c465553b45","ember-4.5.1-FEATURES":"ember-4.5.1-FEATURES-e82b4fe43b","ember-4.5.1-Instrumentation":"ember-4.5.1-Instrumentation-b12655591e"},"module":{"ember-4.5.1-rsvp":"ember-4.5.1-rsvp-ed6a93d83c","ember-4.5.1-@ember/debug":"ember-4.5.1-@ember/debug-f03baed254","ember-4.5.1-@ember/component":"ember-4.5.1-@ember/component-386767ada6","ember-4.5.1-@ember/routing":"ember-4.5.1-@ember/routing-122957b63b","ember-4.5.1-ember":"ember-4.5.1-ember-406d9219c1","ember-4.5.1-@ember/template":"ember-4.5.1-@ember/template-80b74c886f","ember-4.5.1-@glimmer/component":"ember-4.5.1-@glimmer/component-14a7e6b095","ember-4.5.1-@glimmer/tracking":"ember-4.5.1-@glimmer/tracking-6768b0b18a","ember-4.5.1-@glimmer/tracking/primitives/cache":"ember-4.5.1-@glimmer/tracking/primitives/cache-d534a380c4","ember-4.5.1-@ember/object":"ember-4.5.1-@ember/object-b7b33a7d02","ember-4.5.1-@ember/utils":"ember-4.5.1-@ember/utils-9df9398e92","ember-4.5.1-@ember/application":"ember-4.5.1-@ember/application-fcadbbf290","ember-4.5.1-@ember/array":"ember-4.5.1-@ember/array-4f34b68132","ember-4.5.1-@ember/enumerable":"ember-4.5.1-@ember/enumerable-b8f37ded9b","ember-4.5.1-@ember/canary-features":"ember-4.5.1-@ember/canary-features-e9652d1be8","ember-4.5.1-@ember/component/template-only":"ember-4.5.1-@ember/component/template-only-386aa0a210","ember-4.5.1-@ember/controller":"ember-4.5.1-@ember/controller-fac883e96c","ember-4.5.1-@ember/destroyable":"ember-4.5.1-@ember/destroyable-99c4d70beb","ember-4.5.1-@ember/engine":"ember-4.5.1-@ember/engine-384d0a0218","ember-4.5.1-@ember/error":"ember-4.5.1-@ember/error-b5d85777fe","ember-4.5.1-@ember/helper":"ember-4.5.1-@ember/helper-c9efad34ab","ember-4.5.1-@ember/instrumentation":"ember-4.5.1-@ember/instrumentation-5dc7699142","ember-4.5.1-@ember/polyfills":"ember-4.5.1-@ember/polyfills-75623813cf","ember-4.5.1-@ember/renderer":"ember-4.5.1-@ember/renderer-ff194b7c9d","ember-4.5.1-@ember/runloop":"ember-4.5.1-@ember/runloop-132400550e","ember-4.5.1-@ember/service":"ember-4.5.1-@ember/service-b428fd5170","ember-4.5.1-@ember/string":"ember-4.5.1-@ember/string-c69ed6f92a","ember-4.5.1-@ember/test":"ember-4.5.1-@ember/test-f25b812f49"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Ember.Object":"Ember.Object-9c32970d20","Error":"Error-158974c414"}}} \ No newline at end of file diff --git a/rev-index/ember-4.6.0.json b/rev-index/ember-4.6.0.json index 4e8cf008d..7f6e67c5b 100644 --- a/rev-index/ember-4.6.0.json +++ b/rev-index/ember-4.6.0.json @@ -1 +1 @@ -{"data":{"id":"ember-4.6.0","type":"project-version","attributes":{"version":"4.6.0"},"relationships":{"classes":{"data":[{"id":"ember-4.6.0-Promise","type":"class"},{"id":"ember-4.6.0-EventTarget","type":"class"},{"id":"ember-4.6.0-Container","type":"class"},{"id":"ember-4.6.0-Registry","type":"class"},{"id":"ember-4.6.0-EmberENV","type":"class"},{"id":"ember-4.6.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.6.0-DataAdapter","type":"class"},{"id":"ember-4.6.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.6.0-ComponentStateBucket","type":"class"},{"id":"ember-4.6.0-Component","type":"class"},{"id":"ember-4.6.0-Helper","type":"class"},{"id":"ember-4.6.0-ComputedProperty","type":"class"},{"id":"ember-4.6.0-Descriptor","type":"class"},{"id":"ember-4.6.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.6.0-Libraries","type":"class"},{"id":"ember-4.6.0-Mixin","type":"class"},{"id":"ember-4.6.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.6.0-Location","type":"class"},{"id":"ember-4.6.0-HashLocation","type":"class"},{"id":"ember-4.6.0-HistoryLocation","type":"class"},{"id":"ember-4.6.0-NoneLocation","type":"class"},{"id":"ember-4.6.0-RouterService","type":"class"},{"id":"ember-4.6.0-RoutingService","type":"class"},{"id":"ember-4.6.0-BucketCache","type":"class"},{"id":"ember-4.6.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.6.0-RouteInfo","type":"class"},{"id":"ember-4.6.0-Route","type":"class"},{"id":"ember-4.6.0-EmberRouter","type":"class"},{"id":"ember-4.6.0-Transition","type":"class"},{"id":"ember-4.6.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.6.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.6.0-EmberArray","type":"class"},{"id":"ember-4.6.0-MutableArray","type":"class"},{"id":"ember-4.6.0-Ember.NativeArray","type":"class"},{"id":"ember-4.6.0-Ember.Comparable","type":"class"},{"id":"ember-4.6.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.6.0-Enumerable","type":"class"},{"id":"ember-4.6.0-Evented","type":"class"},{"id":"ember-4.6.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.6.0-Observable","type":"class"},{"id":"ember-4.6.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.6.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.6.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.6.0-ArrayProxy","type":"class"},{"id":"ember-4.6.0-CoreObject","type":"class"},{"id":"ember-4.6.0-Namespace","type":"class"},{"id":"ember-4.6.0-EmberObject","type":"class"},{"id":"ember-4.6.0-ObjectProxy","type":"class"},{"id":"ember-4.6.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.6.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.6.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.6.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.6.0-Ember.CoreView","type":"class"},{"id":"ember-4.6.0-Application","type":"class"},{"id":"ember-4.6.0-ApplicationInstance","type":"class"},{"id":"ember-4.6.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.6.0-Controller","type":"class"},{"id":"ember-4.6.0-Engine","type":"class"},{"id":"ember-4.6.0-EngineInstance","type":"class"},{"id":"ember-4.6.0-Ember.Error","type":"class"},{"id":"ember-4.6.0-Renderer","type":"class"},{"id":"ember-4.6.0-Service","type":"class"},{"id":"ember-4.6.0-String","type":"class"},{"id":"ember-4.6.0-TestAdapter","type":"class"},{"id":"ember-4.6.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.6.0-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.6.0-AutoLocation","type":"namespace"},{"id":"ember-4.6.0-FEATURES","type":"namespace"},{"id":"ember-4.6.0-Instrumentation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.6.0-rsvp","type":"module"},{"id":"ember-4.6.0-@ember/debug","type":"module"},{"id":"ember-4.6.0-@ember/component","type":"module"},{"id":"ember-4.6.0-@ember/routing","type":"module"},{"id":"ember-4.6.0-ember","type":"module"},{"id":"ember-4.6.0-@ember/template","type":"module"},{"id":"ember-4.6.0-@glimmer/component","type":"module"},{"id":"ember-4.6.0-@glimmer/tracking","type":"module"},{"id":"ember-4.6.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.6.0-@ember/object","type":"module"},{"id":"ember-4.6.0-@ember/utils","type":"module"},{"id":"ember-4.6.0-@ember/application","type":"module"},{"id":"ember-4.6.0-@ember/array","type":"module"},{"id":"ember-4.6.0-@ember/enumerable","type":"module"},{"id":"ember-4.6.0-@ember/canary-features","type":"module"},{"id":"ember-4.6.0-@ember/component/template-only","type":"module"},{"id":"ember-4.6.0-@ember/controller","type":"module"},{"id":"ember-4.6.0-@ember/destroyable","type":"module"},{"id":"ember-4.6.0-@ember/engine","type":"module"},{"id":"ember-4.6.0-@ember/error","type":"module"},{"id":"ember-4.6.0-@ember/helper","type":"module"},{"id":"ember-4.6.0-@ember/instrumentation","type":"module"},{"id":"ember-4.6.0-@ember/polyfills","type":"module"},{"id":"ember-4.6.0-@ember/renderer","type":"module"},{"id":"ember-4.6.0-@ember/runloop","type":"module"},{"id":"ember-4.6.0-@ember/service","type":"module"},{"id":"ember-4.6.0-@ember/string","type":"module"},{"id":"ember-4.6.0-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.6.0-Container","type":"class"},{"id":"ember-4.6.0-Registry","type":"class"},{"id":"ember-4.6.0-ComponentStateBucket","type":"class"},{"id":"ember-4.6.0-Descriptor","type":"class"},{"id":"ember-4.6.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.6.0-Libraries","type":"class"},{"id":"ember-4.6.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.6.0-Location","type":"class"},{"id":"ember-4.6.0-RoutingService","type":"class"},{"id":"ember-4.6.0-BucketCache","type":"class"},{"id":"ember-4.6.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.6.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.6.0-Ember.Comparable","type":"class"},{"id":"ember-4.6.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.6.0-Enumerable","type":"class"},{"id":"ember-4.6.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.6.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.6.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.6.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.6.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.6.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.6.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.6.0-Ember.CoreView","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.6.0-Promise","type":"class"},{"id":"ember-4.6.0-EventTarget","type":"class"},{"id":"ember-4.6.0-EmberENV","type":"class"},{"id":"ember-4.6.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.6.0-DataAdapter","type":"class"},{"id":"ember-4.6.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.6.0-Component","type":"class"},{"id":"ember-4.6.0-Helper","type":"class"},{"id":"ember-4.6.0-ComputedProperty","type":"class"},{"id":"ember-4.6.0-Mixin","type":"class"},{"id":"ember-4.6.0-HashLocation","type":"class"},{"id":"ember-4.6.0-HistoryLocation","type":"class"},{"id":"ember-4.6.0-NoneLocation","type":"class"},{"id":"ember-4.6.0-RouterService","type":"class"},{"id":"ember-4.6.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.6.0-RouteInfo","type":"class"},{"id":"ember-4.6.0-Route","type":"class"},{"id":"ember-4.6.0-EmberRouter","type":"class"},{"id":"ember-4.6.0-Transition","type":"class"},{"id":"ember-4.6.0-EmberArray","type":"class"},{"id":"ember-4.6.0-MutableArray","type":"class"},{"id":"ember-4.6.0-Ember.NativeArray","type":"class"},{"id":"ember-4.6.0-Evented","type":"class"},{"id":"ember-4.6.0-Observable","type":"class"},{"id":"ember-4.6.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.6.0-ArrayProxy","type":"class"},{"id":"ember-4.6.0-CoreObject","type":"class"},{"id":"ember-4.6.0-Namespace","type":"class"},{"id":"ember-4.6.0-EmberObject","type":"class"},{"id":"ember-4.6.0-ObjectProxy","type":"class"},{"id":"ember-4.6.0-Application","type":"class"},{"id":"ember-4.6.0-ApplicationInstance","type":"class"},{"id":"ember-4.6.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.6.0-Controller","type":"class"},{"id":"ember-4.6.0-Engine","type":"class"},{"id":"ember-4.6.0-EngineInstance","type":"class"},{"id":"ember-4.6.0-Ember.Error","type":"class"},{"id":"ember-4.6.0-Renderer","type":"class"},{"id":"ember-4.6.0-Service","type":"class"},{"id":"ember-4.6.0-String","type":"class"},{"id":"ember-4.6.0-TestAdapter","type":"class"},{"id":"ember-4.6.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.6.0-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.6.0-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.6.0-AutoLocation","type":"namespace"},{"id":"ember-4.6.0-FEATURES","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.6.0-ember","type":"module"},{"id":"ember-4.6.0-@ember/enumerable","type":"module"},{"id":"ember-4.6.0-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.6.0-rsvp","type":"module"},{"id":"ember-4.6.0-@ember/debug","type":"module"},{"id":"ember-4.6.0-@ember/component","type":"module"},{"id":"ember-4.6.0-@ember/routing","type":"module"},{"id":"ember-4.6.0-@ember/template","type":"module"},{"id":"ember-4.6.0-@glimmer/component","type":"module"},{"id":"ember-4.6.0-@glimmer/tracking","type":"module"},{"id":"ember-4.6.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.6.0-@ember/object","type":"module"},{"id":"ember-4.6.0-@ember/utils","type":"module"},{"id":"ember-4.6.0-@ember/application","type":"module"},{"id":"ember-4.6.0-@ember/array","type":"module"},{"id":"ember-4.6.0-@ember/canary-features","type":"module"},{"id":"ember-4.6.0-@ember/component/template-only","type":"module"},{"id":"ember-4.6.0-@ember/controller","type":"module"},{"id":"ember-4.6.0-@ember/destroyable","type":"module"},{"id":"ember-4.6.0-@ember/engine","type":"module"},{"id":"ember-4.6.0-@ember/error","type":"module"},{"id":"ember-4.6.0-@ember/helper","type":"module"},{"id":"ember-4.6.0-@ember/polyfills","type":"module"},{"id":"ember-4.6.0-@ember/renderer","type":"module"},{"id":"ember-4.6.0-@ember/runloop","type":"module"},{"id":"ember-4.6.0-@ember/service","type":"module"},{"id":"ember-4.6.0-@ember/string","type":"module"},{"id":"ember-4.6.0-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.6.0-Promise":"ember-4.6.0-Promise-08f22bd397","ember-4.6.0-EventTarget":"ember-4.6.0-EventTarget-6ad3a1d266","ember-4.6.0-Container":"ember-4.6.0-Container-7f58ea8b91","ember-4.6.0-Registry":"ember-4.6.0-Registry-d97248d815","ember-4.6.0-EmberENV":"ember-4.6.0-EmberENV-0d67bea877","ember-4.6.0-ContainerDebugAdapter":"ember-4.6.0-ContainerDebugAdapter-605349d4c6","ember-4.6.0-DataAdapter":"ember-4.6.0-DataAdapter-438a384cc5","ember-4.6.0-Ember.Templates.helpers":"ember-4.6.0-Ember.Templates.helpers-df43a0bc49","ember-4.6.0-ComponentStateBucket":"ember-4.6.0-ComponentStateBucket-9f7a12971d","ember-4.6.0-Component":"ember-4.6.0-Component-76d1820380","ember-4.6.0-Helper":"ember-4.6.0-Helper-df22a4dd59","ember-4.6.0-ComputedProperty":"ember-4.6.0-ComputedProperty-42618c5e85","ember-4.6.0-Descriptor":"ember-4.6.0-Descriptor-ea5e521aab","ember-4.6.0-Ember.InjectedProperty":"ember-4.6.0-Ember.InjectedProperty-7d452439bd","ember-4.6.0-Libraries":"ember-4.6.0-Libraries-8969110341","ember-4.6.0-Mixin":"ember-4.6.0-Mixin-62dc62a946","ember-4.6.0-Ember.ControllerMixin":"ember-4.6.0-Ember.ControllerMixin-2aeb4d7c38","ember-4.6.0-Location":"ember-4.6.0-Location-214b287cbc","ember-4.6.0-HashLocation":"ember-4.6.0-HashLocation-a22381fb99","ember-4.6.0-HistoryLocation":"ember-4.6.0-HistoryLocation-9c6bae5177","ember-4.6.0-NoneLocation":"ember-4.6.0-NoneLocation-2c42c300e9","ember-4.6.0-RouterService":"ember-4.6.0-RouterService-1fdbca3cc6","ember-4.6.0-RoutingService":"ember-4.6.0-RoutingService-6fc3c81b8d","ember-4.6.0-BucketCache":"ember-4.6.0-BucketCache-1ecd81116d","ember-4.6.0-RouteInfoWithAttributes":"ember-4.6.0-RouteInfoWithAttributes-91f82a3e3a","ember-4.6.0-RouteInfo":"ember-4.6.0-RouteInfo-3984b29634","ember-4.6.0-Route":"ember-4.6.0-Route-6e996c9a59","ember-4.6.0-EmberRouter":"ember-4.6.0-EmberRouter-345813ac44","ember-4.6.0-Transition":"ember-4.6.0-Transition-8b1b91df31","ember-4.6.0-Ember.ProxyMixin":"ember-4.6.0-Ember.ProxyMixin-d3dfad99d0","ember-4.6.0-Ember.ActionHandler":"ember-4.6.0-Ember.ActionHandler-79ef87eea3","ember-4.6.0-EmberArray":"ember-4.6.0-EmberArray-96601c58e2","ember-4.6.0-MutableArray":"ember-4.6.0-MutableArray-911a519dfd","ember-4.6.0-Ember.NativeArray":"ember-4.6.0-Ember.NativeArray-8fb95256bd","ember-4.6.0-Ember.Comparable":"ember-4.6.0-Ember.Comparable-b6a28bf9bc","ember-4.6.0-ContainerProxyMixin":"ember-4.6.0-ContainerProxyMixin-f2b20a9fd7","ember-4.6.0-Enumerable":"ember-4.6.0-Enumerable-c0d90f1447","ember-4.6.0-Evented":"ember-4.6.0-Evented-d55b8494d9","ember-4.6.0-Ember.MutableEnumerable":"ember-4.6.0-Ember.MutableEnumerable-5faf51a47b","ember-4.6.0-Observable":"ember-4.6.0-Observable-948ed57362","ember-4.6.0-PromiseProxyMixin":"ember-4.6.0-PromiseProxyMixin-77dc04bacc","ember-4.6.0-RegistryProxyMixin":"ember-4.6.0-RegistryProxyMixin-30e87a211d","ember-4.6.0-Ember.TargetActionSupport":"ember-4.6.0-Ember.TargetActionSupport-ef0cd31ae2","ember-4.6.0-ArrayProxy":"ember-4.6.0-ArrayProxy-6f3145e758","ember-4.6.0-CoreObject":"ember-4.6.0-CoreObject-6971985f39","ember-4.6.0-Namespace":"ember-4.6.0-Namespace-2bb73900b7","ember-4.6.0-EmberObject":"ember-4.6.0-EmberObject-870a9bec7e","ember-4.6.0-ObjectProxy":"ember-4.6.0-ObjectProxy-b283416c3b","ember-4.6.0-Ember.ActionSupport":"ember-4.6.0-Ember.ActionSupport-640cbd5d84","ember-4.6.0-Ember.ClassNamesSupport":"ember-4.6.0-Ember.ClassNamesSupport-0322a69192","ember-4.6.0-Ember.ViewMixin":"ember-4.6.0-Ember.ViewMixin-3d8030cf73","ember-4.6.0-Ember.EventDispatcher":"ember-4.6.0-Ember.EventDispatcher-86276e8d33","ember-4.6.0-Ember.CoreView":"ember-4.6.0-Ember.CoreView-6b6b981752","ember-4.6.0-Application":"ember-4.6.0-Application-63f98aa0f2","ember-4.6.0-ApplicationInstance":"ember-4.6.0-ApplicationInstance-03323eadef","ember-4.6.0-ApplicationInstance.BootOptions":"ember-4.6.0-ApplicationInstance.BootOptions-068ec75154","ember-4.6.0-Controller":"ember-4.6.0-Controller-85ab007063","ember-4.6.0-Engine":"ember-4.6.0-Engine-477b592aee","ember-4.6.0-EngineInstance":"ember-4.6.0-EngineInstance-e50a19eb9e","ember-4.6.0-Ember.Error":"ember-4.6.0-Ember.Error-4597d0a24b","ember-4.6.0-Renderer":"ember-4.6.0-Renderer-2b27ca237c","ember-4.6.0-Service":"ember-4.6.0-Service-50c6af1873","ember-4.6.0-String":"ember-4.6.0-String-6789dc9b90","ember-4.6.0-TestAdapter":"ember-4.6.0-TestAdapter-0c5018dfbf","ember-4.6.0-Ember.Test.QUnitAdapter":"ember-4.6.0-Ember.Test.QUnitAdapter-ba03a582ad","ember-4.6.0-Ember.Test":"ember-4.6.0-Ember.Test-f4930c39de","ember-4.6.0-Ember":"ember-4.6.0-Ember-83639b627c","ember-4.6.0-Ember.Templates.components":"ember-4.6.0-Ember.Templates.components-72521b6948","ember-4.6.0-rsvp":"ember-4.6.0-rsvp-6f9ea03d98","ember-4.6.0-@ember/application":"ember-4.6.0-@ember/application-7aa8419fb0","ember-4.6.0-@ember/array":"ember-4.6.0-@ember/array-a55f7d822e","ember-4.6.0-@ember/component":"ember-4.6.0-@ember/component-cec094139d","ember-4.6.0-@ember/component/helper":"ember-4.6.0-@ember/component/helper-6eb16f1b33","ember-4.6.0-@ember/component/template-only":"ember-4.6.0-@ember/component/template-only-13d3759f46","ember-4.6.0-@ember/controller":"ember-4.6.0-@ember/controller-7c4deea653","ember-4.6.0-@ember/debug":"ember-4.6.0-@ember/debug-468dde9a3d","ember-4.6.0-@ember/destroyable":"ember-4.6.0-@ember/destroyable-a84023c846","ember-4.6.0-@ember/engine":"ember-4.6.0-@ember/engine-fb571619ee","ember-4.6.0-@ember/helper":"ember-4.6.0-@ember/helper-b9aae83dd1","ember-4.6.0-@ember/instrumentation":"ember-4.6.0-@ember/instrumentation-07adfb2477","ember-4.6.0-@ember/object":"ember-4.6.0-@ember/object-db543a6b30","ember-4.6.0-@ember/object/compat":"ember-4.6.0-@ember/object/compat-7aabdbb38e","ember-4.6.0-@ember/object/computed":"ember-4.6.0-@ember/object/computed-a1560ea775","ember-4.6.0-@ember/object/evented":"ember-4.6.0-@ember/object/evented-ab5adbcbd3","ember-4.6.0-@ember/object/events":"ember-4.6.0-@ember/object/events-670d75425b","ember-4.6.0-@ember/object/internals":"ember-4.6.0-@ember/object/internals-ff901748f1","ember-4.6.0-@ember/object/mixin":"ember-4.6.0-@ember/object/mixin-30ba585e70","ember-4.6.0-@ember/object/observers":"ember-4.6.0-@ember/object/observers-99ecc1c07d","ember-4.6.0-@ember/polyfills":"ember-4.6.0-@ember/polyfills-299ffe5952","ember-4.6.0-@ember/routing":"ember-4.6.0-@ember/routing-78700c3c0f","ember-4.6.0-@ember/runloop":"ember-4.6.0-@ember/runloop-216318b30f","ember-4.6.0-@ember/service":"ember-4.6.0-@ember/service-2de853fbc6","ember-4.6.0-@ember/template":"ember-4.6.0-@ember/template-a88337afd1","ember-4.6.0-@ember/test":"ember-4.6.0-@ember/test-eee68a3679","ember-4.6.0-@ember/utils":"ember-4.6.0-@ember/utils-eaf7acdb22","ember-4.6.0-@glimmer/tracking":"ember-4.6.0-@glimmer/tracking-5bd127b440","ember-4.6.0-@glimmer/tracking/primitives/cache":"ember-4.6.0-@glimmer/tracking/primitives/cache-5efedd1fea"},"namespace":{"ember-4.6.0-AutoLocation":"ember-4.6.0-AutoLocation-176f3bad8f","ember-4.6.0-FEATURES":"ember-4.6.0-FEATURES-b2ebf9841b","ember-4.6.0-Instrumentation":"ember-4.6.0-Instrumentation-82164ecef9"},"module":{"ember-4.6.0-rsvp":"ember-4.6.0-rsvp-1ed6b5d0e1","ember-4.6.0-@ember/debug":"ember-4.6.0-@ember/debug-5bcc61fc66","ember-4.6.0-@ember/component":"ember-4.6.0-@ember/component-cafbca60ae","ember-4.6.0-@ember/routing":"ember-4.6.0-@ember/routing-9344d9d9c9","ember-4.6.0-ember":"ember-4.6.0-ember-6740923365","ember-4.6.0-@ember/template":"ember-4.6.0-@ember/template-9542107dd8","ember-4.6.0-@glimmer/component":"ember-4.6.0-@glimmer/component-448482295f","ember-4.6.0-@glimmer/tracking":"ember-4.6.0-@glimmer/tracking-a1e958a5e3","ember-4.6.0-@glimmer/tracking/primitives/cache":"ember-4.6.0-@glimmer/tracking/primitives/cache-5f0a43c462","ember-4.6.0-@ember/object":"ember-4.6.0-@ember/object-5fc13a5a99","ember-4.6.0-@ember/utils":"ember-4.6.0-@ember/utils-26642bdb02","ember-4.6.0-@ember/application":"ember-4.6.0-@ember/application-d9016188bd","ember-4.6.0-@ember/array":"ember-4.6.0-@ember/array-7165308fa5","ember-4.6.0-@ember/enumerable":"ember-4.6.0-@ember/enumerable-12b519ebf6","ember-4.6.0-@ember/canary-features":"ember-4.6.0-@ember/canary-features-390b925589","ember-4.6.0-@ember/component/template-only":"ember-4.6.0-@ember/component/template-only-93c8dce96e","ember-4.6.0-@ember/controller":"ember-4.6.0-@ember/controller-83d8b35f4a","ember-4.6.0-@ember/destroyable":"ember-4.6.0-@ember/destroyable-9adad90442","ember-4.6.0-@ember/engine":"ember-4.6.0-@ember/engine-a0b441f9d0","ember-4.6.0-@ember/error":"ember-4.6.0-@ember/error-bd79295c2f","ember-4.6.0-@ember/helper":"ember-4.6.0-@ember/helper-b2d8163d52","ember-4.6.0-@ember/instrumentation":"ember-4.6.0-@ember/instrumentation-e66f0fbec7","ember-4.6.0-@ember/polyfills":"ember-4.6.0-@ember/polyfills-c55e9698d4","ember-4.6.0-@ember/renderer":"ember-4.6.0-@ember/renderer-9099164c01","ember-4.6.0-@ember/runloop":"ember-4.6.0-@ember/runloop-335c732f5b","ember-4.6.0-@ember/service":"ember-4.6.0-@ember/service-7bbca87406","ember-4.6.0-@ember/string":"ember-4.6.0-@ember/string-29957c517f","ember-4.6.0-@ember/test":"ember-4.6.0-@ember/test-472d129dff"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Ember.Object":"Ember.Object-9c32970d20","Error":"Error-158974c414"}}} \ No newline at end of file +{"data":{"id":"ember-4.6.0","type":"project-version","attributes":{"version":"4.6.0"},"relationships":{"classes":{"data":[{"id":"ember-4.6.0-Promise","type":"class"},{"id":"ember-4.6.0-EventTarget","type":"class"},{"id":"ember-4.6.0-Container","type":"class"},{"id":"ember-4.6.0-Registry","type":"class"},{"id":"ember-4.6.0-EmberENV","type":"class"},{"id":"ember-4.6.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.6.0-DataAdapter","type":"class"},{"id":"ember-4.6.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.6.0-ComponentStateBucket","type":"class"},{"id":"ember-4.6.0-Component","type":"class"},{"id":"ember-4.6.0-Helper","type":"class"},{"id":"ember-4.6.0-ComputedProperty","type":"class"},{"id":"ember-4.6.0-Descriptor","type":"class"},{"id":"ember-4.6.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.6.0-Libraries","type":"class"},{"id":"ember-4.6.0-Mixin","type":"class"},{"id":"ember-4.6.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.6.0-Location","type":"class"},{"id":"ember-4.6.0-HashLocation","type":"class"},{"id":"ember-4.6.0-HistoryLocation","type":"class"},{"id":"ember-4.6.0-NoneLocation","type":"class"},{"id":"ember-4.6.0-RouterService","type":"class"},{"id":"ember-4.6.0-RoutingService","type":"class"},{"id":"ember-4.6.0-BucketCache","type":"class"},{"id":"ember-4.6.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.6.0-RouteInfo","type":"class"},{"id":"ember-4.6.0-Route","type":"class"},{"id":"ember-4.6.0-EmberRouter","type":"class"},{"id":"ember-4.6.0-Transition","type":"class"},{"id":"ember-4.6.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.6.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.6.0-EmberArray","type":"class"},{"id":"ember-4.6.0-MutableArray","type":"class"},{"id":"ember-4.6.0-Ember.NativeArray","type":"class"},{"id":"ember-4.6.0-Ember.Comparable","type":"class"},{"id":"ember-4.6.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.6.0-Enumerable","type":"class"},{"id":"ember-4.6.0-Evented","type":"class"},{"id":"ember-4.6.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.6.0-Observable","type":"class"},{"id":"ember-4.6.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.6.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.6.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.6.0-ArrayProxy","type":"class"},{"id":"ember-4.6.0-CoreObject","type":"class"},{"id":"ember-4.6.0-Namespace","type":"class"},{"id":"ember-4.6.0-EmberObject","type":"class"},{"id":"ember-4.6.0-ObjectProxy","type":"class"},{"id":"ember-4.6.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.6.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.6.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.6.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.6.0-Ember.CoreView","type":"class"},{"id":"ember-4.6.0-Application","type":"class"},{"id":"ember-4.6.0-ApplicationInstance","type":"class"},{"id":"ember-4.6.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.6.0-Controller","type":"class"},{"id":"ember-4.6.0-Engine","type":"class"},{"id":"ember-4.6.0-EngineInstance","type":"class"},{"id":"ember-4.6.0-Ember.Error","type":"class"},{"id":"ember-4.6.0-Renderer","type":"class"},{"id":"ember-4.6.0-Service","type":"class"},{"id":"ember-4.6.0-String","type":"class"},{"id":"ember-4.6.0-TestAdapter","type":"class"},{"id":"ember-4.6.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.6.0-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.6.0-AutoLocation","type":"namespace"},{"id":"ember-4.6.0-FEATURES","type":"namespace"},{"id":"ember-4.6.0-Instrumentation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.6.0-rsvp","type":"module"},{"id":"ember-4.6.0-@ember/debug","type":"module"},{"id":"ember-4.6.0-@ember/component","type":"module"},{"id":"ember-4.6.0-@ember/routing","type":"module"},{"id":"ember-4.6.0-ember","type":"module"},{"id":"ember-4.6.0-@ember/template","type":"module"},{"id":"ember-4.6.0-@glimmer/component","type":"module"},{"id":"ember-4.6.0-@glimmer/tracking","type":"module"},{"id":"ember-4.6.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.6.0-@ember/object","type":"module"},{"id":"ember-4.6.0-@ember/utils","type":"module"},{"id":"ember-4.6.0-@ember/application","type":"module"},{"id":"ember-4.6.0-@ember/array","type":"module"},{"id":"ember-4.6.0-@ember/enumerable","type":"module"},{"id":"ember-4.6.0-@ember/canary-features","type":"module"},{"id":"ember-4.6.0-@ember/component/template-only","type":"module"},{"id":"ember-4.6.0-@ember/controller","type":"module"},{"id":"ember-4.6.0-@ember/destroyable","type":"module"},{"id":"ember-4.6.0-@ember/engine","type":"module"},{"id":"ember-4.6.0-@ember/error","type":"module"},{"id":"ember-4.6.0-@ember/helper","type":"module"},{"id":"ember-4.6.0-@ember/instrumentation","type":"module"},{"id":"ember-4.6.0-@ember/polyfills","type":"module"},{"id":"ember-4.6.0-@ember/renderer","type":"module"},{"id":"ember-4.6.0-@ember/runloop","type":"module"},{"id":"ember-4.6.0-@ember/service","type":"module"},{"id":"ember-4.6.0-@ember/string","type":"module"},{"id":"ember-4.6.0-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.6.0-Container","type":"class"},{"id":"ember-4.6.0-Registry","type":"class"},{"id":"ember-4.6.0-ComponentStateBucket","type":"class"},{"id":"ember-4.6.0-Descriptor","type":"class"},{"id":"ember-4.6.0-Ember.InjectedProperty","type":"class"},{"id":"ember-4.6.0-Libraries","type":"class"},{"id":"ember-4.6.0-Ember.ControllerMixin","type":"class"},{"id":"ember-4.6.0-Location","type":"class"},{"id":"ember-4.6.0-RoutingService","type":"class"},{"id":"ember-4.6.0-BucketCache","type":"class"},{"id":"ember-4.6.0-Ember.ProxyMixin","type":"class"},{"id":"ember-4.6.0-Ember.ActionHandler","type":"class"},{"id":"ember-4.6.0-Ember.Comparable","type":"class"},{"id":"ember-4.6.0-ContainerProxyMixin","type":"class"},{"id":"ember-4.6.0-Enumerable","type":"class"},{"id":"ember-4.6.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.6.0-RegistryProxyMixin","type":"class"},{"id":"ember-4.6.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.6.0-Ember.ActionSupport","type":"class"},{"id":"ember-4.6.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.6.0-Ember.ViewMixin","type":"class"},{"id":"ember-4.6.0-Ember.EventDispatcher","type":"class"},{"id":"ember-4.6.0-Ember.CoreView","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.6.0-Promise","type":"class"},{"id":"ember-4.6.0-EventTarget","type":"class"},{"id":"ember-4.6.0-EmberENV","type":"class"},{"id":"ember-4.6.0-ContainerDebugAdapter","type":"class"},{"id":"ember-4.6.0-DataAdapter","type":"class"},{"id":"ember-4.6.0-Ember.Templates.helpers","type":"class"},{"id":"ember-4.6.0-Component","type":"class"},{"id":"ember-4.6.0-Helper","type":"class"},{"id":"ember-4.6.0-ComputedProperty","type":"class"},{"id":"ember-4.6.0-Mixin","type":"class"},{"id":"ember-4.6.0-HashLocation","type":"class"},{"id":"ember-4.6.0-HistoryLocation","type":"class"},{"id":"ember-4.6.0-NoneLocation","type":"class"},{"id":"ember-4.6.0-RouterService","type":"class"},{"id":"ember-4.6.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.6.0-RouteInfo","type":"class"},{"id":"ember-4.6.0-Route","type":"class"},{"id":"ember-4.6.0-EmberRouter","type":"class"},{"id":"ember-4.6.0-Transition","type":"class"},{"id":"ember-4.6.0-EmberArray","type":"class"},{"id":"ember-4.6.0-MutableArray","type":"class"},{"id":"ember-4.6.0-Ember.NativeArray","type":"class"},{"id":"ember-4.6.0-Evented","type":"class"},{"id":"ember-4.6.0-Observable","type":"class"},{"id":"ember-4.6.0-PromiseProxyMixin","type":"class"},{"id":"ember-4.6.0-ArrayProxy","type":"class"},{"id":"ember-4.6.0-CoreObject","type":"class"},{"id":"ember-4.6.0-Namespace","type":"class"},{"id":"ember-4.6.0-EmberObject","type":"class"},{"id":"ember-4.6.0-ObjectProxy","type":"class"},{"id":"ember-4.6.0-Application","type":"class"},{"id":"ember-4.6.0-ApplicationInstance","type":"class"},{"id":"ember-4.6.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.6.0-Controller","type":"class"},{"id":"ember-4.6.0-Engine","type":"class"},{"id":"ember-4.6.0-EngineInstance","type":"class"},{"id":"ember-4.6.0-Ember.Error","type":"class"},{"id":"ember-4.6.0-Renderer","type":"class"},{"id":"ember-4.6.0-Service","type":"class"},{"id":"ember-4.6.0-String","type":"class"},{"id":"ember-4.6.0-TestAdapter","type":"class"},{"id":"ember-4.6.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.6.0-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.6.0-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.6.0-AutoLocation","type":"namespace"},{"id":"ember-4.6.0-FEATURES","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.6.0-ember","type":"module"},{"id":"ember-4.6.0-@ember/enumerable","type":"module"},{"id":"ember-4.6.0-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.6.0-rsvp","type":"module"},{"id":"ember-4.6.0-@ember/debug","type":"module"},{"id":"ember-4.6.0-@ember/component","type":"module"},{"id":"ember-4.6.0-@ember/routing","type":"module"},{"id":"ember-4.6.0-@ember/template","type":"module"},{"id":"ember-4.6.0-@glimmer/component","type":"module"},{"id":"ember-4.6.0-@glimmer/tracking","type":"module"},{"id":"ember-4.6.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.6.0-@ember/object","type":"module"},{"id":"ember-4.6.0-@ember/utils","type":"module"},{"id":"ember-4.6.0-@ember/application","type":"module"},{"id":"ember-4.6.0-@ember/array","type":"module"},{"id":"ember-4.6.0-@ember/canary-features","type":"module"},{"id":"ember-4.6.0-@ember/component/template-only","type":"module"},{"id":"ember-4.6.0-@ember/controller","type":"module"},{"id":"ember-4.6.0-@ember/destroyable","type":"module"},{"id":"ember-4.6.0-@ember/engine","type":"module"},{"id":"ember-4.6.0-@ember/error","type":"module"},{"id":"ember-4.6.0-@ember/helper","type":"module"},{"id":"ember-4.6.0-@ember/polyfills","type":"module"},{"id":"ember-4.6.0-@ember/renderer","type":"module"},{"id":"ember-4.6.0-@ember/runloop","type":"module"},{"id":"ember-4.6.0-@ember/service","type":"module"},{"id":"ember-4.6.0-@ember/string","type":"module"},{"id":"ember-4.6.0-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.6.0-Promise":"ember-4.6.0-Promise-adfae77aaf","ember-4.6.0-EventTarget":"ember-4.6.0-EventTarget-6ad3a1d266","ember-4.6.0-Container":"ember-4.6.0-Container-81db5dce78","ember-4.6.0-Registry":"ember-4.6.0-Registry-19a792ccc3","ember-4.6.0-EmberENV":"ember-4.6.0-EmberENV-0d67bea877","ember-4.6.0-ContainerDebugAdapter":"ember-4.6.0-ContainerDebugAdapter-cf8a35a7ec","ember-4.6.0-DataAdapter":"ember-4.6.0-DataAdapter-fda7225810","ember-4.6.0-Ember.Templates.helpers":"ember-4.6.0-Ember.Templates.helpers-57eddaeb3c","ember-4.6.0-ComponentStateBucket":"ember-4.6.0-ComponentStateBucket-9f7a12971d","ember-4.6.0-Component":"ember-4.6.0-Component-289a541439","ember-4.6.0-Helper":"ember-4.6.0-Helper-e93c62f3e4","ember-4.6.0-ComputedProperty":"ember-4.6.0-ComputedProperty-c20af30b2d","ember-4.6.0-Descriptor":"ember-4.6.0-Descriptor-ea5e521aab","ember-4.6.0-Ember.InjectedProperty":"ember-4.6.0-Ember.InjectedProperty-7d452439bd","ember-4.6.0-Libraries":"ember-4.6.0-Libraries-8969110341","ember-4.6.0-Mixin":"ember-4.6.0-Mixin-072b173cae","ember-4.6.0-Ember.ControllerMixin":"ember-4.6.0-Ember.ControllerMixin-6eceab4b02","ember-4.6.0-Location":"ember-4.6.0-Location-92519d93ef","ember-4.6.0-HashLocation":"ember-4.6.0-HashLocation-1562bdf66d","ember-4.6.0-HistoryLocation":"ember-4.6.0-HistoryLocation-d9f50258e7","ember-4.6.0-NoneLocation":"ember-4.6.0-NoneLocation-94f1419168","ember-4.6.0-RouterService":"ember-4.6.0-RouterService-21e3fbef62","ember-4.6.0-RoutingService":"ember-4.6.0-RoutingService-6fc3c81b8d","ember-4.6.0-BucketCache":"ember-4.6.0-BucketCache-1ecd81116d","ember-4.6.0-RouteInfoWithAttributes":"ember-4.6.0-RouteInfoWithAttributes-9e46f38d8b","ember-4.6.0-RouteInfo":"ember-4.6.0-RouteInfo-99a9923366","ember-4.6.0-Route":"ember-4.6.0-Route-59cb1471c7","ember-4.6.0-EmberRouter":"ember-4.6.0-EmberRouter-bcd53fae40","ember-4.6.0-Transition":"ember-4.6.0-Transition-8b1b91df31","ember-4.6.0-Ember.ProxyMixin":"ember-4.6.0-Ember.ProxyMixin-d3dfad99d0","ember-4.6.0-Ember.ActionHandler":"ember-4.6.0-Ember.ActionHandler-b74ae5f873","ember-4.6.0-EmberArray":"ember-4.6.0-EmberArray-ada5d35ae2","ember-4.6.0-MutableArray":"ember-4.6.0-MutableArray-fe58ad8683","ember-4.6.0-Ember.NativeArray":"ember-4.6.0-Ember.NativeArray-17f2b9166d","ember-4.6.0-Ember.Comparable":"ember-4.6.0-Ember.Comparable-b6a28bf9bc","ember-4.6.0-ContainerProxyMixin":"ember-4.6.0-ContainerProxyMixin-5cf527cb09","ember-4.6.0-Enumerable":"ember-4.6.0-Enumerable-c0d90f1447","ember-4.6.0-Evented":"ember-4.6.0-Evented-3cb7cf4c29","ember-4.6.0-Ember.MutableEnumerable":"ember-4.6.0-Ember.MutableEnumerable-5faf51a47b","ember-4.6.0-Observable":"ember-4.6.0-Observable-60150c1c34","ember-4.6.0-PromiseProxyMixin":"ember-4.6.0-PromiseProxyMixin-1cde4653aa","ember-4.6.0-RegistryProxyMixin":"ember-4.6.0-RegistryProxyMixin-bd359bd485","ember-4.6.0-Ember.TargetActionSupport":"ember-4.6.0-Ember.TargetActionSupport-d90c7962c2","ember-4.6.0-ArrayProxy":"ember-4.6.0-ArrayProxy-ad82148e31","ember-4.6.0-CoreObject":"ember-4.6.0-CoreObject-7f11faf39e","ember-4.6.0-Namespace":"ember-4.6.0-Namespace-0a876da147","ember-4.6.0-EmberObject":"ember-4.6.0-EmberObject-90471243c2","ember-4.6.0-ObjectProxy":"ember-4.6.0-ObjectProxy-61a5f2d202","ember-4.6.0-Ember.ActionSupport":"ember-4.6.0-Ember.ActionSupport-640cbd5d84","ember-4.6.0-Ember.ClassNamesSupport":"ember-4.6.0-Ember.ClassNamesSupport-0322a69192","ember-4.6.0-Ember.ViewMixin":"ember-4.6.0-Ember.ViewMixin-a22bbf8bb2","ember-4.6.0-Ember.EventDispatcher":"ember-4.6.0-Ember.EventDispatcher-0f28bd048f","ember-4.6.0-Ember.CoreView":"ember-4.6.0-Ember.CoreView-79971ca73f","ember-4.6.0-Application":"ember-4.6.0-Application-29417ee76e","ember-4.6.0-ApplicationInstance":"ember-4.6.0-ApplicationInstance-e2fd101085","ember-4.6.0-ApplicationInstance.BootOptions":"ember-4.6.0-ApplicationInstance.BootOptions-4c9124c9cc","ember-4.6.0-Controller":"ember-4.6.0-Controller-4962ce1d15","ember-4.6.0-Engine":"ember-4.6.0-Engine-9d262fd6b8","ember-4.6.0-EngineInstance":"ember-4.6.0-EngineInstance-e0f167a8db","ember-4.6.0-Ember.Error":"ember-4.6.0-Ember.Error-4597d0a24b","ember-4.6.0-Renderer":"ember-4.6.0-Renderer-2b27ca237c","ember-4.6.0-Service":"ember-4.6.0-Service-5824f3cac9","ember-4.6.0-String":"ember-4.6.0-String-9cb497fc22","ember-4.6.0-TestAdapter":"ember-4.6.0-TestAdapter-0c5018dfbf","ember-4.6.0-Ember.Test.QUnitAdapter":"ember-4.6.0-Ember.Test.QUnitAdapter-ba03a582ad","ember-4.6.0-Ember.Test":"ember-4.6.0-Ember.Test-921423839d","ember-4.6.0-Ember":"ember-4.6.0-Ember-83639b627c","ember-4.6.0-Ember.Templates.components":"ember-4.6.0-Ember.Templates.components-b9d30a4e67","ember-4.6.0-rsvp":"ember-4.6.0-rsvp-b3e736c36a","ember-4.6.0-@ember/application":"ember-4.6.0-@ember/application-adcf29ad59","ember-4.6.0-@ember/array":"ember-4.6.0-@ember/array-a55f7d822e","ember-4.6.0-@ember/component":"ember-4.6.0-@ember/component-cec094139d","ember-4.6.0-@ember/component/helper":"ember-4.6.0-@ember/component/helper-9bdfc6b428","ember-4.6.0-@ember/component/template-only":"ember-4.6.0-@ember/component/template-only-13d3759f46","ember-4.6.0-@ember/controller":"ember-4.6.0-@ember/controller-d8b8c7537b","ember-4.6.0-@ember/debug":"ember-4.6.0-@ember/debug-ddc51c6fd5","ember-4.6.0-@ember/destroyable":"ember-4.6.0-@ember/destroyable-e80b59dfa3","ember-4.6.0-@ember/engine":"ember-4.6.0-@ember/engine-fb571619ee","ember-4.6.0-@ember/helper":"ember-4.6.0-@ember/helper-ef0c2be820","ember-4.6.0-@ember/instrumentation":"ember-4.6.0-@ember/instrumentation-07adfb2477","ember-4.6.0-@ember/object":"ember-4.6.0-@ember/object-fdba9255ac","ember-4.6.0-@ember/object/compat":"ember-4.6.0-@ember/object/compat-2053686aea","ember-4.6.0-@ember/object/computed":"ember-4.6.0-@ember/object/computed-16bbecd6bb","ember-4.6.0-@ember/object/evented":"ember-4.6.0-@ember/object/evented-9c0e842a92","ember-4.6.0-@ember/object/events":"ember-4.6.0-@ember/object/events-670d75425b","ember-4.6.0-@ember/object/internals":"ember-4.6.0-@ember/object/internals-ff901748f1","ember-4.6.0-@ember/object/mixin":"ember-4.6.0-@ember/object/mixin-30ba585e70","ember-4.6.0-@ember/object/observers":"ember-4.6.0-@ember/object/observers-99ecc1c07d","ember-4.6.0-@ember/polyfills":"ember-4.6.0-@ember/polyfills-e199d93283","ember-4.6.0-@ember/routing":"ember-4.6.0-@ember/routing-78700c3c0f","ember-4.6.0-@ember/runloop":"ember-4.6.0-@ember/runloop-6c99acc71a","ember-4.6.0-@ember/service":"ember-4.6.0-@ember/service-18ee6d5663","ember-4.6.0-@ember/template":"ember-4.6.0-@ember/template-d099e89759","ember-4.6.0-@ember/test":"ember-4.6.0-@ember/test-f2f6560f02","ember-4.6.0-@ember/utils":"ember-4.6.0-@ember/utils-c8877b601e","ember-4.6.0-@glimmer/tracking":"ember-4.6.0-@glimmer/tracking-59c5ee66c0","ember-4.6.0-@glimmer/tracking/primitives/cache":"ember-4.6.0-@glimmer/tracking/primitives/cache-9a6dbd965b"},"namespace":{"ember-4.6.0-AutoLocation":"ember-4.6.0-AutoLocation-10efd26d10","ember-4.6.0-FEATURES":"ember-4.6.0-FEATURES-b2ebf9841b","ember-4.6.0-Instrumentation":"ember-4.6.0-Instrumentation-caf86426c0"},"module":{"ember-4.6.0-rsvp":"ember-4.6.0-rsvp-1ed6b5d0e1","ember-4.6.0-@ember/debug":"ember-4.6.0-@ember/debug-5bcc61fc66","ember-4.6.0-@ember/component":"ember-4.6.0-@ember/component-0a38d32f9f","ember-4.6.0-@ember/routing":"ember-4.6.0-@ember/routing-9344d9d9c9","ember-4.6.0-ember":"ember-4.6.0-ember-6740923365","ember-4.6.0-@ember/template":"ember-4.6.0-@ember/template-9542107dd8","ember-4.6.0-@glimmer/component":"ember-4.6.0-@glimmer/component-1f8506b268","ember-4.6.0-@glimmer/tracking":"ember-4.6.0-@glimmer/tracking-a1e958a5e3","ember-4.6.0-@glimmer/tracking/primitives/cache":"ember-4.6.0-@glimmer/tracking/primitives/cache-5f0a43c462","ember-4.6.0-@ember/object":"ember-4.6.0-@ember/object-5fc13a5a99","ember-4.6.0-@ember/utils":"ember-4.6.0-@ember/utils-26642bdb02","ember-4.6.0-@ember/application":"ember-4.6.0-@ember/application-d9016188bd","ember-4.6.0-@ember/array":"ember-4.6.0-@ember/array-7165308fa5","ember-4.6.0-@ember/enumerable":"ember-4.6.0-@ember/enumerable-12b519ebf6","ember-4.6.0-@ember/canary-features":"ember-4.6.0-@ember/canary-features-390b925589","ember-4.6.0-@ember/component/template-only":"ember-4.6.0-@ember/component/template-only-93c8dce96e","ember-4.6.0-@ember/controller":"ember-4.6.0-@ember/controller-83d8b35f4a","ember-4.6.0-@ember/destroyable":"ember-4.6.0-@ember/destroyable-9adad90442","ember-4.6.0-@ember/engine":"ember-4.6.0-@ember/engine-a0b441f9d0","ember-4.6.0-@ember/error":"ember-4.6.0-@ember/error-bd79295c2f","ember-4.6.0-@ember/helper":"ember-4.6.0-@ember/helper-b2d8163d52","ember-4.6.0-@ember/instrumentation":"ember-4.6.0-@ember/instrumentation-e66f0fbec7","ember-4.6.0-@ember/polyfills":"ember-4.6.0-@ember/polyfills-c55e9698d4","ember-4.6.0-@ember/renderer":"ember-4.6.0-@ember/renderer-9099164c01","ember-4.6.0-@ember/runloop":"ember-4.6.0-@ember/runloop-335c732f5b","ember-4.6.0-@ember/service":"ember-4.6.0-@ember/service-7bbca87406","ember-4.6.0-@ember/string":"ember-4.6.0-@ember/string-29957c517f","ember-4.6.0-@ember/test":"ember-4.6.0-@ember/test-472d129dff"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Ember.Object":"Ember.Object-9c32970d20","Error":"Error-158974c414"}}} \ No newline at end of file diff --git a/rev-index/ember-4.7.1.json b/rev-index/ember-4.7.1.json index 0bf0c038d..9964689a5 100644 --- a/rev-index/ember-4.7.1.json +++ b/rev-index/ember-4.7.1.json @@ -1 +1 @@ -{"data":{"id":"ember-4.7.1","type":"project-version","attributes":{"version":"4.7.1"},"relationships":{"classes":{"data":[{"id":"ember-4.7.1-Promise","type":"class"},{"id":"ember-4.7.1-EventTarget","type":"class"},{"id":"ember-4.7.1-Container","type":"class"},{"id":"ember-4.7.1-Registry","type":"class"},{"id":"ember-4.7.1-EmberENV","type":"class"},{"id":"ember-4.7.1-ContainerDebugAdapter","type":"class"},{"id":"ember-4.7.1-DataAdapter","type":"class"},{"id":"ember-4.7.1-Ember.Templates.helpers","type":"class"},{"id":"ember-4.7.1-ComponentStateBucket","type":"class"},{"id":"ember-4.7.1-Component","type":"class"},{"id":"ember-4.7.1-Helper","type":"class"},{"id":"ember-4.7.1-ComputedProperty","type":"class"},{"id":"ember-4.7.1-Descriptor","type":"class"},{"id":"ember-4.7.1-Ember.InjectedProperty","type":"class"},{"id":"ember-4.7.1-Libraries","type":"class"},{"id":"ember-4.7.1-Mixin","type":"class"},{"id":"ember-4.7.1-Ember.ControllerMixin","type":"class"},{"id":"ember-4.7.1-Location","type":"class"},{"id":"ember-4.7.1-HashLocation","type":"class"},{"id":"ember-4.7.1-HistoryLocation","type":"class"},{"id":"ember-4.7.1-NoneLocation","type":"class"},{"id":"ember-4.7.1-RouterService","type":"class"},{"id":"ember-4.7.1-RoutingService","type":"class"},{"id":"ember-4.7.1-BucketCache","type":"class"},{"id":"ember-4.7.1-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.7.1-RouteInfo","type":"class"},{"id":"ember-4.7.1-Route","type":"class"},{"id":"ember-4.7.1-EmberRouter","type":"class"},{"id":"ember-4.7.1-Transition","type":"class"},{"id":"ember-4.7.1-Ember.ProxyMixin","type":"class"},{"id":"ember-4.7.1-Ember.ActionHandler","type":"class"},{"id":"ember-4.7.1-EmberArray","type":"class"},{"id":"ember-4.7.1-MutableArray","type":"class"},{"id":"ember-4.7.1-Ember.NativeArray","type":"class"},{"id":"ember-4.7.1-Ember.Comparable","type":"class"},{"id":"ember-4.7.1-ContainerProxyMixin","type":"class"},{"id":"ember-4.7.1-Enumerable","type":"class"},{"id":"ember-4.7.1-Evented","type":"class"},{"id":"ember-4.7.1-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.7.1-Observable","type":"class"},{"id":"ember-4.7.1-PromiseProxyMixin","type":"class"},{"id":"ember-4.7.1-RegistryProxyMixin","type":"class"},{"id":"ember-4.7.1-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.7.1-ArrayProxy","type":"class"},{"id":"ember-4.7.1-CoreObject","type":"class"},{"id":"ember-4.7.1-Namespace","type":"class"},{"id":"ember-4.7.1-EmberObject","type":"class"},{"id":"ember-4.7.1-ObjectProxy","type":"class"},{"id":"ember-4.7.1-Ember.ActionSupport","type":"class"},{"id":"ember-4.7.1-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.7.1-Ember.ViewMixin","type":"class"},{"id":"ember-4.7.1-Ember.EventDispatcher","type":"class"},{"id":"ember-4.7.1-Ember.CoreView","type":"class"},{"id":"ember-4.7.1-Application","type":"class"},{"id":"ember-4.7.1-ApplicationInstance","type":"class"},{"id":"ember-4.7.1-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.7.1-Controller","type":"class"},{"id":"ember-4.7.1-Engine","type":"class"},{"id":"ember-4.7.1-EngineInstance","type":"class"},{"id":"ember-4.7.1-Ember.Error","type":"class"},{"id":"ember-4.7.1-Renderer","type":"class"},{"id":"ember-4.7.1-Service","type":"class"},{"id":"ember-4.7.1-String","type":"class"},{"id":"ember-4.7.1-TestAdapter","type":"class"},{"id":"ember-4.7.1-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.7.1-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.7.1-AutoLocation","type":"namespace"},{"id":"ember-4.7.1-FEATURES","type":"namespace"},{"id":"ember-4.7.1-Instrumentation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.7.1-rsvp","type":"module"},{"id":"ember-4.7.1-@ember/debug","type":"module"},{"id":"ember-4.7.1-@ember/component","type":"module"},{"id":"ember-4.7.1-@ember/routing","type":"module"},{"id":"ember-4.7.1-ember","type":"module"},{"id":"ember-4.7.1-@ember/template","type":"module"},{"id":"ember-4.7.1-@glimmer/component","type":"module"},{"id":"ember-4.7.1-@glimmer/tracking","type":"module"},{"id":"ember-4.7.1-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.7.1-@ember/object","type":"module"},{"id":"ember-4.7.1-@ember/utils","type":"module"},{"id":"ember-4.7.1-@ember/application","type":"module"},{"id":"ember-4.7.1-@ember/array","type":"module"},{"id":"ember-4.7.1-@ember/enumerable","type":"module"},{"id":"ember-4.7.1-@ember/canary-features","type":"module"},{"id":"ember-4.7.1-@ember/component/template-only","type":"module"},{"id":"ember-4.7.1-@ember/controller","type":"module"},{"id":"ember-4.7.1-@ember/destroyable","type":"module"},{"id":"ember-4.7.1-@ember/engine","type":"module"},{"id":"ember-4.7.1-@ember/error","type":"module"},{"id":"ember-4.7.1-@ember/helper","type":"module"},{"id":"ember-4.7.1-@ember/instrumentation","type":"module"},{"id":"ember-4.7.1-@ember/polyfills","type":"module"},{"id":"ember-4.7.1-@ember/renderer","type":"module"},{"id":"ember-4.7.1-@ember/runloop","type":"module"},{"id":"ember-4.7.1-@ember/service","type":"module"},{"id":"ember-4.7.1-@ember/string","type":"module"},{"id":"ember-4.7.1-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.7.1-Container","type":"class"},{"id":"ember-4.7.1-Registry","type":"class"},{"id":"ember-4.7.1-ComponentStateBucket","type":"class"},{"id":"ember-4.7.1-Descriptor","type":"class"},{"id":"ember-4.7.1-Ember.InjectedProperty","type":"class"},{"id":"ember-4.7.1-Libraries","type":"class"},{"id":"ember-4.7.1-Ember.ControllerMixin","type":"class"},{"id":"ember-4.7.1-Location","type":"class"},{"id":"ember-4.7.1-RoutingService","type":"class"},{"id":"ember-4.7.1-BucketCache","type":"class"},{"id":"ember-4.7.1-Ember.ProxyMixin","type":"class"},{"id":"ember-4.7.1-Ember.ActionHandler","type":"class"},{"id":"ember-4.7.1-Ember.Comparable","type":"class"},{"id":"ember-4.7.1-ContainerProxyMixin","type":"class"},{"id":"ember-4.7.1-Enumerable","type":"class"},{"id":"ember-4.7.1-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.7.1-RegistryProxyMixin","type":"class"},{"id":"ember-4.7.1-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.7.1-Ember.ActionSupport","type":"class"},{"id":"ember-4.7.1-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.7.1-Ember.ViewMixin","type":"class"},{"id":"ember-4.7.1-Ember.EventDispatcher","type":"class"},{"id":"ember-4.7.1-Ember.CoreView","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.7.1-Promise","type":"class"},{"id":"ember-4.7.1-EventTarget","type":"class"},{"id":"ember-4.7.1-EmberENV","type":"class"},{"id":"ember-4.7.1-ContainerDebugAdapter","type":"class"},{"id":"ember-4.7.1-DataAdapter","type":"class"},{"id":"ember-4.7.1-Ember.Templates.helpers","type":"class"},{"id":"ember-4.7.1-Component","type":"class"},{"id":"ember-4.7.1-Helper","type":"class"},{"id":"ember-4.7.1-ComputedProperty","type":"class"},{"id":"ember-4.7.1-Mixin","type":"class"},{"id":"ember-4.7.1-HashLocation","type":"class"},{"id":"ember-4.7.1-HistoryLocation","type":"class"},{"id":"ember-4.7.1-NoneLocation","type":"class"},{"id":"ember-4.7.1-RouterService","type":"class"},{"id":"ember-4.7.1-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.7.1-RouteInfo","type":"class"},{"id":"ember-4.7.1-Route","type":"class"},{"id":"ember-4.7.1-EmberRouter","type":"class"},{"id":"ember-4.7.1-Transition","type":"class"},{"id":"ember-4.7.1-EmberArray","type":"class"},{"id":"ember-4.7.1-MutableArray","type":"class"},{"id":"ember-4.7.1-Ember.NativeArray","type":"class"},{"id":"ember-4.7.1-Evented","type":"class"},{"id":"ember-4.7.1-Observable","type":"class"},{"id":"ember-4.7.1-PromiseProxyMixin","type":"class"},{"id":"ember-4.7.1-ArrayProxy","type":"class"},{"id":"ember-4.7.1-CoreObject","type":"class"},{"id":"ember-4.7.1-Namespace","type":"class"},{"id":"ember-4.7.1-EmberObject","type":"class"},{"id":"ember-4.7.1-ObjectProxy","type":"class"},{"id":"ember-4.7.1-Application","type":"class"},{"id":"ember-4.7.1-ApplicationInstance","type":"class"},{"id":"ember-4.7.1-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.7.1-Controller","type":"class"},{"id":"ember-4.7.1-Engine","type":"class"},{"id":"ember-4.7.1-EngineInstance","type":"class"},{"id":"ember-4.7.1-Ember.Error","type":"class"},{"id":"ember-4.7.1-Renderer","type":"class"},{"id":"ember-4.7.1-Service","type":"class"},{"id":"ember-4.7.1-String","type":"class"},{"id":"ember-4.7.1-TestAdapter","type":"class"},{"id":"ember-4.7.1-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.7.1-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.7.1-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.7.1-AutoLocation","type":"namespace"},{"id":"ember-4.7.1-FEATURES","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.7.1-ember","type":"module"},{"id":"ember-4.7.1-@ember/enumerable","type":"module"},{"id":"ember-4.7.1-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.7.1-rsvp","type":"module"},{"id":"ember-4.7.1-@ember/debug","type":"module"},{"id":"ember-4.7.1-@ember/component","type":"module"},{"id":"ember-4.7.1-@ember/routing","type":"module"},{"id":"ember-4.7.1-@ember/template","type":"module"},{"id":"ember-4.7.1-@glimmer/component","type":"module"},{"id":"ember-4.7.1-@glimmer/tracking","type":"module"},{"id":"ember-4.7.1-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.7.1-@ember/object","type":"module"},{"id":"ember-4.7.1-@ember/utils","type":"module"},{"id":"ember-4.7.1-@ember/application","type":"module"},{"id":"ember-4.7.1-@ember/array","type":"module"},{"id":"ember-4.7.1-@ember/canary-features","type":"module"},{"id":"ember-4.7.1-@ember/component/template-only","type":"module"},{"id":"ember-4.7.1-@ember/controller","type":"module"},{"id":"ember-4.7.1-@ember/destroyable","type":"module"},{"id":"ember-4.7.1-@ember/engine","type":"module"},{"id":"ember-4.7.1-@ember/error","type":"module"},{"id":"ember-4.7.1-@ember/helper","type":"module"},{"id":"ember-4.7.1-@ember/polyfills","type":"module"},{"id":"ember-4.7.1-@ember/renderer","type":"module"},{"id":"ember-4.7.1-@ember/runloop","type":"module"},{"id":"ember-4.7.1-@ember/service","type":"module"},{"id":"ember-4.7.1-@ember/string","type":"module"},{"id":"ember-4.7.1-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.7.1-Promise":"ember-4.7.1-Promise-a5b2a863a0","ember-4.7.1-EventTarget":"ember-4.7.1-EventTarget-cf7cfcb037","ember-4.7.1-Container":"ember-4.7.1-Container-9f6387d994","ember-4.7.1-Registry":"ember-4.7.1-Registry-5c5f6cf8d9","ember-4.7.1-EmberENV":"ember-4.7.1-EmberENV-beb9413d42","ember-4.7.1-ContainerDebugAdapter":"ember-4.7.1-ContainerDebugAdapter-1442896d16","ember-4.7.1-DataAdapter":"ember-4.7.1-DataAdapter-6f6922e509","ember-4.7.1-Ember.Templates.helpers":"ember-4.7.1-Ember.Templates.helpers-ccc12d1ab1","ember-4.7.1-ComponentStateBucket":"ember-4.7.1-ComponentStateBucket-53cb530e0b","ember-4.7.1-Component":"ember-4.7.1-Component-6d239aef82","ember-4.7.1-Helper":"ember-4.7.1-Helper-0dbcd70e3d","ember-4.7.1-ComputedProperty":"ember-4.7.1-ComputedProperty-e1a65c7881","ember-4.7.1-Descriptor":"ember-4.7.1-Descriptor-39bd581a01","ember-4.7.1-Ember.InjectedProperty":"ember-4.7.1-Ember.InjectedProperty-5a9b4c4443","ember-4.7.1-Libraries":"ember-4.7.1-Libraries-398d09fc1b","ember-4.7.1-Mixin":"ember-4.7.1-Mixin-0b1c7e5443","ember-4.7.1-Ember.ControllerMixin":"ember-4.7.1-Ember.ControllerMixin-50ae401197","ember-4.7.1-Location":"ember-4.7.1-Location-240900a766","ember-4.7.1-HashLocation":"ember-4.7.1-HashLocation-1a1e80abcb","ember-4.7.1-HistoryLocation":"ember-4.7.1-HistoryLocation-42c5b21be9","ember-4.7.1-NoneLocation":"ember-4.7.1-NoneLocation-e440b530e7","ember-4.7.1-RouterService":"ember-4.7.1-RouterService-6937f88e12","ember-4.7.1-RoutingService":"ember-4.7.1-RoutingService-49d7d403ad","ember-4.7.1-BucketCache":"ember-4.7.1-BucketCache-10a267cb89","ember-4.7.1-RouteInfoWithAttributes":"ember-4.7.1-RouteInfoWithAttributes-8d434249ee","ember-4.7.1-RouteInfo":"ember-4.7.1-RouteInfo-8b655cf63d","ember-4.7.1-Route":"ember-4.7.1-Route-ace5ee1635","ember-4.7.1-EmberRouter":"ember-4.7.1-EmberRouter-e2eddad8b6","ember-4.7.1-Transition":"ember-4.7.1-Transition-5bbb8d3ca5","ember-4.7.1-Ember.ProxyMixin":"ember-4.7.1-Ember.ProxyMixin-827be409e1","ember-4.7.1-Ember.ActionHandler":"ember-4.7.1-Ember.ActionHandler-b399ec4b79","ember-4.7.1-EmberArray":"ember-4.7.1-EmberArray-ee37341056","ember-4.7.1-MutableArray":"ember-4.7.1-MutableArray-c43ad5f3b3","ember-4.7.1-Ember.NativeArray":"ember-4.7.1-Ember.NativeArray-4c10ea623e","ember-4.7.1-Ember.Comparable":"ember-4.7.1-Ember.Comparable-dcb86297db","ember-4.7.1-ContainerProxyMixin":"ember-4.7.1-ContainerProxyMixin-eaaffbf20f","ember-4.7.1-Enumerable":"ember-4.7.1-Enumerable-52c795a2da","ember-4.7.1-Evented":"ember-4.7.1-Evented-465b1d33e7","ember-4.7.1-Ember.MutableEnumerable":"ember-4.7.1-Ember.MutableEnumerable-8d59789932","ember-4.7.1-Observable":"ember-4.7.1-Observable-db82f15fef","ember-4.7.1-PromiseProxyMixin":"ember-4.7.1-PromiseProxyMixin-6a48fed137","ember-4.7.1-RegistryProxyMixin":"ember-4.7.1-RegistryProxyMixin-935d70b690","ember-4.7.1-Ember.TargetActionSupport":"ember-4.7.1-Ember.TargetActionSupport-2603118659","ember-4.7.1-ArrayProxy":"ember-4.7.1-ArrayProxy-96b64cb708","ember-4.7.1-CoreObject":"ember-4.7.1-CoreObject-917409e9f3","ember-4.7.1-Namespace":"ember-4.7.1-Namespace-71a365887f","ember-4.7.1-EmberObject":"ember-4.7.1-EmberObject-19b95f7a5c","ember-4.7.1-ObjectProxy":"ember-4.7.1-ObjectProxy-b9af49af13","ember-4.7.1-Ember.ActionSupport":"ember-4.7.1-Ember.ActionSupport-8421890e2c","ember-4.7.1-Ember.ClassNamesSupport":"ember-4.7.1-Ember.ClassNamesSupport-ac704e9c8e","ember-4.7.1-Ember.ViewMixin":"ember-4.7.1-Ember.ViewMixin-629d5403c2","ember-4.7.1-Ember.EventDispatcher":"ember-4.7.1-Ember.EventDispatcher-bba59a5fe3","ember-4.7.1-Ember.CoreView":"ember-4.7.1-Ember.CoreView-81afac9991","ember-4.7.1-Application":"ember-4.7.1-Application-b87ebc7454","ember-4.7.1-ApplicationInstance":"ember-4.7.1-ApplicationInstance-2f08f71070","ember-4.7.1-ApplicationInstance.BootOptions":"ember-4.7.1-ApplicationInstance.BootOptions-24c95607b3","ember-4.7.1-Controller":"ember-4.7.1-Controller-0e6a0a189d","ember-4.7.1-Engine":"ember-4.7.1-Engine-42946f8456","ember-4.7.1-EngineInstance":"ember-4.7.1-EngineInstance-bfbb5b978a","ember-4.7.1-Ember.Error":"ember-4.7.1-Ember.Error-79e87e505a","ember-4.7.1-Renderer":"ember-4.7.1-Renderer-9ba9a91f8d","ember-4.7.1-Service":"ember-4.7.1-Service-df585a612a","ember-4.7.1-String":"ember-4.7.1-String-d556591711","ember-4.7.1-TestAdapter":"ember-4.7.1-TestAdapter-31e2c646fb","ember-4.7.1-Ember.Test.QUnitAdapter":"ember-4.7.1-Ember.Test.QUnitAdapter-48e1d6d3f3","ember-4.7.1-Ember.Test":"ember-4.7.1-Ember.Test-f04ffd28b3","ember-4.7.1-Ember":"ember-4.7.1-Ember-72927bf006","ember-4.7.1-Ember.Templates.components":"ember-4.7.1-Ember.Templates.components-5ad1e998b1","ember-4.7.1-rsvp":"ember-4.7.1-rsvp-c93ccc8af0","ember-4.7.1-@ember/application":"ember-4.7.1-@ember/application-f3476f7063","ember-4.7.1-@ember/array":"ember-4.7.1-@ember/array-d5dd7471b6","ember-4.7.1-@ember/component":"ember-4.7.1-@ember/component-4751bdb445","ember-4.7.1-@ember/component/helper":"ember-4.7.1-@ember/component/helper-87df470341","ember-4.7.1-@ember/component/template-only":"ember-4.7.1-@ember/component/template-only-2407a6110e","ember-4.7.1-@ember/controller":"ember-4.7.1-@ember/controller-21c3a55494","ember-4.7.1-@ember/debug":"ember-4.7.1-@ember/debug-f8a9c9313c","ember-4.7.1-@ember/destroyable":"ember-4.7.1-@ember/destroyable-246b095dfe","ember-4.7.1-@ember/engine":"ember-4.7.1-@ember/engine-906595b922","ember-4.7.1-@ember/helper":"ember-4.7.1-@ember/helper-19c70a28a6","ember-4.7.1-@ember/instrumentation":"ember-4.7.1-@ember/instrumentation-4541feae9f","ember-4.7.1-@ember/object":"ember-4.7.1-@ember/object-ecaaa60e4c","ember-4.7.1-@ember/object/compat":"ember-4.7.1-@ember/object/compat-8ea452758a","ember-4.7.1-@ember/object/computed":"ember-4.7.1-@ember/object/computed-50c1cb9d1e","ember-4.7.1-@ember/object/evented":"ember-4.7.1-@ember/object/evented-a4c3bc9096","ember-4.7.1-@ember/object/events":"ember-4.7.1-@ember/object/events-2373b0669c","ember-4.7.1-@ember/object/internals":"ember-4.7.1-@ember/object/internals-a2025b83b7","ember-4.7.1-@ember/object/mixin":"ember-4.7.1-@ember/object/mixin-8b54f9bf19","ember-4.7.1-@ember/object/observers":"ember-4.7.1-@ember/object/observers-7a2fd05cc1","ember-4.7.1-@ember/polyfills":"ember-4.7.1-@ember/polyfills-565cac5b88","ember-4.7.1-@ember/routing":"ember-4.7.1-@ember/routing-4dddf01d74","ember-4.7.1-@ember/runloop":"ember-4.7.1-@ember/runloop-8db8db9732","ember-4.7.1-@ember/service":"ember-4.7.1-@ember/service-5473bb4efc","ember-4.7.1-@ember/template":"ember-4.7.1-@ember/template-f964f765c4","ember-4.7.1-@ember/test":"ember-4.7.1-@ember/test-4cb8d35568","ember-4.7.1-@ember/utils":"ember-4.7.1-@ember/utils-f94c6493c9","ember-4.7.1-@glimmer/tracking":"ember-4.7.1-@glimmer/tracking-058841bc03","ember-4.7.1-@glimmer/tracking/primitives/cache":"ember-4.7.1-@glimmer/tracking/primitives/cache-d68c66234e"},"namespace":{"ember-4.7.1-AutoLocation":"ember-4.7.1-AutoLocation-e2d1855350","ember-4.7.1-FEATURES":"ember-4.7.1-FEATURES-0ade06e8a6","ember-4.7.1-Instrumentation":"ember-4.7.1-Instrumentation-6ed1356836"},"module":{"ember-4.7.1-rsvp":"ember-4.7.1-rsvp-ee2039c586","ember-4.7.1-@ember/debug":"ember-4.7.1-@ember/debug-9cb32c8496","ember-4.7.1-@ember/component":"ember-4.7.1-@ember/component-d6bc0b4c89","ember-4.7.1-@ember/routing":"ember-4.7.1-@ember/routing-99cce95724","ember-4.7.1-ember":"ember-4.7.1-ember-8dc9fceba5","ember-4.7.1-@ember/template":"ember-4.7.1-@ember/template-47bda07125","ember-4.7.1-@glimmer/component":"ember-4.7.1-@glimmer/component-08c95a3bef","ember-4.7.1-@glimmer/tracking":"ember-4.7.1-@glimmer/tracking-ced6a19368","ember-4.7.1-@glimmer/tracking/primitives/cache":"ember-4.7.1-@glimmer/tracking/primitives/cache-f32ff16a53","ember-4.7.1-@ember/object":"ember-4.7.1-@ember/object-ffecfb317e","ember-4.7.1-@ember/utils":"ember-4.7.1-@ember/utils-4c98cff229","ember-4.7.1-@ember/application":"ember-4.7.1-@ember/application-7559b0aa2d","ember-4.7.1-@ember/array":"ember-4.7.1-@ember/array-fbe13e1b77","ember-4.7.1-@ember/enumerable":"ember-4.7.1-@ember/enumerable-e7d2966430","ember-4.7.1-@ember/canary-features":"ember-4.7.1-@ember/canary-features-da33056f9f","ember-4.7.1-@ember/component/template-only":"ember-4.7.1-@ember/component/template-only-4355a241ba","ember-4.7.1-@ember/controller":"ember-4.7.1-@ember/controller-ae7108a92c","ember-4.7.1-@ember/destroyable":"ember-4.7.1-@ember/destroyable-43b602f929","ember-4.7.1-@ember/engine":"ember-4.7.1-@ember/engine-abb0b1b8f7","ember-4.7.1-@ember/error":"ember-4.7.1-@ember/error-8c65011031","ember-4.7.1-@ember/helper":"ember-4.7.1-@ember/helper-1ee24e0c85","ember-4.7.1-@ember/instrumentation":"ember-4.7.1-@ember/instrumentation-532cf00570","ember-4.7.1-@ember/polyfills":"ember-4.7.1-@ember/polyfills-79d5043232","ember-4.7.1-@ember/renderer":"ember-4.7.1-@ember/renderer-c355523b49","ember-4.7.1-@ember/runloop":"ember-4.7.1-@ember/runloop-75d3cdb6c8","ember-4.7.1-@ember/service":"ember-4.7.1-@ember/service-ccea8ea57b","ember-4.7.1-@ember/string":"ember-4.7.1-@ember/string-9f25cfc8fe","ember-4.7.1-@ember/test":"ember-4.7.1-@ember/test-7f29139b25"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Ember.Object":"Ember.Object-9c32970d20","Error":"Error-158974c414"}}} \ No newline at end of file +{"data":{"id":"ember-4.7.1","type":"project-version","attributes":{"version":"4.7.1"},"relationships":{"classes":{"data":[{"id":"ember-4.7.1-Promise","type":"class"},{"id":"ember-4.7.1-EventTarget","type":"class"},{"id":"ember-4.7.1-Container","type":"class"},{"id":"ember-4.7.1-Registry","type":"class"},{"id":"ember-4.7.1-EmberENV","type":"class"},{"id":"ember-4.7.1-ContainerDebugAdapter","type":"class"},{"id":"ember-4.7.1-DataAdapter","type":"class"},{"id":"ember-4.7.1-Ember.Templates.helpers","type":"class"},{"id":"ember-4.7.1-ComponentStateBucket","type":"class"},{"id":"ember-4.7.1-Component","type":"class"},{"id":"ember-4.7.1-Helper","type":"class"},{"id":"ember-4.7.1-ComputedProperty","type":"class"},{"id":"ember-4.7.1-Descriptor","type":"class"},{"id":"ember-4.7.1-Ember.InjectedProperty","type":"class"},{"id":"ember-4.7.1-Libraries","type":"class"},{"id":"ember-4.7.1-Mixin","type":"class"},{"id":"ember-4.7.1-Ember.ControllerMixin","type":"class"},{"id":"ember-4.7.1-Location","type":"class"},{"id":"ember-4.7.1-HashLocation","type":"class"},{"id":"ember-4.7.1-HistoryLocation","type":"class"},{"id":"ember-4.7.1-NoneLocation","type":"class"},{"id":"ember-4.7.1-RouterService","type":"class"},{"id":"ember-4.7.1-RoutingService","type":"class"},{"id":"ember-4.7.1-BucketCache","type":"class"},{"id":"ember-4.7.1-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.7.1-RouteInfo","type":"class"},{"id":"ember-4.7.1-Route","type":"class"},{"id":"ember-4.7.1-EmberRouter","type":"class"},{"id":"ember-4.7.1-Transition","type":"class"},{"id":"ember-4.7.1-Ember.ProxyMixin","type":"class"},{"id":"ember-4.7.1-Ember.ActionHandler","type":"class"},{"id":"ember-4.7.1-EmberArray","type":"class"},{"id":"ember-4.7.1-MutableArray","type":"class"},{"id":"ember-4.7.1-Ember.NativeArray","type":"class"},{"id":"ember-4.7.1-Ember.Comparable","type":"class"},{"id":"ember-4.7.1-ContainerProxyMixin","type":"class"},{"id":"ember-4.7.1-Enumerable","type":"class"},{"id":"ember-4.7.1-Evented","type":"class"},{"id":"ember-4.7.1-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.7.1-Observable","type":"class"},{"id":"ember-4.7.1-PromiseProxyMixin","type":"class"},{"id":"ember-4.7.1-RegistryProxyMixin","type":"class"},{"id":"ember-4.7.1-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.7.1-ArrayProxy","type":"class"},{"id":"ember-4.7.1-CoreObject","type":"class"},{"id":"ember-4.7.1-Namespace","type":"class"},{"id":"ember-4.7.1-EmberObject","type":"class"},{"id":"ember-4.7.1-ObjectProxy","type":"class"},{"id":"ember-4.7.1-Ember.ActionSupport","type":"class"},{"id":"ember-4.7.1-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.7.1-Ember.ViewMixin","type":"class"},{"id":"ember-4.7.1-Ember.EventDispatcher","type":"class"},{"id":"ember-4.7.1-Ember.CoreView","type":"class"},{"id":"ember-4.7.1-Application","type":"class"},{"id":"ember-4.7.1-ApplicationInstance","type":"class"},{"id":"ember-4.7.1-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.7.1-Controller","type":"class"},{"id":"ember-4.7.1-Engine","type":"class"},{"id":"ember-4.7.1-EngineInstance","type":"class"},{"id":"ember-4.7.1-Ember.Error","type":"class"},{"id":"ember-4.7.1-Renderer","type":"class"},{"id":"ember-4.7.1-Service","type":"class"},{"id":"ember-4.7.1-String","type":"class"},{"id":"ember-4.7.1-TestAdapter","type":"class"},{"id":"ember-4.7.1-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.7.1-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.7.1-AutoLocation","type":"namespace"},{"id":"ember-4.7.1-FEATURES","type":"namespace"},{"id":"ember-4.7.1-Instrumentation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.7.1-rsvp","type":"module"},{"id":"ember-4.7.1-@ember/debug","type":"module"},{"id":"ember-4.7.1-@ember/component","type":"module"},{"id":"ember-4.7.1-@ember/routing","type":"module"},{"id":"ember-4.7.1-ember","type":"module"},{"id":"ember-4.7.1-@ember/template","type":"module"},{"id":"ember-4.7.1-@glimmer/component","type":"module"},{"id":"ember-4.7.1-@glimmer/tracking","type":"module"},{"id":"ember-4.7.1-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.7.1-@ember/object","type":"module"},{"id":"ember-4.7.1-@ember/utils","type":"module"},{"id":"ember-4.7.1-@ember/application","type":"module"},{"id":"ember-4.7.1-@ember/array","type":"module"},{"id":"ember-4.7.1-@ember/enumerable","type":"module"},{"id":"ember-4.7.1-@ember/canary-features","type":"module"},{"id":"ember-4.7.1-@ember/component/template-only","type":"module"},{"id":"ember-4.7.1-@ember/controller","type":"module"},{"id":"ember-4.7.1-@ember/destroyable","type":"module"},{"id":"ember-4.7.1-@ember/engine","type":"module"},{"id":"ember-4.7.1-@ember/error","type":"module"},{"id":"ember-4.7.1-@ember/helper","type":"module"},{"id":"ember-4.7.1-@ember/instrumentation","type":"module"},{"id":"ember-4.7.1-@ember/polyfills","type":"module"},{"id":"ember-4.7.1-@ember/renderer","type":"module"},{"id":"ember-4.7.1-@ember/runloop","type":"module"},{"id":"ember-4.7.1-@ember/service","type":"module"},{"id":"ember-4.7.1-@ember/string","type":"module"},{"id":"ember-4.7.1-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.7.1-Container","type":"class"},{"id":"ember-4.7.1-Registry","type":"class"},{"id":"ember-4.7.1-ComponentStateBucket","type":"class"},{"id":"ember-4.7.1-Descriptor","type":"class"},{"id":"ember-4.7.1-Ember.InjectedProperty","type":"class"},{"id":"ember-4.7.1-Libraries","type":"class"},{"id":"ember-4.7.1-Ember.ControllerMixin","type":"class"},{"id":"ember-4.7.1-Location","type":"class"},{"id":"ember-4.7.1-RoutingService","type":"class"},{"id":"ember-4.7.1-BucketCache","type":"class"},{"id":"ember-4.7.1-Ember.ProxyMixin","type":"class"},{"id":"ember-4.7.1-Ember.ActionHandler","type":"class"},{"id":"ember-4.7.1-Ember.Comparable","type":"class"},{"id":"ember-4.7.1-ContainerProxyMixin","type":"class"},{"id":"ember-4.7.1-Enumerable","type":"class"},{"id":"ember-4.7.1-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.7.1-RegistryProxyMixin","type":"class"},{"id":"ember-4.7.1-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.7.1-Ember.ActionSupport","type":"class"},{"id":"ember-4.7.1-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.7.1-Ember.ViewMixin","type":"class"},{"id":"ember-4.7.1-Ember.EventDispatcher","type":"class"},{"id":"ember-4.7.1-Ember.CoreView","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.7.1-Promise","type":"class"},{"id":"ember-4.7.1-EventTarget","type":"class"},{"id":"ember-4.7.1-EmberENV","type":"class"},{"id":"ember-4.7.1-ContainerDebugAdapter","type":"class"},{"id":"ember-4.7.1-DataAdapter","type":"class"},{"id":"ember-4.7.1-Ember.Templates.helpers","type":"class"},{"id":"ember-4.7.1-Component","type":"class"},{"id":"ember-4.7.1-Helper","type":"class"},{"id":"ember-4.7.1-ComputedProperty","type":"class"},{"id":"ember-4.7.1-Mixin","type":"class"},{"id":"ember-4.7.1-HashLocation","type":"class"},{"id":"ember-4.7.1-HistoryLocation","type":"class"},{"id":"ember-4.7.1-NoneLocation","type":"class"},{"id":"ember-4.7.1-RouterService","type":"class"},{"id":"ember-4.7.1-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.7.1-RouteInfo","type":"class"},{"id":"ember-4.7.1-Route","type":"class"},{"id":"ember-4.7.1-EmberRouter","type":"class"},{"id":"ember-4.7.1-Transition","type":"class"},{"id":"ember-4.7.1-EmberArray","type":"class"},{"id":"ember-4.7.1-MutableArray","type":"class"},{"id":"ember-4.7.1-Ember.NativeArray","type":"class"},{"id":"ember-4.7.1-Evented","type":"class"},{"id":"ember-4.7.1-Observable","type":"class"},{"id":"ember-4.7.1-PromiseProxyMixin","type":"class"},{"id":"ember-4.7.1-ArrayProxy","type":"class"},{"id":"ember-4.7.1-CoreObject","type":"class"},{"id":"ember-4.7.1-Namespace","type":"class"},{"id":"ember-4.7.1-EmberObject","type":"class"},{"id":"ember-4.7.1-ObjectProxy","type":"class"},{"id":"ember-4.7.1-Application","type":"class"},{"id":"ember-4.7.1-ApplicationInstance","type":"class"},{"id":"ember-4.7.1-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.7.1-Controller","type":"class"},{"id":"ember-4.7.1-Engine","type":"class"},{"id":"ember-4.7.1-EngineInstance","type":"class"},{"id":"ember-4.7.1-Ember.Error","type":"class"},{"id":"ember-4.7.1-Renderer","type":"class"},{"id":"ember-4.7.1-Service","type":"class"},{"id":"ember-4.7.1-String","type":"class"},{"id":"ember-4.7.1-TestAdapter","type":"class"},{"id":"ember-4.7.1-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.7.1-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.7.1-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.7.1-AutoLocation","type":"namespace"},{"id":"ember-4.7.1-FEATURES","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.7.1-ember","type":"module"},{"id":"ember-4.7.1-@ember/enumerable","type":"module"},{"id":"ember-4.7.1-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.7.1-rsvp","type":"module"},{"id":"ember-4.7.1-@ember/debug","type":"module"},{"id":"ember-4.7.1-@ember/component","type":"module"},{"id":"ember-4.7.1-@ember/routing","type":"module"},{"id":"ember-4.7.1-@ember/template","type":"module"},{"id":"ember-4.7.1-@glimmer/component","type":"module"},{"id":"ember-4.7.1-@glimmer/tracking","type":"module"},{"id":"ember-4.7.1-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.7.1-@ember/object","type":"module"},{"id":"ember-4.7.1-@ember/utils","type":"module"},{"id":"ember-4.7.1-@ember/application","type":"module"},{"id":"ember-4.7.1-@ember/array","type":"module"},{"id":"ember-4.7.1-@ember/canary-features","type":"module"},{"id":"ember-4.7.1-@ember/component/template-only","type":"module"},{"id":"ember-4.7.1-@ember/controller","type":"module"},{"id":"ember-4.7.1-@ember/destroyable","type":"module"},{"id":"ember-4.7.1-@ember/engine","type":"module"},{"id":"ember-4.7.1-@ember/error","type":"module"},{"id":"ember-4.7.1-@ember/helper","type":"module"},{"id":"ember-4.7.1-@ember/polyfills","type":"module"},{"id":"ember-4.7.1-@ember/renderer","type":"module"},{"id":"ember-4.7.1-@ember/runloop","type":"module"},{"id":"ember-4.7.1-@ember/service","type":"module"},{"id":"ember-4.7.1-@ember/string","type":"module"},{"id":"ember-4.7.1-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.7.1-Promise":"ember-4.7.1-Promise-e6a1058f83","ember-4.7.1-EventTarget":"ember-4.7.1-EventTarget-cf7cfcb037","ember-4.7.1-Container":"ember-4.7.1-Container-a149adb30a","ember-4.7.1-Registry":"ember-4.7.1-Registry-6755ae8394","ember-4.7.1-EmberENV":"ember-4.7.1-EmberENV-beb9413d42","ember-4.7.1-ContainerDebugAdapter":"ember-4.7.1-ContainerDebugAdapter-81ff26f90d","ember-4.7.1-DataAdapter":"ember-4.7.1-DataAdapter-cf03c570c5","ember-4.7.1-Ember.Templates.helpers":"ember-4.7.1-Ember.Templates.helpers-b881f89458","ember-4.7.1-ComponentStateBucket":"ember-4.7.1-ComponentStateBucket-53cb530e0b","ember-4.7.1-Component":"ember-4.7.1-Component-baee620d1f","ember-4.7.1-Helper":"ember-4.7.1-Helper-2e9ba4bf86","ember-4.7.1-ComputedProperty":"ember-4.7.1-ComputedProperty-8d5f02fac0","ember-4.7.1-Descriptor":"ember-4.7.1-Descriptor-39bd581a01","ember-4.7.1-Ember.InjectedProperty":"ember-4.7.1-Ember.InjectedProperty-5a9b4c4443","ember-4.7.1-Libraries":"ember-4.7.1-Libraries-398d09fc1b","ember-4.7.1-Mixin":"ember-4.7.1-Mixin-96c494c9c7","ember-4.7.1-Ember.ControllerMixin":"ember-4.7.1-Ember.ControllerMixin-c41000c39d","ember-4.7.1-Location":"ember-4.7.1-Location-1cece8f3c5","ember-4.7.1-HashLocation":"ember-4.7.1-HashLocation-89c4de3959","ember-4.7.1-HistoryLocation":"ember-4.7.1-HistoryLocation-2cc293870d","ember-4.7.1-NoneLocation":"ember-4.7.1-NoneLocation-43f411176f","ember-4.7.1-RouterService":"ember-4.7.1-RouterService-006cd89ba0","ember-4.7.1-RoutingService":"ember-4.7.1-RoutingService-49d7d403ad","ember-4.7.1-BucketCache":"ember-4.7.1-BucketCache-10a267cb89","ember-4.7.1-RouteInfoWithAttributes":"ember-4.7.1-RouteInfoWithAttributes-dc312207a8","ember-4.7.1-RouteInfo":"ember-4.7.1-RouteInfo-af9d77ee42","ember-4.7.1-Route":"ember-4.7.1-Route-6504517e50","ember-4.7.1-EmberRouter":"ember-4.7.1-EmberRouter-63908d4c0e","ember-4.7.1-Transition":"ember-4.7.1-Transition-5bbb8d3ca5","ember-4.7.1-Ember.ProxyMixin":"ember-4.7.1-Ember.ProxyMixin-827be409e1","ember-4.7.1-Ember.ActionHandler":"ember-4.7.1-Ember.ActionHandler-a1ca908fb5","ember-4.7.1-EmberArray":"ember-4.7.1-EmberArray-1a98ed04ad","ember-4.7.1-MutableArray":"ember-4.7.1-MutableArray-dde43b2d85","ember-4.7.1-Ember.NativeArray":"ember-4.7.1-Ember.NativeArray-d2a337fa89","ember-4.7.1-Ember.Comparable":"ember-4.7.1-Ember.Comparable-dcb86297db","ember-4.7.1-ContainerProxyMixin":"ember-4.7.1-ContainerProxyMixin-7423409046","ember-4.7.1-Enumerable":"ember-4.7.1-Enumerable-52c795a2da","ember-4.7.1-Evented":"ember-4.7.1-Evented-aff8932e1d","ember-4.7.1-Ember.MutableEnumerable":"ember-4.7.1-Ember.MutableEnumerable-8d59789932","ember-4.7.1-Observable":"ember-4.7.1-Observable-dde4a8e88c","ember-4.7.1-PromiseProxyMixin":"ember-4.7.1-PromiseProxyMixin-1a8e1fd130","ember-4.7.1-RegistryProxyMixin":"ember-4.7.1-RegistryProxyMixin-23cc508803","ember-4.7.1-Ember.TargetActionSupport":"ember-4.7.1-Ember.TargetActionSupport-d72ca028b6","ember-4.7.1-ArrayProxy":"ember-4.7.1-ArrayProxy-64ffe4ae7e","ember-4.7.1-CoreObject":"ember-4.7.1-CoreObject-6b3921f238","ember-4.7.1-Namespace":"ember-4.7.1-Namespace-eaf897d5f1","ember-4.7.1-EmberObject":"ember-4.7.1-EmberObject-274b944f82","ember-4.7.1-ObjectProxy":"ember-4.7.1-ObjectProxy-9e55a30a9e","ember-4.7.1-Ember.ActionSupport":"ember-4.7.1-Ember.ActionSupport-8421890e2c","ember-4.7.1-Ember.ClassNamesSupport":"ember-4.7.1-Ember.ClassNamesSupport-ac704e9c8e","ember-4.7.1-Ember.ViewMixin":"ember-4.7.1-Ember.ViewMixin-a40f7cc76c","ember-4.7.1-Ember.EventDispatcher":"ember-4.7.1-Ember.EventDispatcher-e7c0cf2047","ember-4.7.1-Ember.CoreView":"ember-4.7.1-Ember.CoreView-c8802cd529","ember-4.7.1-Application":"ember-4.7.1-Application-e17b29180b","ember-4.7.1-ApplicationInstance":"ember-4.7.1-ApplicationInstance-25b4f1b8b7","ember-4.7.1-ApplicationInstance.BootOptions":"ember-4.7.1-ApplicationInstance.BootOptions-e527a192b8","ember-4.7.1-Controller":"ember-4.7.1-Controller-8f10f92885","ember-4.7.1-Engine":"ember-4.7.1-Engine-b8f3ca3066","ember-4.7.1-EngineInstance":"ember-4.7.1-EngineInstance-24a7c4d1c6","ember-4.7.1-Ember.Error":"ember-4.7.1-Ember.Error-79e87e505a","ember-4.7.1-Renderer":"ember-4.7.1-Renderer-9ba9a91f8d","ember-4.7.1-Service":"ember-4.7.1-Service-4c154afcdd","ember-4.7.1-String":"ember-4.7.1-String-e75bd12199","ember-4.7.1-TestAdapter":"ember-4.7.1-TestAdapter-31e2c646fb","ember-4.7.1-Ember.Test.QUnitAdapter":"ember-4.7.1-Ember.Test.QUnitAdapter-48e1d6d3f3","ember-4.7.1-Ember.Test":"ember-4.7.1-Ember.Test-ae14b55041","ember-4.7.1-Ember":"ember-4.7.1-Ember-72927bf006","ember-4.7.1-Ember.Templates.components":"ember-4.7.1-Ember.Templates.components-a9e020b8f2","ember-4.7.1-rsvp":"ember-4.7.1-rsvp-0b7bebe823","ember-4.7.1-@ember/application":"ember-4.7.1-@ember/application-d1527389fe","ember-4.7.1-@ember/array":"ember-4.7.1-@ember/array-d5dd7471b6","ember-4.7.1-@ember/component":"ember-4.7.1-@ember/component-4751bdb445","ember-4.7.1-@ember/component/helper":"ember-4.7.1-@ember/component/helper-85fc6a8f92","ember-4.7.1-@ember/component/template-only":"ember-4.7.1-@ember/component/template-only-2407a6110e","ember-4.7.1-@ember/controller":"ember-4.7.1-@ember/controller-c5c17907f3","ember-4.7.1-@ember/debug":"ember-4.7.1-@ember/debug-63466a1e39","ember-4.7.1-@ember/destroyable":"ember-4.7.1-@ember/destroyable-bc9e6d5a2f","ember-4.7.1-@ember/engine":"ember-4.7.1-@ember/engine-906595b922","ember-4.7.1-@ember/helper":"ember-4.7.1-@ember/helper-4a647914fa","ember-4.7.1-@ember/instrumentation":"ember-4.7.1-@ember/instrumentation-4541feae9f","ember-4.7.1-@ember/object":"ember-4.7.1-@ember/object-7da375607e","ember-4.7.1-@ember/object/compat":"ember-4.7.1-@ember/object/compat-ec72b45317","ember-4.7.1-@ember/object/computed":"ember-4.7.1-@ember/object/computed-73eef52e37","ember-4.7.1-@ember/object/evented":"ember-4.7.1-@ember/object/evented-2a59cd9c1b","ember-4.7.1-@ember/object/events":"ember-4.7.1-@ember/object/events-2373b0669c","ember-4.7.1-@ember/object/internals":"ember-4.7.1-@ember/object/internals-a2025b83b7","ember-4.7.1-@ember/object/mixin":"ember-4.7.1-@ember/object/mixin-8b54f9bf19","ember-4.7.1-@ember/object/observers":"ember-4.7.1-@ember/object/observers-7a2fd05cc1","ember-4.7.1-@ember/polyfills":"ember-4.7.1-@ember/polyfills-e663722a81","ember-4.7.1-@ember/routing":"ember-4.7.1-@ember/routing-4dddf01d74","ember-4.7.1-@ember/runloop":"ember-4.7.1-@ember/runloop-979bbb1333","ember-4.7.1-@ember/service":"ember-4.7.1-@ember/service-3b19215466","ember-4.7.1-@ember/template":"ember-4.7.1-@ember/template-fc5428f28d","ember-4.7.1-@ember/test":"ember-4.7.1-@ember/test-21b861fae7","ember-4.7.1-@ember/utils":"ember-4.7.1-@ember/utils-8e1603069f","ember-4.7.1-@glimmer/tracking":"ember-4.7.1-@glimmer/tracking-84c6c4ff55","ember-4.7.1-@glimmer/tracking/primitives/cache":"ember-4.7.1-@glimmer/tracking/primitives/cache-d7f839e797"},"namespace":{"ember-4.7.1-AutoLocation":"ember-4.7.1-AutoLocation-fdb950ac52","ember-4.7.1-FEATURES":"ember-4.7.1-FEATURES-0ade06e8a6","ember-4.7.1-Instrumentation":"ember-4.7.1-Instrumentation-46b17e5d59"},"module":{"ember-4.7.1-rsvp":"ember-4.7.1-rsvp-ee2039c586","ember-4.7.1-@ember/debug":"ember-4.7.1-@ember/debug-9cb32c8496","ember-4.7.1-@ember/component":"ember-4.7.1-@ember/component-2fe5b25bc6","ember-4.7.1-@ember/routing":"ember-4.7.1-@ember/routing-99cce95724","ember-4.7.1-ember":"ember-4.7.1-ember-8dc9fceba5","ember-4.7.1-@ember/template":"ember-4.7.1-@ember/template-47bda07125","ember-4.7.1-@glimmer/component":"ember-4.7.1-@glimmer/component-f9704d567b","ember-4.7.1-@glimmer/tracking":"ember-4.7.1-@glimmer/tracking-ced6a19368","ember-4.7.1-@glimmer/tracking/primitives/cache":"ember-4.7.1-@glimmer/tracking/primitives/cache-f32ff16a53","ember-4.7.1-@ember/object":"ember-4.7.1-@ember/object-ffecfb317e","ember-4.7.1-@ember/utils":"ember-4.7.1-@ember/utils-4c98cff229","ember-4.7.1-@ember/application":"ember-4.7.1-@ember/application-7559b0aa2d","ember-4.7.1-@ember/array":"ember-4.7.1-@ember/array-fbe13e1b77","ember-4.7.1-@ember/enumerable":"ember-4.7.1-@ember/enumerable-e7d2966430","ember-4.7.1-@ember/canary-features":"ember-4.7.1-@ember/canary-features-da33056f9f","ember-4.7.1-@ember/component/template-only":"ember-4.7.1-@ember/component/template-only-4355a241ba","ember-4.7.1-@ember/controller":"ember-4.7.1-@ember/controller-ae7108a92c","ember-4.7.1-@ember/destroyable":"ember-4.7.1-@ember/destroyable-43b602f929","ember-4.7.1-@ember/engine":"ember-4.7.1-@ember/engine-abb0b1b8f7","ember-4.7.1-@ember/error":"ember-4.7.1-@ember/error-8c65011031","ember-4.7.1-@ember/helper":"ember-4.7.1-@ember/helper-1ee24e0c85","ember-4.7.1-@ember/instrumentation":"ember-4.7.1-@ember/instrumentation-532cf00570","ember-4.7.1-@ember/polyfills":"ember-4.7.1-@ember/polyfills-79d5043232","ember-4.7.1-@ember/renderer":"ember-4.7.1-@ember/renderer-c355523b49","ember-4.7.1-@ember/runloop":"ember-4.7.1-@ember/runloop-75d3cdb6c8","ember-4.7.1-@ember/service":"ember-4.7.1-@ember/service-ccea8ea57b","ember-4.7.1-@ember/string":"ember-4.7.1-@ember/string-9f25cfc8fe","ember-4.7.1-@ember/test":"ember-4.7.1-@ember/test-7f29139b25"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Ember.Object":"Ember.Object-9c32970d20","Error":"Error-158974c414"}}} \ No newline at end of file diff --git a/rev-index/ember-4.9.3.json b/rev-index/ember-4.9.3.json index 2b1473f23..cae9ad5e8 100644 --- a/rev-index/ember-4.9.3.json +++ b/rev-index/ember-4.9.3.json @@ -1 +1 @@ -{"data":{"id":"ember-4.9.3","type":"project-version","attributes":{"version":"4.9.3"},"relationships":{"classes":{"data":[{"id":"ember-4.9.3-Promise","type":"class"},{"id":"ember-4.9.3-EventTarget","type":"class"},{"id":"ember-4.9.3-Container","type":"class"},{"id":"ember-4.9.3-Registry","type":"class"},{"id":"ember-4.9.3-EmberENV","type":"class"},{"id":"ember-4.9.3-Ember.Templates.helpers","type":"class"},{"id":"ember-4.9.3-ComponentStateBucket","type":"class"},{"id":"ember-4.9.3-Component","type":"class"},{"id":"ember-4.9.3-Helper","type":"class"},{"id":"ember-4.9.3-ComputedProperty","type":"class"},{"id":"ember-4.9.3-Descriptor","type":"class"},{"id":"ember-4.9.3-Ember.InjectedProperty","type":"class"},{"id":"ember-4.9.3-Libraries","type":"class"},{"id":"ember-4.9.3-Ember.ProxyMixin","type":"class"},{"id":"ember-4.9.3-Ember.ActionHandler","type":"class"},{"id":"ember-4.9.3-Ember.Comparable","type":"class"},{"id":"ember-4.9.3-ContainerProxyMixin","type":"class"},{"id":"ember-4.9.3-RegistryProxyMixin","type":"class"},{"id":"ember-4.9.3-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.9.3-Ember.ActionSupport","type":"class"},{"id":"ember-4.9.3-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.9.3-Ember.ViewMixin","type":"class"},{"id":"ember-4.9.3-Ember.EventDispatcher","type":"class"},{"id":"ember-4.9.3-Ember.CoreView","type":"class"},{"id":"ember-4.9.3-Application","type":"class"},{"id":"ember-4.9.3-ApplicationInstance","type":"class"},{"id":"ember-4.9.3-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.9.3-Namespace","type":"class"},{"id":"ember-4.9.3-EmberArray","type":"class"},{"id":"ember-4.9.3-MutableArray","type":"class"},{"id":"ember-4.9.3-Ember.NativeArray","type":"class"},{"id":"ember-4.9.3-ArrayProxy","type":"class"},{"id":"ember-4.9.3-Ember.ControllerMixin","type":"class"},{"id":"ember-4.9.3-Ember.Controller","type":"class"},{"id":"ember-4.9.3-ContainerDebugAdapter","type":"class"},{"id":"ember-4.9.3-DataAdapter","type":"class"},{"id":"ember-4.9.3-Engine","type":"class"},{"id":"ember-4.9.3-EngineInstance","type":"class"},{"id":"ember-4.9.3-Enumerable","type":"class"},{"id":"ember-4.9.3-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.9.3-Ember.Error","type":"class"},{"id":"ember-4.9.3-CoreObject","type":"class"},{"id":"ember-4.9.3-Evented","type":"class"},{"id":"ember-4.9.3-EmberObject","type":"class"},{"id":"ember-4.9.3-Mixin","type":"class"},{"id":"ember-4.9.3-Observable","type":"class"},{"id":"ember-4.9.3-PromiseProxyMixin","type":"class"},{"id":"ember-4.9.3-ObjectProxy","type":"class"},{"id":"ember-4.9.3-Renderer","type":"class"},{"id":"ember-4.9.3-BucketCache","type":"class"},{"id":"ember-4.9.3-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.9.3-RouteInfo","type":"class"},{"id":"ember-4.9.3-RoutingService","type":"class"},{"id":"ember-4.9.3-Transition","type":"class"},{"id":"ember-4.9.3-HashLocation","type":"class"},{"id":"ember-4.9.3-HistoryLocation","type":"class"},{"id":"ember-4.9.3-Location","type":"class"},{"id":"ember-4.9.3-NoneLocation","type":"class"},{"id":"ember-4.9.3-Route","type":"class"},{"id":"ember-4.9.3-RouterService","type":"class"},{"id":"ember-4.9.3-EmberRouter","type":"class"},{"id":"ember-4.9.3-Service","type":"class"},{"id":"ember-4.9.3-String","type":"class"},{"id":"ember-4.9.3-TestAdapter","type":"class"},{"id":"ember-4.9.3-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.9.3-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.9.3-FEATURES","type":"namespace"},{"id":"ember-4.9.3-Instrumentation","type":"namespace"},{"id":"ember-4.9.3-AutoLocation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.9.3-rsvp","type":"module"},{"id":"ember-4.9.3-@ember/component","type":"module"},{"id":"ember-4.9.3-@ember/routing","type":"module"},{"id":"ember-4.9.3-ember","type":"module"},{"id":"ember-4.9.3-@ember/template","type":"module"},{"id":"ember-4.9.3-@glimmer/component","type":"module"},{"id":"ember-4.9.3-@glimmer/tracking","type":"module"},{"id":"ember-4.9.3-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.9.3-@ember/object","type":"module"},{"id":"ember-4.9.3-@ember/application","type":"module"},{"id":"ember-4.9.3-@ember/debug","type":"module"},{"id":"ember-4.9.3-@ember/utils","type":"module"},{"id":"ember-4.9.3-@ember/array","type":"module"},{"id":"ember-4.9.3-@ember/application/namespace","type":"module"},{"id":"ember-4.9.3-@ember/array/proxy","type":"module"},{"id":"ember-4.9.3-@ember/canary-features","type":"module"},{"id":"ember-4.9.3-@ember/component/template-only","type":"module"},{"id":"ember-4.9.3-ember/controller","type":"module"},{"id":"ember-4.9.3-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.9.3-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.9.3-@ember/destroyable","type":"module"},{"id":"ember-4.9.3-@ember/engine","type":"module"},{"id":"ember-4.9.3-@ember/enumerable","type":"module"},{"id":"ember-4.9.3-@ember/error","type":"module"},{"id":"ember-4.9.3-@ember/helper","type":"module"},{"id":"ember-4.9.3-@ember/instrumentation","type":"module"},{"id":"ember-4.9.3-@ember/object/core","type":"module"},{"id":"ember-4.9.3-@ember/object/evented","type":"module"},{"id":"ember-4.9.3-@ember/object/mixin","type":"module"},{"id":"ember-4.9.3-@ember/object/observable","type":"module"},{"id":"ember-4.9.3-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.9.3-@ember/object/proxy","type":"module"},{"id":"ember-4.9.3-@ember/polyfills","type":"module"},{"id":"ember-4.9.3-@ember/renderer","type":"module"},{"id":"ember-4.9.3-@ember/routing/auto-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/hash-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/history-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/location","type":"module"},{"id":"ember-4.9.3-@ember/routing/none-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/route","type":"module"},{"id":"ember-4.9.3-@ember/routing/router-service","type":"module"},{"id":"ember-4.9.3-@ember/routing/router","type":"module"},{"id":"ember-4.9.3-@ember/runloop","type":"module"},{"id":"ember-4.9.3-@ember/service","type":"module"},{"id":"ember-4.9.3-@ember/string","type":"module"},{"id":"ember-4.9.3-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.9.3-Container","type":"class"},{"id":"ember-4.9.3-Registry","type":"class"},{"id":"ember-4.9.3-ComponentStateBucket","type":"class"},{"id":"ember-4.9.3-Descriptor","type":"class"},{"id":"ember-4.9.3-Ember.InjectedProperty","type":"class"},{"id":"ember-4.9.3-Libraries","type":"class"},{"id":"ember-4.9.3-Ember.ProxyMixin","type":"class"},{"id":"ember-4.9.3-Ember.ActionHandler","type":"class"},{"id":"ember-4.9.3-Ember.Comparable","type":"class"},{"id":"ember-4.9.3-ContainerProxyMixin","type":"class"},{"id":"ember-4.9.3-RegistryProxyMixin","type":"class"},{"id":"ember-4.9.3-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.9.3-Ember.ActionSupport","type":"class"},{"id":"ember-4.9.3-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.9.3-Ember.ViewMixin","type":"class"},{"id":"ember-4.9.3-Ember.EventDispatcher","type":"class"},{"id":"ember-4.9.3-Ember.CoreView","type":"class"},{"id":"ember-4.9.3-Ember.ControllerMixin","type":"class"},{"id":"ember-4.9.3-Enumerable","type":"class"},{"id":"ember-4.9.3-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.9.3-BucketCache","type":"class"},{"id":"ember-4.9.3-RoutingService","type":"class"},{"id":"ember-4.9.3-Location","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.9.3-Promise","type":"class"},{"id":"ember-4.9.3-EventTarget","type":"class"},{"id":"ember-4.9.3-EmberENV","type":"class"},{"id":"ember-4.9.3-Ember.Templates.helpers","type":"class"},{"id":"ember-4.9.3-Component","type":"class"},{"id":"ember-4.9.3-Helper","type":"class"},{"id":"ember-4.9.3-ComputedProperty","type":"class"},{"id":"ember-4.9.3-Application","type":"class"},{"id":"ember-4.9.3-ApplicationInstance","type":"class"},{"id":"ember-4.9.3-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.9.3-Namespace","type":"class"},{"id":"ember-4.9.3-EmberArray","type":"class"},{"id":"ember-4.9.3-MutableArray","type":"class"},{"id":"ember-4.9.3-Ember.NativeArray","type":"class"},{"id":"ember-4.9.3-ArrayProxy","type":"class"},{"id":"ember-4.9.3-Ember.Controller","type":"class"},{"id":"ember-4.9.3-ContainerDebugAdapter","type":"class"},{"id":"ember-4.9.3-DataAdapter","type":"class"},{"id":"ember-4.9.3-Engine","type":"class"},{"id":"ember-4.9.3-EngineInstance","type":"class"},{"id":"ember-4.9.3-Ember.Error","type":"class"},{"id":"ember-4.9.3-CoreObject","type":"class"},{"id":"ember-4.9.3-Evented","type":"class"},{"id":"ember-4.9.3-EmberObject","type":"class"},{"id":"ember-4.9.3-Mixin","type":"class"},{"id":"ember-4.9.3-Observable","type":"class"},{"id":"ember-4.9.3-PromiseProxyMixin","type":"class"},{"id":"ember-4.9.3-ObjectProxy","type":"class"},{"id":"ember-4.9.3-Renderer","type":"class"},{"id":"ember-4.9.3-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.9.3-RouteInfo","type":"class"},{"id":"ember-4.9.3-Transition","type":"class"},{"id":"ember-4.9.3-HashLocation","type":"class"},{"id":"ember-4.9.3-HistoryLocation","type":"class"},{"id":"ember-4.9.3-NoneLocation","type":"class"},{"id":"ember-4.9.3-Route","type":"class"},{"id":"ember-4.9.3-RouterService","type":"class"},{"id":"ember-4.9.3-EmberRouter","type":"class"},{"id":"ember-4.9.3-Service","type":"class"},{"id":"ember-4.9.3-String","type":"class"},{"id":"ember-4.9.3-TestAdapter","type":"class"},{"id":"ember-4.9.3-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.9.3-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.9.3-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.9.3-FEATURES","type":"namespace"},{"id":"ember-4.9.3-AutoLocation","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.9.3-ember","type":"module"},{"id":"ember-4.9.3-@ember/enumerable","type":"module"},{"id":"ember-4.9.3-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.9.3-rsvp","type":"module"},{"id":"ember-4.9.3-@ember/component","type":"module"},{"id":"ember-4.9.3-@ember/routing","type":"module"},{"id":"ember-4.9.3-@ember/template","type":"module"},{"id":"ember-4.9.3-@glimmer/component","type":"module"},{"id":"ember-4.9.3-@glimmer/tracking","type":"module"},{"id":"ember-4.9.3-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.9.3-@ember/object","type":"module"},{"id":"ember-4.9.3-@ember/application","type":"module"},{"id":"ember-4.9.3-@ember/debug","type":"module"},{"id":"ember-4.9.3-@ember/utils","type":"module"},{"id":"ember-4.9.3-@ember/array","type":"module"},{"id":"ember-4.9.3-@ember/application/namespace","type":"module"},{"id":"ember-4.9.3-@ember/array/proxy","type":"module"},{"id":"ember-4.9.3-@ember/canary-features","type":"module"},{"id":"ember-4.9.3-@ember/component/template-only","type":"module"},{"id":"ember-4.9.3-ember/controller","type":"module"},{"id":"ember-4.9.3-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.9.3-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.9.3-@ember/destroyable","type":"module"},{"id":"ember-4.9.3-@ember/engine","type":"module"},{"id":"ember-4.9.3-@ember/error","type":"module"},{"id":"ember-4.9.3-@ember/helper","type":"module"},{"id":"ember-4.9.3-@ember/object/core","type":"module"},{"id":"ember-4.9.3-@ember/object/evented","type":"module"},{"id":"ember-4.9.3-@ember/object/mixin","type":"module"},{"id":"ember-4.9.3-@ember/object/observable","type":"module"},{"id":"ember-4.9.3-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.9.3-@ember/object/proxy","type":"module"},{"id":"ember-4.9.3-@ember/polyfills","type":"module"},{"id":"ember-4.9.3-@ember/renderer","type":"module"},{"id":"ember-4.9.3-@ember/routing/auto-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/hash-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/history-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/location","type":"module"},{"id":"ember-4.9.3-@ember/routing/none-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/route","type":"module"},{"id":"ember-4.9.3-@ember/routing/router-service","type":"module"},{"id":"ember-4.9.3-@ember/routing/router","type":"module"},{"id":"ember-4.9.3-@ember/runloop","type":"module"},{"id":"ember-4.9.3-@ember/service","type":"module"},{"id":"ember-4.9.3-@ember/string","type":"module"},{"id":"ember-4.9.3-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.9.3-Promise":"ember-4.9.3-Promise-bbd2b7cdd0","ember-4.9.3-EventTarget":"ember-4.9.3-EventTarget-14d9f4f31c","ember-4.9.3-Container":"ember-4.9.3-Container-ba3404559e","ember-4.9.3-Registry":"ember-4.9.3-Registry-4dd2fa2d92","ember-4.9.3-EmberENV":"ember-4.9.3-EmberENV-68c2425063","ember-4.9.3-Ember.Templates.helpers":"ember-4.9.3-Ember.Templates.helpers-4913c2f889","ember-4.9.3-ComponentStateBucket":"ember-4.9.3-ComponentStateBucket-2e5280e288","ember-4.9.3-Component":"ember-4.9.3-Component-602f9569eb","ember-4.9.3-Helper":"ember-4.9.3-Helper-4d0ddb2e49","ember-4.9.3-ComputedProperty":"ember-4.9.3-ComputedProperty-a2dae84355","ember-4.9.3-Descriptor":"ember-4.9.3-Descriptor-ee43f15ef4","ember-4.9.3-Ember.InjectedProperty":"ember-4.9.3-Ember.InjectedProperty-452fce8d83","ember-4.9.3-Libraries":"ember-4.9.3-Libraries-d81e94e6ec","ember-4.9.3-Ember.ProxyMixin":"ember-4.9.3-Ember.ProxyMixin-9db7045614","ember-4.9.3-Ember.ActionHandler":"ember-4.9.3-Ember.ActionHandler-824d70aee5","ember-4.9.3-Ember.Comparable":"ember-4.9.3-Ember.Comparable-e14e03900d","ember-4.9.3-ContainerProxyMixin":"ember-4.9.3-ContainerProxyMixin-3aeca3b8af","ember-4.9.3-RegistryProxyMixin":"ember-4.9.3-RegistryProxyMixin-26448a97d1","ember-4.9.3-Ember.TargetActionSupport":"ember-4.9.3-Ember.TargetActionSupport-c9654b4557","ember-4.9.3-Ember.ActionSupport":"ember-4.9.3-Ember.ActionSupport-a01cdd0d69","ember-4.9.3-Ember.ClassNamesSupport":"ember-4.9.3-Ember.ClassNamesSupport-db0c835342","ember-4.9.3-Ember.ViewMixin":"ember-4.9.3-Ember.ViewMixin-766a00e5ef","ember-4.9.3-Ember.EventDispatcher":"ember-4.9.3-Ember.EventDispatcher-ca7395917e","ember-4.9.3-Ember.CoreView":"ember-4.9.3-Ember.CoreView-cf50d78a4b","ember-4.9.3-Application":"ember-4.9.3-Application-81f75e0e46","ember-4.9.3-ApplicationInstance":"ember-4.9.3-ApplicationInstance-cfe10fde2e","ember-4.9.3-ApplicationInstance.BootOptions":"ember-4.9.3-ApplicationInstance.BootOptions-5bcf4b4ca7","ember-4.9.3-Namespace":"ember-4.9.3-Namespace-4c1af5edcb","ember-4.9.3-EmberArray":"ember-4.9.3-EmberArray-5acf29d7a1","ember-4.9.3-MutableArray":"ember-4.9.3-MutableArray-ce8a35218b","ember-4.9.3-Ember.NativeArray":"ember-4.9.3-Ember.NativeArray-ff16673a67","ember-4.9.3-ArrayProxy":"ember-4.9.3-ArrayProxy-611cda4edd","ember-4.9.3-Ember.ControllerMixin":"ember-4.9.3-Ember.ControllerMixin-d22b59bd9c","ember-4.9.3-Ember.Controller":"ember-4.9.3-Ember.Controller-d1c0c44fcf","ember-4.9.3-ContainerDebugAdapter":"ember-4.9.3-ContainerDebugAdapter-ac63489246","ember-4.9.3-DataAdapter":"ember-4.9.3-DataAdapter-f28fd65f5d","ember-4.9.3-Engine":"ember-4.9.3-Engine-6d1a32a6b3","ember-4.9.3-EngineInstance":"ember-4.9.3-EngineInstance-f8ea1b0109","ember-4.9.3-Enumerable":"ember-4.9.3-Enumerable-66f9c3218d","ember-4.9.3-Ember.MutableEnumerable":"ember-4.9.3-Ember.MutableEnumerable-f2fdd16362","ember-4.9.3-Ember.Error":"ember-4.9.3-Ember.Error-4f78ae8c31","ember-4.9.3-CoreObject":"ember-4.9.3-CoreObject-2b3e63234c","ember-4.9.3-Evented":"ember-4.9.3-Evented-24ebaf4b51","ember-4.9.3-EmberObject":"ember-4.9.3-EmberObject-9119a17360","ember-4.9.3-Mixin":"ember-4.9.3-Mixin-1813ed6f21","ember-4.9.3-Observable":"ember-4.9.3-Observable-5f8e1c88c1","ember-4.9.3-PromiseProxyMixin":"ember-4.9.3-PromiseProxyMixin-5339949407","ember-4.9.3-ObjectProxy":"ember-4.9.3-ObjectProxy-8986b9bdce","ember-4.9.3-Renderer":"ember-4.9.3-Renderer-d27fc8be29","ember-4.9.3-BucketCache":"ember-4.9.3-BucketCache-860c6eac99","ember-4.9.3-RouteInfoWithAttributes":"ember-4.9.3-RouteInfoWithAttributes-060c45326e","ember-4.9.3-RouteInfo":"ember-4.9.3-RouteInfo-5d9a134bb1","ember-4.9.3-RoutingService":"ember-4.9.3-RoutingService-a9d42c86ca","ember-4.9.3-Transition":"ember-4.9.3-Transition-c6298f5cd7","ember-4.9.3-HashLocation":"ember-4.9.3-HashLocation-c3bad35399","ember-4.9.3-HistoryLocation":"ember-4.9.3-HistoryLocation-c86c7c0b1c","ember-4.9.3-Location":"ember-4.9.3-Location-ae5a123641","ember-4.9.3-NoneLocation":"ember-4.9.3-NoneLocation-1e6cdced53","ember-4.9.3-Route":"ember-4.9.3-Route-3675074940","ember-4.9.3-RouterService":"ember-4.9.3-RouterService-8612a35316","ember-4.9.3-EmberRouter":"ember-4.9.3-EmberRouter-3c379820ee","ember-4.9.3-Service":"ember-4.9.3-Service-48e8ce2500","ember-4.9.3-String":"ember-4.9.3-String-9799961701","ember-4.9.3-TestAdapter":"ember-4.9.3-TestAdapter-e1524fc6af","ember-4.9.3-Ember.Test.QUnitAdapter":"ember-4.9.3-Ember.Test.QUnitAdapter-eeb3684dab","ember-4.9.3-Ember.Test":"ember-4.9.3-Ember.Test-926f2677ca","ember-4.9.3-Ember":"ember-4.9.3-Ember-ec719decd1","ember-4.9.3-Ember.Templates.components":"ember-4.9.3-Ember.Templates.components-4cce3ecc59","ember-4.9.3-rsvp":"ember-4.9.3-rsvp-f76ebfcf3a","ember-4.9.3-@ember/application":"ember-4.9.3-@ember/application-b43b6a90e2","ember-4.9.3-@ember/array":"ember-4.9.3-@ember/array-f19136c5c7","ember-4.9.3-@ember/component":"ember-4.9.3-@ember/component-5cdd62d7a2","ember-4.9.3-@ember/component/helper":"ember-4.9.3-@ember/component/helper-9aa2baea0c","ember-4.9.3-@ember/component/template-only":"ember-4.9.3-@ember/component/template-only-6cdbcf8cab","ember-4.9.3-@ember/debug":"ember-4.9.3-@ember/debug-564b2b4662","ember-4.9.3-@ember/destroyable":"ember-4.9.3-@ember/destroyable-c3b0d17e84","ember-4.9.3-@ember/engine":"ember-4.9.3-@ember/engine-d438214883","ember-4.9.3-@ember/helper":"ember-4.9.3-@ember/helper-7de90b9398","ember-4.9.3-@ember/instrumentation":"ember-4.9.3-@ember/instrumentation-a53f51aa84","ember-4.9.3-@ember/object":"ember-4.9.3-@ember/object-68b1166816","ember-4.9.3-@ember/object/compat":"ember-4.9.3-@ember/object/compat-fda2575b6f","ember-4.9.3-@ember/object/computed":"ember-4.9.3-@ember/object/computed-936f66e889","ember-4.9.3-@ember/object/evented":"ember-4.9.3-@ember/object/evented-59f283ba3b","ember-4.9.3-@ember/object/events":"ember-4.9.3-@ember/object/events-3224b81e03","ember-4.9.3-@ember/object/internals":"ember-4.9.3-@ember/object/internals-2054f0cd64","ember-4.9.3-@ember/object/mixin":"ember-4.9.3-@ember/object/mixin-2a74baeee8","ember-4.9.3-@ember/object/observers":"ember-4.9.3-@ember/object/observers-f334fb4d7b","ember-4.9.3-@ember/polyfills":"ember-4.9.3-@ember/polyfills-67a99859a6","ember-4.9.3-@ember/routing":"ember-4.9.3-@ember/routing-40f7d1d10c","ember-4.9.3-@ember/runloop":"ember-4.9.3-@ember/runloop-9f36282b55","ember-4.9.3-@ember/service":"ember-4.9.3-@ember/service-d15cca88f7","ember-4.9.3-@ember/template":"ember-4.9.3-@ember/template-234231b25c","ember-4.9.3-@ember/test":"ember-4.9.3-@ember/test-53bb27ce57","ember-4.9.3-@ember/utils":"ember-4.9.3-@ember/utils-b0c680613e","ember-4.9.3-@glimmer/tracking":"ember-4.9.3-@glimmer/tracking-410b8bd5e3","ember-4.9.3-@glimmer/tracking/primitives/cache":"ember-4.9.3-@glimmer/tracking/primitives/cache-2512ecfc8e","ember-4.9.3-Ember.@ember/controller":"ember-4.9.3-Ember.@ember/controller-4611fd2065"},"namespace":{"ember-4.9.3-FEATURES":"ember-4.9.3-FEATURES-4e43d03979","ember-4.9.3-Instrumentation":"ember-4.9.3-Instrumentation-4993e852f9","ember-4.9.3-AutoLocation":"ember-4.9.3-AutoLocation-6e731be74c"},"module":{"ember-4.9.3-rsvp":"ember-4.9.3-rsvp-bdb78f98b8","ember-4.9.3-@ember/component":"ember-4.9.3-@ember/component-0ec9fa38b1","ember-4.9.3-@ember/routing":"ember-4.9.3-@ember/routing-91727da1ff","ember-4.9.3-ember":"ember-4.9.3-ember-9570f3d373","ember-4.9.3-@ember/template":"ember-4.9.3-@ember/template-5502b2614f","ember-4.9.3-@glimmer/component":"ember-4.9.3-@glimmer/component-a922b7ede2","ember-4.9.3-@glimmer/tracking":"ember-4.9.3-@glimmer/tracking-1d659c0cdf","ember-4.9.3-@glimmer/tracking/primitives/cache":"ember-4.9.3-@glimmer/tracking/primitives/cache-90448e611f","ember-4.9.3-@ember/object":"ember-4.9.3-@ember/object-b6947940a6","ember-4.9.3-@ember/application":"ember-4.9.3-@ember/application-8fce58b58d","ember-4.9.3-@ember/debug":"ember-4.9.3-@ember/debug-b88b904bd6","ember-4.9.3-@ember/utils":"ember-4.9.3-@ember/utils-0640c2baa6","ember-4.9.3-@ember/array":"ember-4.9.3-@ember/array-2cebedda9a","ember-4.9.3-@ember/application/namespace":"ember-4.9.3-@ember/application/namespace-06b2928c38","ember-4.9.3-@ember/array/proxy":"ember-4.9.3-@ember/array/proxy-1a12ce2980","ember-4.9.3-@ember/canary-features":"ember-4.9.3-@ember/canary-features-4132cf1fd7","ember-4.9.3-@ember/component/template-only":"ember-4.9.3-@ember/component/template-only-700c071514","ember-4.9.3-ember/controller":"ember-4.9.3-ember/controller-7afc17d869","ember-4.9.3-@ember/debug/container-debug-adapter":"ember-4.9.3-@ember/debug/container-debug-adapter-21069b4e30","ember-4.9.3-@ember/debug/data-adapter":"ember-4.9.3-@ember/debug/data-adapter-539bdda598","ember-4.9.3-@ember/destroyable":"ember-4.9.3-@ember/destroyable-00455f62ed","ember-4.9.3-@ember/engine":"ember-4.9.3-@ember/engine-7b23d1459d","ember-4.9.3-@ember/enumerable":"ember-4.9.3-@ember/enumerable-3b067095be","ember-4.9.3-@ember/error":"ember-4.9.3-@ember/error-911f1f14c6","ember-4.9.3-@ember/helper":"ember-4.9.3-@ember/helper-522b563937","ember-4.9.3-@ember/instrumentation":"ember-4.9.3-@ember/instrumentation-dde6ec97cd","ember-4.9.3-@ember/object/core":"ember-4.9.3-@ember/object/core-84830a1199","ember-4.9.3-@ember/object/evented":"ember-4.9.3-@ember/object/evented-75817316fb","ember-4.9.3-@ember/object/mixin":"ember-4.9.3-@ember/object/mixin-72121a79b6","ember-4.9.3-@ember/object/observable":"ember-4.9.3-@ember/object/observable-647ac6254f","ember-4.9.3-@ember/object/promise-proxy-mixin":"ember-4.9.3-@ember/object/promise-proxy-mixin-60a1ae6a3f","ember-4.9.3-@ember/object/proxy":"ember-4.9.3-@ember/object/proxy-82efeab3f0","ember-4.9.3-@ember/polyfills":"ember-4.9.3-@ember/polyfills-839225a170","ember-4.9.3-@ember/renderer":"ember-4.9.3-@ember/renderer-f3d2825f50","ember-4.9.3-@ember/routing/auto-location":"ember-4.9.3-@ember/routing/auto-location-c7ce8e5aad","ember-4.9.3-@ember/routing/hash-location":"ember-4.9.3-@ember/routing/hash-location-79df39dfb0","ember-4.9.3-@ember/routing/history-location":"ember-4.9.3-@ember/routing/history-location-da0950e2dd","ember-4.9.3-@ember/routing/location":"ember-4.9.3-@ember/routing/location-5dbee2ea72","ember-4.9.3-@ember/routing/none-location":"ember-4.9.3-@ember/routing/none-location-dc81e640da","ember-4.9.3-@ember/routing/route":"ember-4.9.3-@ember/routing/route-7ad2999471","ember-4.9.3-@ember/routing/router-service":"ember-4.9.3-@ember/routing/router-service-0f68f863f1","ember-4.9.3-@ember/routing/router":"ember-4.9.3-@ember/routing/router-57bd420516","ember-4.9.3-@ember/runloop":"ember-4.9.3-@ember/runloop-1ae721053f","ember-4.9.3-@ember/service":"ember-4.9.3-@ember/service-befdc59fd9","ember-4.9.3-@ember/string":"ember-4.9.3-@ember/string-2adee138be","ember-4.9.3-@ember/test":"ember-4.9.3-@ember/test-2bb1ee6dd5"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Ember.Object":"Ember.Object-9c32970d20","Error":"Error-158974c414"}}} \ No newline at end of file +{"data":{"id":"ember-4.9.3","type":"project-version","attributes":{"version":"4.9.3"},"relationships":{"classes":{"data":[{"id":"ember-4.9.3-Promise","type":"class"},{"id":"ember-4.9.3-EventTarget","type":"class"},{"id":"ember-4.9.3-Container","type":"class"},{"id":"ember-4.9.3-Registry","type":"class"},{"id":"ember-4.9.3-EmberENV","type":"class"},{"id":"ember-4.9.3-Ember.Templates.helpers","type":"class"},{"id":"ember-4.9.3-ComponentStateBucket","type":"class"},{"id":"ember-4.9.3-Component","type":"class"},{"id":"ember-4.9.3-Helper","type":"class"},{"id":"ember-4.9.3-ComputedProperty","type":"class"},{"id":"ember-4.9.3-Descriptor","type":"class"},{"id":"ember-4.9.3-Ember.InjectedProperty","type":"class"},{"id":"ember-4.9.3-Libraries","type":"class"},{"id":"ember-4.9.3-Ember.ProxyMixin","type":"class"},{"id":"ember-4.9.3-Ember.ActionHandler","type":"class"},{"id":"ember-4.9.3-Ember.Comparable","type":"class"},{"id":"ember-4.9.3-ContainerProxyMixin","type":"class"},{"id":"ember-4.9.3-RegistryProxyMixin","type":"class"},{"id":"ember-4.9.3-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.9.3-Ember.ActionSupport","type":"class"},{"id":"ember-4.9.3-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.9.3-Ember.ViewMixin","type":"class"},{"id":"ember-4.9.3-Ember.EventDispatcher","type":"class"},{"id":"ember-4.9.3-Ember.CoreView","type":"class"},{"id":"ember-4.9.3-Application","type":"class"},{"id":"ember-4.9.3-ApplicationInstance","type":"class"},{"id":"ember-4.9.3-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.9.3-Namespace","type":"class"},{"id":"ember-4.9.3-EmberArray","type":"class"},{"id":"ember-4.9.3-MutableArray","type":"class"},{"id":"ember-4.9.3-Ember.NativeArray","type":"class"},{"id":"ember-4.9.3-ArrayProxy","type":"class"},{"id":"ember-4.9.3-Ember.ControllerMixin","type":"class"},{"id":"ember-4.9.3-Ember.Controller","type":"class"},{"id":"ember-4.9.3-ContainerDebugAdapter","type":"class"},{"id":"ember-4.9.3-DataAdapter","type":"class"},{"id":"ember-4.9.3-Engine","type":"class"},{"id":"ember-4.9.3-EngineInstance","type":"class"},{"id":"ember-4.9.3-Enumerable","type":"class"},{"id":"ember-4.9.3-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.9.3-Ember.Error","type":"class"},{"id":"ember-4.9.3-CoreObject","type":"class"},{"id":"ember-4.9.3-Evented","type":"class"},{"id":"ember-4.9.3-EmberObject","type":"class"},{"id":"ember-4.9.3-Mixin","type":"class"},{"id":"ember-4.9.3-Observable","type":"class"},{"id":"ember-4.9.3-PromiseProxyMixin","type":"class"},{"id":"ember-4.9.3-ObjectProxy","type":"class"},{"id":"ember-4.9.3-Renderer","type":"class"},{"id":"ember-4.9.3-BucketCache","type":"class"},{"id":"ember-4.9.3-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.9.3-RouteInfo","type":"class"},{"id":"ember-4.9.3-RoutingService","type":"class"},{"id":"ember-4.9.3-Transition","type":"class"},{"id":"ember-4.9.3-HashLocation","type":"class"},{"id":"ember-4.9.3-HistoryLocation","type":"class"},{"id":"ember-4.9.3-Location","type":"class"},{"id":"ember-4.9.3-NoneLocation","type":"class"},{"id":"ember-4.9.3-Route","type":"class"},{"id":"ember-4.9.3-RouterService","type":"class"},{"id":"ember-4.9.3-EmberRouter","type":"class"},{"id":"ember-4.9.3-Service","type":"class"},{"id":"ember-4.9.3-String","type":"class"},{"id":"ember-4.9.3-TestAdapter","type":"class"},{"id":"ember-4.9.3-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.9.3-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-4.9.3-FEATURES","type":"namespace"},{"id":"ember-4.9.3-Instrumentation","type":"namespace"},{"id":"ember-4.9.3-AutoLocation","type":"namespace"}]},"modules":{"data":[{"id":"ember-4.9.3-rsvp","type":"module"},{"id":"ember-4.9.3-@ember/component","type":"module"},{"id":"ember-4.9.3-@ember/routing","type":"module"},{"id":"ember-4.9.3-ember","type":"module"},{"id":"ember-4.9.3-@ember/template","type":"module"},{"id":"ember-4.9.3-@glimmer/component","type":"module"},{"id":"ember-4.9.3-@glimmer/tracking","type":"module"},{"id":"ember-4.9.3-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.9.3-@ember/object","type":"module"},{"id":"ember-4.9.3-@ember/application","type":"module"},{"id":"ember-4.9.3-@ember/debug","type":"module"},{"id":"ember-4.9.3-@ember/utils","type":"module"},{"id":"ember-4.9.3-@ember/array","type":"module"},{"id":"ember-4.9.3-@ember/application/namespace","type":"module"},{"id":"ember-4.9.3-@ember/array/proxy","type":"module"},{"id":"ember-4.9.3-@ember/canary-features","type":"module"},{"id":"ember-4.9.3-@ember/component/template-only","type":"module"},{"id":"ember-4.9.3-ember/controller","type":"module"},{"id":"ember-4.9.3-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.9.3-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.9.3-@ember/destroyable","type":"module"},{"id":"ember-4.9.3-@ember/engine","type":"module"},{"id":"ember-4.9.3-@ember/enumerable","type":"module"},{"id":"ember-4.9.3-@ember/error","type":"module"},{"id":"ember-4.9.3-@ember/helper","type":"module"},{"id":"ember-4.9.3-@ember/instrumentation","type":"module"},{"id":"ember-4.9.3-@ember/object/core","type":"module"},{"id":"ember-4.9.3-@ember/object/evented","type":"module"},{"id":"ember-4.9.3-@ember/object/mixin","type":"module"},{"id":"ember-4.9.3-@ember/object/observable","type":"module"},{"id":"ember-4.9.3-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.9.3-@ember/object/proxy","type":"module"},{"id":"ember-4.9.3-@ember/polyfills","type":"module"},{"id":"ember-4.9.3-@ember/renderer","type":"module"},{"id":"ember-4.9.3-@ember/routing/auto-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/hash-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/history-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/location","type":"module"},{"id":"ember-4.9.3-@ember/routing/none-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/route","type":"module"},{"id":"ember-4.9.3-@ember/routing/router-service","type":"module"},{"id":"ember-4.9.3-@ember/routing/router","type":"module"},{"id":"ember-4.9.3-@ember/runloop","type":"module"},{"id":"ember-4.9.3-@ember/service","type":"module"},{"id":"ember-4.9.3-@ember/string","type":"module"},{"id":"ember-4.9.3-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-4.9.3-Container","type":"class"},{"id":"ember-4.9.3-Registry","type":"class"},{"id":"ember-4.9.3-ComponentStateBucket","type":"class"},{"id":"ember-4.9.3-Descriptor","type":"class"},{"id":"ember-4.9.3-Ember.InjectedProperty","type":"class"},{"id":"ember-4.9.3-Libraries","type":"class"},{"id":"ember-4.9.3-Ember.ProxyMixin","type":"class"},{"id":"ember-4.9.3-Ember.ActionHandler","type":"class"},{"id":"ember-4.9.3-Ember.Comparable","type":"class"},{"id":"ember-4.9.3-ContainerProxyMixin","type":"class"},{"id":"ember-4.9.3-RegistryProxyMixin","type":"class"},{"id":"ember-4.9.3-Ember.TargetActionSupport","type":"class"},{"id":"ember-4.9.3-Ember.ActionSupport","type":"class"},{"id":"ember-4.9.3-Ember.ClassNamesSupport","type":"class"},{"id":"ember-4.9.3-Ember.ViewMixin","type":"class"},{"id":"ember-4.9.3-Ember.EventDispatcher","type":"class"},{"id":"ember-4.9.3-Ember.CoreView","type":"class"},{"id":"ember-4.9.3-Ember.ControllerMixin","type":"class"},{"id":"ember-4.9.3-Enumerable","type":"class"},{"id":"ember-4.9.3-Ember.MutableEnumerable","type":"class"},{"id":"ember-4.9.3-BucketCache","type":"class"},{"id":"ember-4.9.3-RoutingService","type":"class"},{"id":"ember-4.9.3-Location","type":"class"}]},"public-classes":{"data":[{"id":"ember-4.9.3-Promise","type":"class"},{"id":"ember-4.9.3-EventTarget","type":"class"},{"id":"ember-4.9.3-EmberENV","type":"class"},{"id":"ember-4.9.3-Ember.Templates.helpers","type":"class"},{"id":"ember-4.9.3-Component","type":"class"},{"id":"ember-4.9.3-Helper","type":"class"},{"id":"ember-4.9.3-ComputedProperty","type":"class"},{"id":"ember-4.9.3-Application","type":"class"},{"id":"ember-4.9.3-ApplicationInstance","type":"class"},{"id":"ember-4.9.3-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-4.9.3-Namespace","type":"class"},{"id":"ember-4.9.3-EmberArray","type":"class"},{"id":"ember-4.9.3-MutableArray","type":"class"},{"id":"ember-4.9.3-Ember.NativeArray","type":"class"},{"id":"ember-4.9.3-ArrayProxy","type":"class"},{"id":"ember-4.9.3-Ember.Controller","type":"class"},{"id":"ember-4.9.3-ContainerDebugAdapter","type":"class"},{"id":"ember-4.9.3-DataAdapter","type":"class"},{"id":"ember-4.9.3-Engine","type":"class"},{"id":"ember-4.9.3-EngineInstance","type":"class"},{"id":"ember-4.9.3-Ember.Error","type":"class"},{"id":"ember-4.9.3-CoreObject","type":"class"},{"id":"ember-4.9.3-Evented","type":"class"},{"id":"ember-4.9.3-EmberObject","type":"class"},{"id":"ember-4.9.3-Mixin","type":"class"},{"id":"ember-4.9.3-Observable","type":"class"},{"id":"ember-4.9.3-PromiseProxyMixin","type":"class"},{"id":"ember-4.9.3-ObjectProxy","type":"class"},{"id":"ember-4.9.3-Renderer","type":"class"},{"id":"ember-4.9.3-RouteInfoWithAttributes","type":"class"},{"id":"ember-4.9.3-RouteInfo","type":"class"},{"id":"ember-4.9.3-Transition","type":"class"},{"id":"ember-4.9.3-HashLocation","type":"class"},{"id":"ember-4.9.3-HistoryLocation","type":"class"},{"id":"ember-4.9.3-NoneLocation","type":"class"},{"id":"ember-4.9.3-Route","type":"class"},{"id":"ember-4.9.3-RouterService","type":"class"},{"id":"ember-4.9.3-EmberRouter","type":"class"},{"id":"ember-4.9.3-Service","type":"class"},{"id":"ember-4.9.3-String","type":"class"},{"id":"ember-4.9.3-TestAdapter","type":"class"},{"id":"ember-4.9.3-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-4.9.3-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-4.9.3-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-4.9.3-FEATURES","type":"namespace"},{"id":"ember-4.9.3-AutoLocation","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-4.9.3-ember","type":"module"},{"id":"ember-4.9.3-@ember/enumerable","type":"module"},{"id":"ember-4.9.3-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-4.9.3-rsvp","type":"module"},{"id":"ember-4.9.3-@ember/component","type":"module"},{"id":"ember-4.9.3-@ember/routing","type":"module"},{"id":"ember-4.9.3-@ember/template","type":"module"},{"id":"ember-4.9.3-@glimmer/component","type":"module"},{"id":"ember-4.9.3-@glimmer/tracking","type":"module"},{"id":"ember-4.9.3-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-4.9.3-@ember/object","type":"module"},{"id":"ember-4.9.3-@ember/application","type":"module"},{"id":"ember-4.9.3-@ember/debug","type":"module"},{"id":"ember-4.9.3-@ember/utils","type":"module"},{"id":"ember-4.9.3-@ember/array","type":"module"},{"id":"ember-4.9.3-@ember/application/namespace","type":"module"},{"id":"ember-4.9.3-@ember/array/proxy","type":"module"},{"id":"ember-4.9.3-@ember/canary-features","type":"module"},{"id":"ember-4.9.3-@ember/component/template-only","type":"module"},{"id":"ember-4.9.3-ember/controller","type":"module"},{"id":"ember-4.9.3-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-4.9.3-@ember/debug/data-adapter","type":"module"},{"id":"ember-4.9.3-@ember/destroyable","type":"module"},{"id":"ember-4.9.3-@ember/engine","type":"module"},{"id":"ember-4.9.3-@ember/error","type":"module"},{"id":"ember-4.9.3-@ember/helper","type":"module"},{"id":"ember-4.9.3-@ember/object/core","type":"module"},{"id":"ember-4.9.3-@ember/object/evented","type":"module"},{"id":"ember-4.9.3-@ember/object/mixin","type":"module"},{"id":"ember-4.9.3-@ember/object/observable","type":"module"},{"id":"ember-4.9.3-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-4.9.3-@ember/object/proxy","type":"module"},{"id":"ember-4.9.3-@ember/polyfills","type":"module"},{"id":"ember-4.9.3-@ember/renderer","type":"module"},{"id":"ember-4.9.3-@ember/routing/auto-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/hash-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/history-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/location","type":"module"},{"id":"ember-4.9.3-@ember/routing/none-location","type":"module"},{"id":"ember-4.9.3-@ember/routing/route","type":"module"},{"id":"ember-4.9.3-@ember/routing/router-service","type":"module"},{"id":"ember-4.9.3-@ember/routing/router","type":"module"},{"id":"ember-4.9.3-@ember/runloop","type":"module"},{"id":"ember-4.9.3-@ember/service","type":"module"},{"id":"ember-4.9.3-@ember/string","type":"module"},{"id":"ember-4.9.3-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-4.9.3-Promise":"ember-4.9.3-Promise-ba66e387f5","ember-4.9.3-EventTarget":"ember-4.9.3-EventTarget-14d9f4f31c","ember-4.9.3-Container":"ember-4.9.3-Container-43fb9ebfea","ember-4.9.3-Registry":"ember-4.9.3-Registry-71dfb8d80c","ember-4.9.3-EmberENV":"ember-4.9.3-EmberENV-68c2425063","ember-4.9.3-Ember.Templates.helpers":"ember-4.9.3-Ember.Templates.helpers-b4679d4a7b","ember-4.9.3-ComponentStateBucket":"ember-4.9.3-ComponentStateBucket-2e5280e288","ember-4.9.3-Component":"ember-4.9.3-Component-40d7674a65","ember-4.9.3-Helper":"ember-4.9.3-Helper-4b33087d53","ember-4.9.3-ComputedProperty":"ember-4.9.3-ComputedProperty-fba3337884","ember-4.9.3-Descriptor":"ember-4.9.3-Descriptor-ee43f15ef4","ember-4.9.3-Ember.InjectedProperty":"ember-4.9.3-Ember.InjectedProperty-452fce8d83","ember-4.9.3-Libraries":"ember-4.9.3-Libraries-d81e94e6ec","ember-4.9.3-Ember.ProxyMixin":"ember-4.9.3-Ember.ProxyMixin-9db7045614","ember-4.9.3-Ember.ActionHandler":"ember-4.9.3-Ember.ActionHandler-3db5b8f9ce","ember-4.9.3-Ember.Comparable":"ember-4.9.3-Ember.Comparable-e14e03900d","ember-4.9.3-ContainerProxyMixin":"ember-4.9.3-ContainerProxyMixin-f314a0b5f6","ember-4.9.3-RegistryProxyMixin":"ember-4.9.3-RegistryProxyMixin-2e5044d4cd","ember-4.9.3-Ember.TargetActionSupport":"ember-4.9.3-Ember.TargetActionSupport-969eb23226","ember-4.9.3-Ember.ActionSupport":"ember-4.9.3-Ember.ActionSupport-a01cdd0d69","ember-4.9.3-Ember.ClassNamesSupport":"ember-4.9.3-Ember.ClassNamesSupport-db0c835342","ember-4.9.3-Ember.ViewMixin":"ember-4.9.3-Ember.ViewMixin-6ab42457b6","ember-4.9.3-Ember.EventDispatcher":"ember-4.9.3-Ember.EventDispatcher-a03b3fcbaa","ember-4.9.3-Ember.CoreView":"ember-4.9.3-Ember.CoreView-2353d30d5c","ember-4.9.3-Application":"ember-4.9.3-Application-43aed54654","ember-4.9.3-ApplicationInstance":"ember-4.9.3-ApplicationInstance-b572dc6b03","ember-4.9.3-ApplicationInstance.BootOptions":"ember-4.9.3-ApplicationInstance.BootOptions-3526def202","ember-4.9.3-Namespace":"ember-4.9.3-Namespace-80572768a4","ember-4.9.3-EmberArray":"ember-4.9.3-EmberArray-07e1e73433","ember-4.9.3-MutableArray":"ember-4.9.3-MutableArray-cf1b6eb8d5","ember-4.9.3-Ember.NativeArray":"ember-4.9.3-Ember.NativeArray-5bef79fe04","ember-4.9.3-ArrayProxy":"ember-4.9.3-ArrayProxy-ab15b0f49f","ember-4.9.3-Ember.ControllerMixin":"ember-4.9.3-Ember.ControllerMixin-6be9d232ce","ember-4.9.3-Ember.Controller":"ember-4.9.3-Ember.Controller-96b81cc927","ember-4.9.3-ContainerDebugAdapter":"ember-4.9.3-ContainerDebugAdapter-26645589bf","ember-4.9.3-DataAdapter":"ember-4.9.3-DataAdapter-2fe326fb68","ember-4.9.3-Engine":"ember-4.9.3-Engine-8591e7b717","ember-4.9.3-EngineInstance":"ember-4.9.3-EngineInstance-9456711f8f","ember-4.9.3-Enumerable":"ember-4.9.3-Enumerable-66f9c3218d","ember-4.9.3-Ember.MutableEnumerable":"ember-4.9.3-Ember.MutableEnumerable-f2fdd16362","ember-4.9.3-Ember.Error":"ember-4.9.3-Ember.Error-4f78ae8c31","ember-4.9.3-CoreObject":"ember-4.9.3-CoreObject-a9be885c9f","ember-4.9.3-Evented":"ember-4.9.3-Evented-9140abcf3e","ember-4.9.3-EmberObject":"ember-4.9.3-EmberObject-ba11cf0728","ember-4.9.3-Mixin":"ember-4.9.3-Mixin-95dd4a2b86","ember-4.9.3-Observable":"ember-4.9.3-Observable-d45600817c","ember-4.9.3-PromiseProxyMixin":"ember-4.9.3-PromiseProxyMixin-cd6cc55779","ember-4.9.3-ObjectProxy":"ember-4.9.3-ObjectProxy-88d1a3960d","ember-4.9.3-Renderer":"ember-4.9.3-Renderer-d27fc8be29","ember-4.9.3-BucketCache":"ember-4.9.3-BucketCache-860c6eac99","ember-4.9.3-RouteInfoWithAttributes":"ember-4.9.3-RouteInfoWithAttributes-4a764a621f","ember-4.9.3-RouteInfo":"ember-4.9.3-RouteInfo-b5aa5d7adc","ember-4.9.3-RoutingService":"ember-4.9.3-RoutingService-a9d42c86ca","ember-4.9.3-Transition":"ember-4.9.3-Transition-c6298f5cd7","ember-4.9.3-HashLocation":"ember-4.9.3-HashLocation-3819338815","ember-4.9.3-HistoryLocation":"ember-4.9.3-HistoryLocation-49e9172b4d","ember-4.9.3-Location":"ember-4.9.3-Location-1e225d9147","ember-4.9.3-NoneLocation":"ember-4.9.3-NoneLocation-4c293ea8d5","ember-4.9.3-Route":"ember-4.9.3-Route-7fb7f0ac0c","ember-4.9.3-RouterService":"ember-4.9.3-RouterService-89e6f016de","ember-4.9.3-EmberRouter":"ember-4.9.3-EmberRouter-526f0b6750","ember-4.9.3-Service":"ember-4.9.3-Service-fabc99dc3d","ember-4.9.3-String":"ember-4.9.3-String-9d1fe4ff0f","ember-4.9.3-TestAdapter":"ember-4.9.3-TestAdapter-e1524fc6af","ember-4.9.3-Ember.Test.QUnitAdapter":"ember-4.9.3-Ember.Test.QUnitAdapter-eeb3684dab","ember-4.9.3-Ember.Test":"ember-4.9.3-Ember.Test-88554b0c49","ember-4.9.3-Ember":"ember-4.9.3-Ember-ec719decd1","ember-4.9.3-Ember.Templates.components":"ember-4.9.3-Ember.Templates.components-4a13188ac1","ember-4.9.3-rsvp":"ember-4.9.3-rsvp-2e3780fad8","ember-4.9.3-@ember/application":"ember-4.9.3-@ember/application-8e1d454bf6","ember-4.9.3-@ember/array":"ember-4.9.3-@ember/array-f19136c5c7","ember-4.9.3-@ember/component":"ember-4.9.3-@ember/component-5cdd62d7a2","ember-4.9.3-@ember/component/helper":"ember-4.9.3-@ember/component/helper-b14af9e15f","ember-4.9.3-@ember/component/template-only":"ember-4.9.3-@ember/component/template-only-6cdbcf8cab","ember-4.9.3-@ember/debug":"ember-4.9.3-@ember/debug-31e2202332","ember-4.9.3-@ember/destroyable":"ember-4.9.3-@ember/destroyable-d3db3664ab","ember-4.9.3-@ember/engine":"ember-4.9.3-@ember/engine-d438214883","ember-4.9.3-@ember/helper":"ember-4.9.3-@ember/helper-f169988bcc","ember-4.9.3-@ember/instrumentation":"ember-4.9.3-@ember/instrumentation-a53f51aa84","ember-4.9.3-@ember/object":"ember-4.9.3-@ember/object-00bcd70b8f","ember-4.9.3-@ember/object/compat":"ember-4.9.3-@ember/object/compat-bd64ed3f93","ember-4.9.3-@ember/object/computed":"ember-4.9.3-@ember/object/computed-4c06ab0354","ember-4.9.3-@ember/object/evented":"ember-4.9.3-@ember/object/evented-9d12e3e0b3","ember-4.9.3-@ember/object/events":"ember-4.9.3-@ember/object/events-3224b81e03","ember-4.9.3-@ember/object/internals":"ember-4.9.3-@ember/object/internals-2054f0cd64","ember-4.9.3-@ember/object/mixin":"ember-4.9.3-@ember/object/mixin-2a74baeee8","ember-4.9.3-@ember/object/observers":"ember-4.9.3-@ember/object/observers-f334fb4d7b","ember-4.9.3-@ember/polyfills":"ember-4.9.3-@ember/polyfills-343778b45f","ember-4.9.3-@ember/routing":"ember-4.9.3-@ember/routing-40f7d1d10c","ember-4.9.3-@ember/runloop":"ember-4.9.3-@ember/runloop-14243f212a","ember-4.9.3-@ember/service":"ember-4.9.3-@ember/service-f7cfc906ac","ember-4.9.3-@ember/template":"ember-4.9.3-@ember/template-2c1cd7b648","ember-4.9.3-@ember/test":"ember-4.9.3-@ember/test-60244a0695","ember-4.9.3-@ember/utils":"ember-4.9.3-@ember/utils-528db04803","ember-4.9.3-@glimmer/tracking":"ember-4.9.3-@glimmer/tracking-5342e8d52f","ember-4.9.3-@glimmer/tracking/primitives/cache":"ember-4.9.3-@glimmer/tracking/primitives/cache-0d4b890b27","ember-4.9.3-Ember.@ember/controller":"ember-4.9.3-Ember.@ember/controller-227e94ea2e"},"namespace":{"ember-4.9.3-FEATURES":"ember-4.9.3-FEATURES-4e43d03979","ember-4.9.3-Instrumentation":"ember-4.9.3-Instrumentation-31285eb2b0","ember-4.9.3-AutoLocation":"ember-4.9.3-AutoLocation-36b087cfce"},"module":{"ember-4.9.3-rsvp":"ember-4.9.3-rsvp-bdb78f98b8","ember-4.9.3-@ember/component":"ember-4.9.3-@ember/component-0cc60e7899","ember-4.9.3-@ember/routing":"ember-4.9.3-@ember/routing-91727da1ff","ember-4.9.3-ember":"ember-4.9.3-ember-9570f3d373","ember-4.9.3-@ember/template":"ember-4.9.3-@ember/template-5502b2614f","ember-4.9.3-@glimmer/component":"ember-4.9.3-@glimmer/component-afe29cbf27","ember-4.9.3-@glimmer/tracking":"ember-4.9.3-@glimmer/tracking-1d659c0cdf","ember-4.9.3-@glimmer/tracking/primitives/cache":"ember-4.9.3-@glimmer/tracking/primitives/cache-90448e611f","ember-4.9.3-@ember/object":"ember-4.9.3-@ember/object-b6947940a6","ember-4.9.3-@ember/application":"ember-4.9.3-@ember/application-8fce58b58d","ember-4.9.3-@ember/debug":"ember-4.9.3-@ember/debug-b88b904bd6","ember-4.9.3-@ember/utils":"ember-4.9.3-@ember/utils-0640c2baa6","ember-4.9.3-@ember/array":"ember-4.9.3-@ember/array-2cebedda9a","ember-4.9.3-@ember/application/namespace":"ember-4.9.3-@ember/application/namespace-06b2928c38","ember-4.9.3-@ember/array/proxy":"ember-4.9.3-@ember/array/proxy-1a12ce2980","ember-4.9.3-@ember/canary-features":"ember-4.9.3-@ember/canary-features-4132cf1fd7","ember-4.9.3-@ember/component/template-only":"ember-4.9.3-@ember/component/template-only-700c071514","ember-4.9.3-ember/controller":"ember-4.9.3-ember/controller-7afc17d869","ember-4.9.3-@ember/debug/container-debug-adapter":"ember-4.9.3-@ember/debug/container-debug-adapter-21069b4e30","ember-4.9.3-@ember/debug/data-adapter":"ember-4.9.3-@ember/debug/data-adapter-539bdda598","ember-4.9.3-@ember/destroyable":"ember-4.9.3-@ember/destroyable-00455f62ed","ember-4.9.3-@ember/engine":"ember-4.9.3-@ember/engine-7b23d1459d","ember-4.9.3-@ember/enumerable":"ember-4.9.3-@ember/enumerable-3b067095be","ember-4.9.3-@ember/error":"ember-4.9.3-@ember/error-911f1f14c6","ember-4.9.3-@ember/helper":"ember-4.9.3-@ember/helper-522b563937","ember-4.9.3-@ember/instrumentation":"ember-4.9.3-@ember/instrumentation-dde6ec97cd","ember-4.9.3-@ember/object/core":"ember-4.9.3-@ember/object/core-84830a1199","ember-4.9.3-@ember/object/evented":"ember-4.9.3-@ember/object/evented-75817316fb","ember-4.9.3-@ember/object/mixin":"ember-4.9.3-@ember/object/mixin-72121a79b6","ember-4.9.3-@ember/object/observable":"ember-4.9.3-@ember/object/observable-647ac6254f","ember-4.9.3-@ember/object/promise-proxy-mixin":"ember-4.9.3-@ember/object/promise-proxy-mixin-60a1ae6a3f","ember-4.9.3-@ember/object/proxy":"ember-4.9.3-@ember/object/proxy-82efeab3f0","ember-4.9.3-@ember/polyfills":"ember-4.9.3-@ember/polyfills-839225a170","ember-4.9.3-@ember/renderer":"ember-4.9.3-@ember/renderer-f3d2825f50","ember-4.9.3-@ember/routing/auto-location":"ember-4.9.3-@ember/routing/auto-location-c7ce8e5aad","ember-4.9.3-@ember/routing/hash-location":"ember-4.9.3-@ember/routing/hash-location-79df39dfb0","ember-4.9.3-@ember/routing/history-location":"ember-4.9.3-@ember/routing/history-location-da0950e2dd","ember-4.9.3-@ember/routing/location":"ember-4.9.3-@ember/routing/location-5dbee2ea72","ember-4.9.3-@ember/routing/none-location":"ember-4.9.3-@ember/routing/none-location-dc81e640da","ember-4.9.3-@ember/routing/route":"ember-4.9.3-@ember/routing/route-7ad2999471","ember-4.9.3-@ember/routing/router-service":"ember-4.9.3-@ember/routing/router-service-0f68f863f1","ember-4.9.3-@ember/routing/router":"ember-4.9.3-@ember/routing/router-57bd420516","ember-4.9.3-@ember/runloop":"ember-4.9.3-@ember/runloop-1ae721053f","ember-4.9.3-@ember/service":"ember-4.9.3-@ember/service-befdc59fd9","ember-4.9.3-@ember/string":"ember-4.9.3-@ember/string-2adee138be","ember-4.9.3-@ember/test":"ember-4.9.3-@ember/test-2bb1ee6dd5"},"missing":{"Ember.Namespace":"Ember.Namespace-13a8cc79d3","Ember.Object":"Ember.Object-9c32970d20","Error":"Error-158974c414"}}} \ No newline at end of file diff --git a/s3-docs/v4.12.1/ember-docs.json b/s3-docs/v4.12.3/ember-docs.json similarity index 99% rename from s3-docs/v4.12.1/ember-docs.json rename to s3-docs/v4.12.3/ember-docs.json index 7da4e58f3..0cbecc968 100644 --- a/s3-docs/v4.12.1/ember-docs.json +++ b/s3-docs/v4.12.3/ember-docs.json @@ -3,7 +3,7 @@ "name": "The Ember API", "description": "The Ember API: a framework for building ambitious web applications", "url": "https://emberjs.com/", - "version": "4.12.1" + "version": "4.12.3" }, "files": { "node_modules/rsvp/lib/rsvp/promise/all.js": { @@ -20092,4 +20092,4 @@ "line": " packages/@ember/service/index.ts:97" } ] -} +} \ No newline at end of file